Media (Intel® Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools like Intel® oneAPI Video Processing Library and Intel® Media SDK
Announcements
The Intel Media SDK project is no longer active. For continued support and access to new features, Intel Media SDK users are encouraged to read the transition guide on upgrading from Intel® Media SDK to Intel® Video Processing Library (VPL), and to move to VPL as soon as possible.
For more information, see the VPL website.

how to convert I420 to yv12

china_y_
Beginner
654 Views

hi body

i am using the intel sdk sample .

what i got is I420 but the encode needs yv12 

how can i convert I420 to yv12 without the intel media  sdk

0 Kudos
2 Replies
dr_asik
Beginner
654 Views

ffmpeg's swscale should do the trick. Alternatively, it's very easy to code this yourself. Look at the definitions of the formats:

http://www.fourcc.org/yuv.php#YV12

http://www.fourcc.org/yuv.php#IYUV

I420 is exactly the same as YV12 except that the order of the U and V planes is reversed. Three memcpys are you're done.

0 Kudos
Anthony_P_Intel
Employee
654 Views

and, the file writer part of sample code can be changed to write YV12 instead of I420, as the actual MediaSDK API is 3 pointers to the 3 planes (allowing direct support for all YUV420 variants), and the only thing making it a "YV12" file is the code that writes it out in that order.

0 Kudos
Reply