Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

Do they do the same thing?

share|improve this question
up vote 3 down vote accepted

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

share|improve this answer
If a video codec isn't specified then what's the difference? – tony_sid Dec 30 '10 at 21:35
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 Dec 31 '10 at 2:48
Which is better to use if a video codec isn't specified? – tony_sid Dec 31 '10 at 19:38
Jedi, I don't understand your question above. Select the codec you want, in this case one your player supports. – CarlF Jan 1 '11 at 1:24
@OSXNINJA -vcodec copy specifies a codec. – quantum Jul 21 '12 at 15:07

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.

    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?

    Example that re-encodes an XviD video bitstream with XviD again, using the same quantizer:

    ffmpeg -i input.avi -c:v libxvid -sameq -c:a libmp3lame output.avi

    I can't think of any cases where you'd really want to use that.

share|improve this answer

You must log in to answer this question.

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