Skip to content

Which frames do I keep if my face swap needs exactly the second second of a 25 fps original?

Select frames 25 through 49 using a zero-based frame count. An exclusive end at frame 50 yields 25 frames. Reset the timestamps on the excerpt so its first retained frame plays at time zero.

PLAN AN EXTERNAL VIDEO REPAIRAISwapLab team · Editorial methodPublished 2 min read
See the recorded exampleExplore 67 Image SkillsIndependent finishing · Check the actual file

Set up the edit

Locate the cast member at frame 25 of the original and compare that image with the new excerpt's first frame. The last image should match original frame 49. Count decoded frames rather than relying on a rounded player duration.

shell
ffmpeg -i studio.mp4 -filter_complex "[0:v:0]trim=start_frame=25:end_frame=50,setpts=PTS-STARTPTS[proof]" -map "[proof]" -fps_mode passthrough -c:v ffv1 inspection.mkv

Read the result

This is useful when the intake note says to replace only the second second. Including frame 50 silently puts the next action into the job. At another frame rate, map the requested timeline interval to that source's actual frames.

With the original living-room dance, the local FFmpeg run decoded 25 video frames at 1280 × 720 pixels. Use the linked file to reproduce the example. This was an offline edit of the existing public clip.

If the first pass falls short

If the footage has irregular presentation times, select by timestamp and verify the frame at each end. A frame number inferred from a nominal rate can select the wrong action.

Sources

Review the result in context.

Compare the recorded example and its documented limitations.

See the recorded example