Media (Intel® oneAPI 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 sign-in experience has changed to support enhanced security controls. If you sign in, click here for more information.

Changing encoder bitrate results in a keyframe

Krist
Beginner
263 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
263 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

Krist
Beginner
263 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

Krist
Beginner
263 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

Krist
Beginner
263 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.

Surbhi_M_Intel
Employee
263 Views

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

-Surbhi

 

Reply