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
Link Copied
I'm running the above on this ->
Linux 20.04
MSDK -> 20.5.1
Hi,
Thank you for posting in Intel Media SDK forum. Could you provide us with the complete reproducer code.
Regards
Gopika Ajit
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
Hi,
We're forwarding this case to the internal team who can help you out
Regards
Gopika
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:
Let me know if this gives you useful information.
Mark
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
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
For more complete information about compiler optimizations, see our Optimization Notice.