On Nov 17, 2009, at 9:35 AM, Glen Ruedinger wrote:

I trying to convert a captured video frame from YUYV to YUV420P, which on the surface appears to be a straight forward operation. From my research I thought the only difference is that the YUYV is a packed format and the
YUV420P is a planar format.  So what I tried to do is create a planar
buffer, and then move the bytes from the YUYV to the planar buffer.  Y
followed by V and then U

I did get a video image and brightness appears correct (the Y), but the
colors are incorrect (V and U).

Well, yuv420 is 4:2:0 sampled, and yuvu is 4:2:2. The colors are wrong how? Did you rescale the U and V to the correct height?

What that means is, taking for example a 320 x 240 movie, in 4:2:2, you would have 320 x 240 of Y, and 160 x 240 of U and V. There's lots of info about the packaging. The yuv420 version (4:2:0) has 320 x 240 of Y, but only 160 x 120 each of U and V.

Bruce




Any light anyone can shed on the difference that I'm missing would be
greatly appreciated.

And yes I know I can use libswscale to do the conversion but libswscale is
GPL'ed and I'm trying to only use LGPL code.

Thanks
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to