Community
cancel
Showing results for 
Search instead for 
Did you mean: 
BMart1
New Contributor II
50 Views

mfxExtCodingOptionSPSPPS from MFXVideoENCODE_Query

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
50 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?

BMart1
New Contributor II
50 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.

Jeffrey_M_Intel1
Employee
50 Views

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

Jeffrey_M_Intel1
Employee
50 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.

BMart1
New Contributor II
50 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?

Reply