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

Amir Rouhi-Rmit amir.rouhi at rmit.edu.au
Wed Jun 29 04:34:08 CEST 2011

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.

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)

On Tue, Jun 28, 2011 at 7:14 PM, Alex Cohn <alexcohn at netvision.net.il>wrote:

> Amir,
> > 1- i convert a video to yuv images (1 image per second) as below:
> > ffmpeg -i c:\test\animals.wmv -r 1 -f image2 -s 320x240 -pix_fmt yuvj420p
> c:\test\Img-%03d.yuv
> By default, -f image2 produces JPEG files. You should use -vcodec
> rawvideo to produce yuv420 images, e.g.
> ffmpeg -i c:\test\animals.wmv -r 1 -f image2 -vcodec rawvideo -pix_fmt
> yuvj420p c:\test\Img-%03d.yuv
> Note that you can skip -s if you do not resize the result.
> Sincerely,
> Alex
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20110629/feef2a3b/attachment.html>

More information about the Libav-user mailing list