[Libav-user] Mapping / converting QTCapture's to FFmpeg's pixel format

Carl Eugen Hoyos cehoyos at ag.or.at
Tue Feb 5 13:38:43 CET 2013


Alex Cohn <alexcohn at ...> writes:

> If I understand correctly, kCVPixelFormatType_420YpCbCr8Planar 
> exposes three fields:
> ComponentInfoY, ComponentInfoCb, and ComponentInfoCr. 
> But ffmpeg expects a contiguous byte array of Y 
> pixels (w*h), followed by Cb (w/2*h/2).
> 
> Therefore, even for conversion from
> kCVPixelFormatType_420YpCbCr8Planar to AV_PIX_FMT_YUV420P 
> you need some extra step: create a byte array of size 
> w*h*3/2 and copy the three planes to this array.

This does not sound correct.
AV_PIX_FMT_YUV420P is a planar format with three pointers, 
one for y, one for u and one for v.
This should correspond to the "ComponentInfo" pointer you 
mention above.

Carl Eugen



More information about the Libav-user mailing list