Community
cancel
Showing results for 
Search instead for 
Did you mean: 
cedronius__anders
New Contributor I
210 Views

Not able to extract VPS

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
201 Views

I'm running the above on this ->

Linux 20.04

MSDK -> 20.5.1

Gopika_Intel
Moderator
176 Views

Hi,


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


Regards

Gopika Ajit


cedronius__anders
New Contributor I
171 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 

 

 

Gopika_Intel
Moderator
150 Views

Hi,


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


Regards

Gopika


Mark_L_Intel1
Moderator
141 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_DecodeHea...


Let me know if this gives you useful information.


Mark


Dmitry_E_Intel
Employee
131 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

Mark_L_Intel1
Moderator
124 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