[FFmpeg-user] container for yuv

Dave Rice daverice at mac.com
Tue Dec 20 15:35:32 CET 2011

On Dec 20, 2011, at 9:29 AM, Donald McLachlan wrote:

> Hi All,
> I'm not a video guy so please bear with me if I get some terminology not quite right.
> I was asked to convert a 4K video to YUV. So I used:

The request doesn't really provide enough information. 4K is a vague reference to frame size while YUV is a colorspace. It may be that your 4K file is already in YUV. If not then you could convert it to yuv using the -pix_fmt option.

>    ffmpeg -i inputFile.mp4 -f rawvideo outputFile.yuv
> Because the output file is raw video without a container, players like mplayer cannot play this file without being given the frame size etc. on the command line.
> I was pointed to YUV4MPEG2 http://wiki.multimedia.cx/index.php?title=YUV4MPEG2
> I looked at the output of ffmpeg -codecs, but I did not see anything that looks like this, nor did I see anything that (to me) says it can put YUV into a container.

yuv4mpeg2 is a format rather than a codec
ffmpeg -i inputFile.mp4 -pix_fmt yuv420p -f yuv4mpegpipe outputFile.y4m

If yuv420p is not appropriate use the correct pixel format for the situation. Also note that this command doesn't change the frame size so your output will still be 4K if the input is 4K.
Dave Rice

More information about the ffmpeg-user mailing list