Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Detected wrong aspect ratio in mpeg2 file

manca1
Beginner
555 Views
Hello there,
I have a problem with MPEG2TS mpeg2 file. It has resolution of 1440x1080, but in the sequence header it's written that its aspect ratio is 16:9. However, IPP mpeg2 decoder detects the ratio as 4:3. Do you have some tips for me how I can make decoder get the correct aspect ratio?
Thanks a lot in advance!
Regards,
Manca
0 Kudos
5 Replies
manca1
Beginner
555 Views
bump for Intel!
0 Kudos
Eric_S_Intel
Employee
555 Views

Hi,

Sorry about the delay. Can you share the stream with us? Ill take a look at it.

-Eric

0 Kudos
manca1
Beginner
555 Views
Hello,
Thanks for the reply. I am sorry but I am not able to share the stream, but I can confirm that the mpeg2 sequence header shows the correct aspect ratio. It looks like your decoder just devides width with height to obtain the ratio, without looking at video headers.
Could you please look into it?
Thanks again!
0 Kudos
Eric_S_Intel
Employee
555 Views

Ok, sure. I can take a look at the code to confirm/deny your assumption. You are probably correct however. The codec is not designed to be a production level solution, but rather a sample whos purpose it to show how one could implement a MPEG2 decoder using IPP primitives. Because of this, all the bells and whistles of a production level codec are not implemented. The code is available, have you looked into adding this yourself? Another alternative is the Media SDK which does carry a production level MPEG2 decoder- albeit its a windows only solution.

Eric

0 Kudos
ismaelbej
Beginner
555 Views
If you are looking ataspect_ratio_{width,height} returned by MPEG2 decoder in the VideoStreamInfo structure then the values are correct because they are pixel aspect ratio, see the comments in umc_structures.h.
The problems is that they are used to return display aspect ratio by other codecs, splitters or muxers. H264 does return display aspect ratio, ThreadedDemuxer also returndisplay aspect ratio. MPEG4 returns pixel aspect ratio.
Probably a good solution will be to fix the correct interpretation, either pixel aspect ratio or display aspect ratio. And fix all the uses to return the correct values.
0 Kudos
Reply