0

I am copying parts of a .m2v file, but somehow the quality of the new video file gets really bad.

Any idea what I am doing wrong or how to improve the command.

My current command looks like this:

ffmpeg -v quiet -y -i full.m2v -acodec copy -ss 00:00:00 -to 00:00:10 -sn part.m2v

2
  • 1
    Use -c copy...
    – Gyan
    Commented May 30, 2017 at 15:34
  • BTW: When copying from a compressed video stream, you need to make sure the resulting stream starts with an I-frame (full frame). Otherwise, you’ll get a corrupted picture until the first I-frame.
    – Daniel B
    Commented May 31, 2017 at 11:49

1 Answer 1

0

-acodec only refers to audio streams. (It is the same as -codec:a or -c:a.)

You should use -c copy to copy all streams, that is, video, audio and subtitles.

If only the video stream should be copied, use -c:v copy. In this case, ffmpeg will automatically choose an audio encoder, depending on the output format, and re-encode the first audio stream it finds. This is not preferable unless you also control the audio bitrate or quality.

PS: -ss 00:00:00 -to 00:00:10 can be abbreviated to -t 10, in that particular case.

3
  • Hi thanks for your answer I must only copy the video stream (.m2v)
    – utdev
    Commented May 31, 2017 at 11:19
  • Then, as with the audio case, use -c:v copy. But it's not recommended. If you want to disable audio, use -an.
    – slhck
    Commented May 31, 2017 at 11:43
  • where do I need to place the -an, what would the whole command look like?
    – utdev
    Commented May 31, 2017 at 14:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .