5

I use this to cut a part out of a mp4 file:

ffmpeg -i input.mp4 -vcodec copy -acodec copy -ss 00:36:18 -to 00:39:50 output.mp4

It works good but the video image is always freezed in the beginning for 1 second.

Doesnt matter which video file I try and cut a part out of, it takes like 1 second before the video start.

Heres an example:

Why?

  • It seems your youtube link is down, could you please keep the example live such that the question remains useful for future visitors? – Saaru Lindestøkke Oct 18 '15 at 12:41
3

The video freezes because you aren't cutting at an I-frame, while using stream-copy mode. You'll have to re-encode the video, or choose a different start point, which happens to be an I-frame.

3

The order of the parameters is very important on ffmpeg.
Try this:

ffmpeg -ss 00:36:18 -i input.mp4 -vcodec copy -acodec copy -to 00:39:50 output.mp4

It seems that setting the -ss parameter before -i sets a keyframe at the beginning of the newly generated video.
Or so I understand from the Wiki page here.

  • 1
    Minor note: That's the wiki, not the official documentation. The wiki articles are written by users to supplement the docs, so they may contain less accurate information. – llogan Oct 17 '15 at 17:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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