Community
cancel
Showing results for 
Search instead for 
Did you mean: 
gparag1983
Beginner
91 Views

VPP conversion is not working properly with 720*576 buffer

Jump to solution

Hello,

In my application, I am using VPP  for color conversion (UYVY to NV12)and for scaling during H264 encoding.

If I encode H264 or Mpeg in HD mode (1920*1080), file is recorded properly. (Output image is proper)

But when I encode in SD mode (720*576), output file image is totally distorted,

If my input buffer size is 1920*1080 size and I encode in 720*576 size then also output file is recorded properly.

But when my input buffer is 720*576 size and I encode in 720*576 or 1920*1080 size then also output file is totally distorted.

If I do color conversion from UYVY to YV12 and scaling using third party application then its works fine.

Please find my system configuration and log generated during HD mode recording and SD mode recording. Also image of SD mode recorded file.

Regards

Parag Gandhi

0 Kudos
1 Solution
Brooks_L_
New Contributor I
91 Views

Parag, I eventually got to know what the cause is for my failure. That's a small stupid mistake in the code. When I copy the NV12 data after conversion, for each line, I copied 'width' bytes to the destination buffer, offered by surface, instead of the right number of bytes indicated by 'pitch'. And usually, pitch is more than width for an video frame to encoded. Encoder needs some stuffing to make line data aligned to 16 or more as I understand. So, consequently, in my destination buffer, for each line, the contained data is beyond one line and additionally, part of next line's data fills the gap between pitch and width. At last, my picture after encoding is distorted. That's my story. Little insteresting, uh?

View solution in original post

6 Replies
Brooks_L_
New Contributor I
91 Views

Hi, Parag

     I encountered the same problem with the resolution 720x576. The output frame image is totally disordered as well. The conversion from YUY2 to NV12 is done by my own code. Only H.264 encoding is via media SDK QSV. So, I guess it is a real bug inside Media SDK on h.264 compression, not VPP.

    I am also seeking the solution for this, hoping anyone give me hands.

Brooks_L_
New Contributor I
91 Views

Parag, did you ever try the other resolution? I did for 720 x 480. The encoded frame is not that distorted, but there are lots of regular short lines floating on image. So, it seems that the problem that we met is not a corner case.

Does anyone in this forum have the idea?

gparag1983
Beginner
91 Views

Hello Brooks,

If I do 720*576 size YUY2 buffer to NV12 conversion using VPP then only output image is totally distorted. If I pass converted NV12 (conversion done through thirdparty dll) then output image is proper.

Currently I checked with 720*576 and 1920*1080 resolution only.

Regards

Parag Gandhi

Brooks_L_
New Contributor I
92 Views

Parag, I eventually got to know what the cause is for my failure. That's a small stupid mistake in the code. When I copy the NV12 data after conversion, for each line, I copied 'width' bytes to the destination buffer, offered by surface, instead of the right number of bytes indicated by 'pitch'. And usually, pitch is more than width for an video frame to encoded. Encoder needs some stuffing to make line data aligned to 16 or more as I understand. So, consequently, in my destination buffer, for each line, the contained data is beyond one line and additionally, part of next line's data fills the gap between pitch and width. At last, my picture after encoding is distorted. That's my story. Little insteresting, uh?

View solution in original post

gparag1983
Beginner
91 Views

 

Thanks Brooks.

Your suggestion works in my case.I set VPP and encoder width 736.

Regards

Parag Gandhi

 

Brooks_L_
New Contributor I
91 Views

Glad to hear that!

Reply