[Libav-user] How can i extract Y plane from any frame in video

Alex Cohn alexcohn at netvision.net.il
Sat Jul 2 15:45:42 CEST 2011

On Wednesday, June 29, 2011, Amir Rouhi-Rmit <amir.rouhi at rmit.edu.au> wrote:
> For generating raw images from every second of an input video,when i use the below command:
> ffmpeg -i c:\test\animals.wmv -r 1 -f image2 -vcodec rawvideo -pix_fmt yuvj420p c:\test\Img-%03d.yuv
>  for every second of the video the ffmpeg generate two types of files:
> Img---.yuU  and Img---.yuv
> And when i open the yuv file(with Irfanview), the 1/4th of the top part of the image has been chopped and filled with smooth green colour. The rest colour theme of the whole picture is also in green scale. (I use Irfanview /open raw and enter height and width and 24 BPP and yuv 420.

The green yuv files are most probably jpeg files in disguise. Make
sure these are not leftovers from another attempt to run ffmpeg.

> but without -vcodec rawvideo ffmpeg generate only Img---.yuv files. But this file can not be opened as raw files and actually are jpg with yuv extension.( As you told it is because the default of image2 which is jpg)

> BTW how can i see the different switches of -vcodec? (ffmpeg -vcodec list does not show any list)

ffmpeg -codecs

> --
> Amir H. Rouhi
> PhD Student/ CSIT RMIT University
> Room: 14-09-04
> rouhi_amirhossein at student.rmit.edu.au
> amir.rouhi at rmit.edu.au

More information about the Libav-user mailing list