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 ->
/* 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 = (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 = (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?
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.
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.
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:
Here is the link to the issues:
Again, the issue you bring up is really helping us to improve. Appreciated.