Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

convert H264 video to raw YUV format

Is it possible to create a raw YUV video from H264 encoded video using ffmpeg? I want to open the video with matlab and access Luma, Cb and Cr components frame by frame.

like image 215
Necip Onur Uzun Avatar asked Dec 16 '13 11:12

Necip Onur Uzun


People also ask

Can VLC play YUV?

YUV is a class of pixel formats used in video applications, including VLC media player.

What is YUV format?

YUV is a color model typically used as part of a color image pipeline. It encodes a color image or video taking human perception into account, allowing reduced bandwidth for chrominance components, compared to a "direct" RGB-representation.

How do you play YUV in Ffplay?

Here is the command to play a YUV video using ffplay . The parameters are pretty self-explanatory at this point. To control ffplay , you can use your spacebar to pause/play, f to toggle between full-screen and native display size, and the arrow keys to skip forward and back.


1 Answers

Yes you can, you just have to specific the pixel format. To get the whole list of the format:

ffmpeg -pix_fmts | grep -i pixel_format_name 

For example if you want to save the 1st video track of an mp4 file as a yuv420p (p means planar) file:

ffmpeg -i video.mp4 -c:v rawvideo -pix_fmt yuv420p out.yuv 
like image 83
alexbuisson Avatar answered Sep 20 '22 15:09

alexbuisson