Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Yabo_W_
Beginner
130 Views

sample_vpp_drm convert yv12 to nv12

Hi all:

I had a test of sample_vpp_drm, which is Intel media SDK 1.10's sample. My output pixel format is nv12, and I think the order of U and V  is reversed.

first step: create a yv12 rawvideo with ffmpeg:

./ffmpeg -i /mnt/upload/MPEGTS/Earth_TR2_1080.ts -frames 500  -vcodec rawvideo -pix_fmt yuv420p -s 1920x1080 -an ./input_yv12.yuv

second step: 

convert input_yv12.yuv from yv12 to nv12:

sudo ./_bin/x64/sample_vpp_drm -lib hw -sw 1920 -sh 1080 -scc yv12 -spic 0 -dcc nv12 -dw 1920 -dh 1080 -i ./input_yv12.yuv -o ./output.yuv

finally:

play output.yuv with ffplay:

ffplay -pix_fmt nv12 output.yuv

nv12.png

the output's color is incorrect

but when I use nv21 pixer format, the output's color is correct:

ffplay -pix_fmt nv21 output.yuv

nv21.png

the input_yv12.yuv is like this:

ffplay -pix_fmt yuv420p -s 1920x1080 input_yv12.yuv

yv12.png

0 Kudos
2 Replies
Surbhi_M_Intel
Employee
130 Views

Hi Yabo, 

Can you please check again if the input this is generated is YV12 input. They YV12 format is quite same as YUV420p but the U and V data is reversed. If you don't have tool to check that, then you can use YUV tool kit available online to check. 
I think because of assuming the input to be YV12, the colors of output is reversed. Please let us know your findings

Thanks
-Surbhi

Yabo_W_
Beginner
130 Views

Hi SURBHI

This is my fault.They YV12 format is quite same as YUV420p but the U and V data is reversed. Below is the explain of YUV420P and YV12

http://en.wikipedia.org/wiki/YUV#Y.27UV420p_.28and_Y.27V12_or_YV12.29_to_RGB888_conversion

Best regards!

Thanks!

Reply