question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setting libvpx codec of cfg.rc_target_bitrate

See original GitHub issue

When REMB packet is received, the target bitrate is unpacked and set as vpx codec’s configuration, just like below.

https://github.com/aiortc/aiortc/blob/0310cd8486b38d8d8f295650253224247c43ed42/aiortc/codecs/vpx.py#L324-L326 https://github.com/aiortc/aiortc/blob/0310cd8486b38d8d8f295650253224247c43ed42/aiortc/codecs/vpx.py#L262-L264 (p.s I made sure __update_config() is called every time, fixing self.__update_config_needed to be always True )

I wanted to see if the vpx codec actually reflects the new cfg.rc_taget_bitrate, thus I saved the image and re-encoded to video to see the result.

However, the quality of the image/video is always same regardless of cfg.rc_target_bitrate change. I even tried setting all cfg.rc_target_bitrate as just 1kbps (just like below), expecting very low quality video,

DEFAULT_BITRATE = 1000 # 1 kbps
MIN_BITRATE = 1000 # 1 kbps MAX_BITRATE = 1000 # 1 kbps

but the result quality of image/video is always same. Can I get any help? How can I make sure vpx changes the bitrate according to its cfg.rc_target_bitrate ?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:7

github_iconTop GitHub Comments

2reactions
Tjoppencommented, Aug 22, 2022

I can also confirm this. Setting self.cfg.rc_max_quantizer to a lower value like 10 increases bitrate but setting self.cfg.rc_target_bitrate to any value does nothing. This makes me suspect cfg isn’t being used properly.

0reactions
DerGenauecommented, Nov 19, 2022

Can confirm this. We have an example test that adds bitrate configuration to the aiortc server example and bitrate configuration works fine for h264 but doesn’t work for vpx: https://github.com/Roboy/webrtc-tests/tree/main/aiortc-test

Read more comments on GitHub >

github_iconTop Results From Across the Web

examples/simple_encoder.c - webm/libvpx - Git at Google
All codecs provide a default configuration, number 0, ... Keyframes can be forced by setting the VPX_EFLAG_FORCE_KF bit of the.
Read more >
vpx - Go Packages
Package vpx provides Go bindings for libvpx-1.6.0, the WebM Project VP8/VP9 codec implementation.
Read more >
Encode/VP9 - FFmpeg Wiki
To install FFmpeg with support for libvpx-vp9, look at the Compilation Guides and compile FFmpeg with the --enable-libvpx option.
Read more >
libvpx - ffmpeg vp9 not setting constant quality - Stack Overflow
What the VPx codecs in ffmpeg do is use the video bitrate value as a ceiling. If not set by the user, ffmpeg...
Read more >
AV1 beats x264 and libvpx-vp9 in practical use case
3, with corresponding libx264 and libvpx-vp9 libraries. Table 1 lists the video codec versions used in our test setup. Table 1. Video codec...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found