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.

mfxExtCodingOptionSPSPPS from MFXVideoENCODE_Query

BMart1
New Contributor II
598 Views

Hi,

We are resetting the encoder when the aspect ratio changes. We need the updated sps/pps before we call MFXVideoENCODE_Init, so MFXVideoENCODE_GetVideoParam isn't useful as it returns the current sps/pps and not the future one. We tried mfxExtCodingOptionSPSPPS with MFXVideoENCODE_Query but it fails with various errors, depending if we set mfxExtCodingOptionSPSPPS in the input and/or output mfxVideoParam. We could have a separate (joined) session just to get the sps/pps, but it seems heavyweight. How do you get sps/pps from mfxVideoParam without initializing anything?

Bruno

0 Kudos
5 Replies
Jeffrey_M_Intel1
Employee
598 Views

Is your pipeline encode only, or does it include decode?

If you've got a transcode pipeline, this thread may provide some insights: https://software.intel.com/en-us/forums/intel-media-sdk/topic/535185

It may be possible to handle aspect ratio changes without parsing future SPS/PPS if the change can be seen at decode.  Does this apply in your case?

0 Kudos
BMart1
New Contributor II
598 Views

No, our pipeline is encode only. The thread you link was about resizing frames to square pixels. We want to support 720x480 4:3 and 720x480 16:9. Both cases have non-square pixels.

0 Kudos
Jeffrey_M_Intel1
Employee
598 Views

Looking into options for you.  It may take a few days to get back due to the holiday weekend.

0 Kudos
Jeffrey_M_Intel1
Employee
598 Views

In an encode-only pipeline as you've described the only way to retrieve SPS/PPS header info is to first initialize the encoder.   

I'd like to understand a bit more about your use case.  If it is possible to insert an IDR frame you can change aspect ratio at the same time, or you could restart the pipeline with a new aspect ratio by updating mfxVideoParam (as you would need to do to init with a new SPSPPS).  Do you need to do something more than these approaches allow?   BTW the extra session shouldn't have a big performance impact but it will use a bit of extra memory.

0 Kudos
BMart1
New Contributor II
598 Views

We need the future spspps to negotiate type change in our homegrown directshow filters.  For now we hacked the negotiation, flush all samples, update mfxVideoParam and then reset the encoder.  The aspect ratio changes a few frames before correct frame for avc. Maybe that is fixed inserting an IDR frame.  Do you have doc/samples?

0 Kudos
Reply