22

What is the difference between using -vcodec copy and -sameq with FFmpeg?

Do they do the same thing?

1

2 Answers 2

5

-sameq does not force you to use the same video codec. You can, for instance, convert H.264 to DivX while using -sameq.

5
  • If a video codec isn't specified then what's the difference?
    – tony_sid
    Commented Dec 30, 2010 at 21:35
  • 2
    If a video codec isn't specified, I think ffmpeg has default audio/video codecs for a given container. My ffmpeg on OS X defaults to mpeg4 yuv420p for video for MP4 and AVI, with libfaac and mp2 audio codecs, respectively. That is, if I chose an H.264 file and chose -vcodec copy, it selects libx264 for video. If instead I chose -sameq, it selects generic mpeg4.
    – fideli
    Commented Dec 31, 2010 at 2:48
  • Which is better to use if a video codec isn't specified?
    – tony_sid
    Commented Dec 31, 2010 at 19:38
  • Jedi, I don't understand your question above. Select the codec you want, in this case one your player supports.
    – CarlF
    Commented Jan 1, 2011 at 1:24
  • @OSXNINJA -vcodec copy specifies a codec.
    – quantum
    Commented Jul 21, 2012 at 15:07
36

The accepted answer is incorrect—or at least doesn't really explain what the options actually do.

  • -c:v copy tells FFmpeg to copy the bitstream of the video to the output. For example, your AVI video has an XviD video bitstream, and you can copy it to an MP4 container, without re-encoding the video. This, in essence, gives you the same quality, as nothing will be changed in the video bitstream.

    Here's an example that changes the container from AVI to MP4, if the video bitstream is valid for MP4 as well:

    ffmpeg -i input.avi -c:v copy output.mp4
    

    Again: FFmpeg will copy anything that it finds. There's no re-encoding happening here. Basically, FFmpeg just reads and writes the container and doesn't change the codecs.

  • sameq tells FFmpeg to use the same quantization parameters when converting video with the same codec that was used for the input. The option does not mean same quality. See: What is the “sameq” option in FFmpeg?

    The sameq option was removed from FFmpeg quite some time ago, so it cannot be used anymore, and if you have a version of ffmpeg that still has it, it's time to upgrade!

1

You must log in to answer this question.

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