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.

Changing encoder bitrate results in a keyframe

Krist
Beginner
573 Views

I am using the Intel Media SDK to (hw accelerated) encode a live stream of video to h264. The h264 output is then being sent over a wireless network. The bitrate I need for the encoding process is changing a few times per second, because it is the maximum bitrate of the wireless network at that moment.

Now, when I change the encode bitrate and call the Reset function of the encoder with the new parameters, the encoder generates a keyframe. This is an issue, since I need to adust the bitrate a few times per second.

Is there any way to change the encoder bitrate without generating a keyframe?

0 Kudos
5 Replies
Surbhi_M_Intel
Employee
573 Views

Hi Krist, 

What bitrate control method you are currently using? Since you are live streaming, can you tell what all parameters you have set to control the bitrate? 

For your question "Is there any way to change the encoder bitrate without generating a keyframe?"
For the scenario you want to achieve, you can set CQP encoding to adjust bitrate on per-frame basis. Check MFX_EXTBUFF_ MBQP extended buffer to set the bitrate per frame. 

Thanks,
​Surbhi

0 Kudos
Krist
Beginner
573 Views

Hello Surbhi,

What I am currently doing is set the BRC to MFX_RATECONTROL_VBR and set a bitrate. When a new bitrate is required, I simply change the bitrate and call the Reset function of the encoder. However, this causes a keyframe to be generated.

I will now try to convert to using your suggestion of using CQP control. I will let you know the results.

Thank you,

Chris

0 Kudos
Krist
Beginner
573 Views

Hello Surbhi,

I have looked into using the CQP rate control method, but it appears that it requires me to write my own rate controller. That rate controller should have some kind of algorithm to calculate exepcted changes in frames and then calculate what will be the best QP to use for that single frame. This is not what I would like to make.

Is there any other way of changing the bitrate dynamically without generating a keyframe?

Best regards,

Chris

0 Kudos
Krist
Beginner
573 Views

Surbhi,

I have found a solution for my problem. When using VBR, I can call the Reset function with the mfxExtEncoderResetOption attached. In there I can specify that StartNewSequence is false, so that no new sequence is started.

This thread can be closed.

0 Kudos
Surbhi_M_Intel
Employee
573 Views

Great, you got the solution of your issue. Closing this thread.

-Surbhi

 

0 Kudos
Reply