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.

Not able to extract VPS

cedronius__anders
New Contributor I
1,186 Views

In my decoder I want to extract SPS, PPS and VPS by attaching two mfxExtBuffer to the mfxVideoParam struct.

MFX_EXTBUFF_CODING_OPTION_VPS and MFX_EXTBUFF_CODING_OPTION_SPSPPS

Like this ->

mfxExtCodingOptionSPSPPS lSpsPpsOption;
mfxExtCodingOptionVPS lVpsOption;
mfxExtBuffer *lpExtendedBuffers[2];

/* configure mfxExtCodingOptionVPS */
memset(&lVpsOption, 0, sizeof(lVpsOption));
lVpsOption.Header.BufferId = MFX_EXTBUFF_CODING_OPTION_VPS;
lVpsOption.Header.BufferSz = sizeof(lVpsOption);
lVpsOption.VPSBuffer = (mfxU8 *) mDecodedVpsData.data();
lVpsOption.VPSBufSize = mDecodedVpsData.size();
lpExtendedBuffers[0] = (mfxExtBuffer *) &lVpsOption;

/* configure mfxExtCodingOptionSPSPPS */
memset(&lSpsPpsOption, 0, sizeof(lSpsPpsOption));
lSpsPpsOption.Header.BufferId = MFX_EXTBUFF_CODING_OPTION_SPSPPS;
lSpsPpsOption.Header.BufferSz = sizeof(lSpsPpsOption);
lSpsPpsOption.SPSBuffer = (mfxU8 *) mDecodedSpsData.data();
lSpsPpsOption.SPSBufSize = mDecodedSpsData.size();
lSpsPpsOption.PPSBuffer = (mfxU8 *) mDecodedPpsData.data();
lSpsPpsOption.PPSBufSize = mDecodedPpsData.size();
lpExtendedBuffers[1] = (mfxExtBuffer *) &lSpsPpsOption;

mSpeculativeVideoParams.ExtParam = lpExtendedBuffers;
mSpeculativeVideoParams.NumExtParam = 2;

lResult = mDecoder->DecodeHeader(pInBitstream, &mSpeculativeVideoParams);

The data buffers are initialised like this ->

std::vector<uint8_t> mDecodedSpsData = std::vector<uint8_t>(128);
std::vector<uint8_t> mDecodedPpsData = std::vector<uint8_t>(128);
std::vector<uint8_t> mDecodedVpsData = std::vector<uint8_t>(128);

 

Then after running the DecodeHeader I loop trough the buffers to see if I got my parameters.

Notification: Video format has changed
Notification: vps 128
Notification: sps 93
Notification: pps 11

So yes I got the SPS and PPS but not the VPS (since size is untouched at 128 bytes and there is no data when I look in the data buffer)

I then wrote my own code extracting the parameter sets of the bitstream and my code finds SPS,PPS and VPS this is the result .> 

Notification: Found VPS size > 33
Notification: NAL 32
Notification: Found SPS size > 89
Notification: NAL 33
Notification: Found PPS size > 7
Notification: NAL 34
Notification: NAL 39
Notification: NAL 19

(My extraxtor is not including the 4 start bytes that's why the size is different)

How do I use MFX_EXTBUFF_CODING_OPTION_VPS to extract VPS using DecodeHeader? Do I need to set any other flag or attach any other structs to the mfxVideoParam?

 

/Anders

0 Kudos
7 Replies
cedronius__anders
New Contributor I
1,177 Views

I'm running the above on this ->

Linux 20.04

MSDK -> 20.5.1

0 Kudos
Gopika_Intel
Moderator
1,152 Views

Hi,


Thank you for posting in Intel Media SDK forum. Could you provide us with the complete reproducer code.


Regards

Gopika Ajit


0 Kudos
cedronius__anders
New Contributor I
1,147 Views

Sure..

Here is a project reproducing the 'Not able to extract VPS'

 

https://github.com/Unit-X/extract_vps

 

Build and run as the readme states.

 

/A 

 

 

0 Kudos
Dmitry_E_Intel
Employee
1,107 Views

Hi Anders ,

 

Thanks for reporting this issue! This PR  https://github.com/Intel-Media-SDK/MediaSDK/pull/2581 addresses it.

BTW, please feel free to report Linux issues directly at GitHub.

  

Regards,

Dmitry

0 Kudos
Gopika_Intel
Moderator
1,126 Views

Hi,


We're forwarding this case to the internal team who can help you out


Regards

Gopika


0 Kudos
Mark_L_Intel1
Moderator
1,117 Views

Hi Anders,


Thanks for the detailed work with our tools and source code.


Before I forward to dev team, just a question if you checked our developer guide for the questions:

https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#MFXVideoDECODE_DecodeHeader


Let me know if this gives you useful information.


Mark


0 Kudos
Mark_L_Intel1
Moderator
1,100 Views

Hi Anders,


I agree with Dmitry's recommendation, if you are referring the issue to Open Source Media SDK with the following URL, you'd better to post the issue there directly and you can get a fast response:

https://github.com/Intel-Media-SDK/MediaSDK


Here is the link to the issues:

https://github.com/Intel-Media-SDK/MediaSDK/issues


Again, the issue you bring up is really helping us to improve. Appreciated.


Mark Liu


0 Kudos
Reply