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

Stefano Sabatini stefano.sabatini-lala at poste.it
Wed Jun 22 11:07:38 CEST 2011

On date Friday 2011-06-17 12:37:54 +0200, Stefano Sabatini encoded:
> On date Thursday 2011-06-16 16:02:43 +1000, Amir Rouhi-Rmit encoded:
> > I know that i can extract images of a video by ffmpeg as can be seen in
> > below command:
> > ffmpeg -i input.avi -r 1 -s WxH -f image2 Img-%03d.jpeg
> > But what i want is a separated Y plane and cb and cr plane. can i i achieve
> > this by ffmpeg? if yes pleas let me now how and if no do you suggest any
> > idea?
> You may use the .Y raw image format:
> ffmpeg -i input.avi -r 1 -s WxH -f image2 Img-%03d.Y
> to get separate .Y, .U, .V raw images.

> A possibly better solution
> would be to use the lut filter, soon to be committed,

lut* filters were committed, you can try the following command:
-vf "lutyuv=y=val : u=128 : v=128"
-vf "lutyuv=y=0   : u=val : v=128"
-vf "lutyuv=y=0   : u=128 : v=val"

to set to 0 the other components in the filtered image.

More information about the Libav-user mailing list