On Thu, 2010-12-16 at 15:41 +0200, Aaron L. wrote:
> Hi all,
> 
> I am trying to encode preview frames from a camera on an android device to
> mpeg 4
> 
>  i set the desired codec format like this to get 420 YUV:
> m_codec->pix_fmt = PIX_FMT_YUV420P
> 
> the problem is the preview frames from android are linepack and not planar
> 
> (its not a huge block of U followed by a huge block of V - instead its
> UVUVUVUVUV under the big Y section)

Sounds like PIX_FMT_NV12.

> As a result my generated movie is mostly grey with a faint red and green
> stripes
> 
> 
> my question is: is there a format I can use instead of PIX_FMT_YUV420P which
> will allow me to use line pack preview frames or must i convert first from
> linepack to planar ...

No need to do any conversion. Just set up your AVFrames correctly.
avpicture_fill() would probably be enough in your case. Or it might
assume it's one byte Y plane followed by an U/V plane. In that case
you'll need to set up the data pointers and linesizes (aka strides)
yourself.

/Tomas

Attachment: signature.asc
Description: This is a digitally signed message part

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

Reply via email to