I have a video file a.flv. I want to use ffmepg to edit it. As I understand, each second of the video is a series of frames. What I want is to take the first frame of the fifth second and replace all frames before it. So the result video has exactly the same video data from the beginning to the first frame of the fifth second. Is it possible to do this using ffmpeg?

1 Answer 1


You can use a combination of the trim and tpad filters for this.

ffmpeg -i in.flv -vf "trim=4,setpts=PTS-STARTPTS,tpad=start_duration=4:start_mode=clone" -c:v libx264 -c:a copy out.flv

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.