Search code examples
videoffmpegvideo-editing

Is There a Difference between These 2 FFMPEG Commands?


If you have a 1:30h video, and you want to cut a part of it without re-encoding it, you can use FFMPEG for that.

For example, To cuts a 30 mins video out of an original video, starting at 15mins 30secs, the command will be:

FFMPEG -i "C:\Input.mp4" -vcodec copy -acodec copy -ss 00:15:30.000 -t 00:30:00.000 "C:\Output.mp4"

But also this should do it:

FFMPEG -i "C:\Input.mp4" -ss 00:15:30.000 -codec copy -t 00:30:00.000 "C:\Output.mp4"

As you can see the options for the codec are different. The first specifically specifies the v and a ones (video and audio), and the second one just uses -codec..

Is there a difference between the two?
Might there be additional codecs in addition to the a and v? (and the -codec will include all types?)

Thank you


Solution

  • -codec copy will try to copy all streams as you guessed, not just the audio and video. You can also have other stream types like those noted in the documentation. For eg:

    ’v’ or ’V’ for video, ’a’ for audio, ’s’ for subtitle, ’d’ for data, and ’t’ for attachments. ’v’ matches all video streams, ’V’ only matches video streams which are not attached pictures, video thumbnails or cover arts

    You can even attempt to copy unknown streams with -copy_unknown.