[FFmpeg-user] About the command -vcodec

Werner Robitza werner.robitza at gmail.com
Sun Sep 15 11:46:20 CEST 2013

On Sun, Sep 15, 2013 at 4:46 AM, 陈立 <kidney at mail.ustc.edu.cn> wrote:
> And I tried
> ffmpeg -vcodec rawvideo -pix_fmt yuv420p -s 1024x768 -r 30 -i balloons1.yuv -vcodec rawvideo -pix_fmt yuv420p
>  -frames 300 -r 30 balloons1_output.yuv
> balloons1.yuv is bit-identical with balloons1_output.yuv. It seems rawvideo will copy the input to the output in my case.

No, it will not copy the bitstream. But since you're taking a YUV
4:2:0 planar video, decode it, and encode it to YUV 4:2:0 planar,
there will be no observed difference between your input and output, as
the whole process is lossless.

Put differently, if your input is a raw yuv420p stream, these are equivalent:

ffmpeg -c:v rawvideo -pix_fmt … -s … -r … -i input -c:v copy output
ffmpeg -c:v rawvideo -pix_fmt … -s … -r … -i input -c:v rawvideo
-pix_fmt … -r … output

> But I tried using copy instead of rawvideo. The error turns out and said "Unknown decoder copy".

When you specify a codec option before "-i", you tell ffmpeg how to
decode the input. "copy" cannot be used as a decoder. You can only use
it as an encoder. So, this is okay:

ffmpeg -i input -c:v copy output

This is not okay:

ffmpeg -c:v copy -i input output

The only reasonable case in which you need to tell ffmpeg how to
decode the input is when you use a raw video stream without a
container, e.g. a YUV file.

More information about the ffmpeg-user mailing list