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.
3071 Discussions

Incorrect dynamic aspect ratio when decoding an H.264 elementary stream.

JeromeDev
Beginner
1,097 Views
Hi,

I have an H.264 elementary stream file which contains (picture) aspect ratio changes (from 4/3 to 16/9, then back to 4/3). (These values are stored in the VUI part of the SPS). The resolution of the stream does not change.

I'm trying to track the aspect ratio changes at output level, i.e from the output surface returned by DecodeFrameAsync. I was hoping to get the aspect ratio from mfxFrameSurface1::Info::AspectRatioW/H, but it seems these values, although correct for the first frames, never get updated when the input aspect ratio changes. I tried to get the aspect ratio using GetVideoParam, same story : the returned values never changes once initialized.

It seems the decoder is correctly getting the aspect ratio at the beginning of the stream, but does not see aspect ratio changes. Is it a known issue? Is dynamic aspect ratio supposed to be supported?

At the moment, I'm able to detect aspect ratio changes by manually parsing the SPS (returned by GetVideoParam), but it seems the returned SPS does not refer to the next picture returned by DecodeFrameAsync, but to the last parsed SPS.

Actually, I'm having the same issue (i.e Info::AspectRatioW/H not updated) with an MPEG2 Video input, except that in the MPEG2 case, the above workaround (i.e parsing the sequence_header) seems to achieve frame-accurate results.

I'm using the following version of the Intel Media SDK : Version 3.5.811.41085
I got the issue with both modes : MFX_IMPL_SOFTWARE and MFX_IMPL_HARDWARE.

Thanks for your help!
0 Kudos
7 Replies
Petter_L_Intel
Employee
1,097 Views
Hi,

Yes, I believe you are correct in that the AspectRatio parameters does not get updated dynamically. But as you say parsing the header manually should work. I do find it a bit strange that the parsed SPS data does not line up with decoded frame.

Would you be able to share your stream so that we can try to reproduce your environment?

I will also look into if there is anything we can do to also convey dynamic aspectratio changes directly in the mfxVideoParam structure.

Regards,
Petter


0 Kudos
JeromeDev
Beginner
1,097 Views
Hi,

Thanks for your reply!
Here's an H.264 elementary stream causing the problem.

http://software.intel.com/file/45488

"I will also look into if there is anything we can do to also convey dynamic aspectratio changes directly in the mfxVideoParam structure."

That would be great.

Regards,
Jerome
0 Kudos
Petter_L_Intel
Employee
1,097 Views
Hi Jerome,

we are looking into this further, please be patient with us.

Regarding the stream you provided. I cannot see any aspect ratio changes. As far as I can see all SPS packets has an aspect ratio setting of 16/15.

Regards,
Petter
0 Kudos
JeromeDev
Beginner
1,097 Views
Hi,

Picture #200 (at 0x262580) conveys one aspect ratio change.
The associated SPS (at 0x262586), with seq_parameter_set_id=25, has a 64/45 pixel aspect ratio.

Thanks for looking into this issue!

Regards,
Jerome


0 Kudos
IDZ_A_Intel
Employee
1,097 Views
Ah, see that now. My mistake. Thanks for clarifying.
Regards,
Petter
0 Kudos
JeromeDev
Beginner
1,097 Views
Hi Petter,
anything new regarding this issue? Did you reproduce the problem?

Thanks,
Jerome
0 Kudos
Petter_L_Intel
Employee
1,097 Views
Yes,

this is considered a bug and we are working on fixing it. In the meantime, please try to use workaround.

Regards,
Petter
0 Kudos
Reply