[Libav-user] how to convert NV21 to YUV420P with swscale

Peter Pan hawkwithwind at gmail.com
Thu Oct 2 15:19:08 CEST 2014


"Carl Eugen Hoyos" <cehoyos at ag.or.at> writes:
>
> Peter Pan <hawkwithwind at ...> writes:
>
> > params.setPreviewFormat(ImageFormat.NV21);
>
> > the code works well if the src image is PIX_FMT_YUYV422,
> > with android camera set to
> > params.setPreviewFormat(ImageFormat.YUY2);
>
> Doesn't this simply indicate that what the camera
> calls "NV21" is not "AV_PIX_FMT_NV21"?
>
> (You really shouldn't use PIX_FMT_*)
>
> Carl Eugen
>

Hi Carl,

Thanks for your reply.

> Doesn't this simply indicate that what the camera
> calls "NV21" is not "AV_PIX_FMT_NV21"?

Maybe you are right, can you help me with this?
How can I find out what the format exactly is?
I've tried "AV_PIX_FMT_NV21" and "AV_PIX_FMT_NV12",
either does not work.

> (You really shouldn't use PIX_FMT_*)
Thank you, I will use those defines with AV prefix.

Thanks,
Peter


More information about the Libav-user mailing list