Ah yes, not sure how I missed that.  The color appeared ghosted from the
bottom half of the screen to the top.  If my hand was in the bottom of the
frame then a color ghost was in the top half.  Which makes sense based on
what you just said.  For some reason I was thinking they were the same size
just packed differently.  Now I see my mistake.  I guess I shouldn't be
coding at 1:00am....

So what I was doing was taking 160 x 240 U and copying it over the what was
supposed to be 160 x 120 U and then also over the 160 x 120 V and missing
the V altogether.

So by going from 4:2:2 to 4:2:0 i'm actually losing half of my color
information.

I'll need to investigate the encode codec more as I hate to lose color
information if I can avoid it.

Thanks


On Tue, Nov 17, 2009 at 12:57 PM, Bruce Wheaton <[email protected]>wrote:

> 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
>
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to