Bug Report FFMPEG VAAPI ignores bitrate

I noticed this it dropped many frames while streaming. Using quicksync which barely has any options other than bitrate, setting it is ignored. I verified this with recordings that skyrocket to about 30mbps when setting to 6mbps.
OBS 24.0.6
 

dev_el_ops

New Member
I just tried out 25.0.1 and while there clearly were changes to the VAAPI bitrate settings, it still was streaming at ~double the rate configured.
 
In 25.0.3 it says make sure your video drivers are up to date.
10:04:49 AM.379: [FFMPEG VAAPI encoder: 'recording_h264'] Failed to open VAAPI codec: Invalid argument
I can switch to QP but its not really QP because it shouldn't be 100mbit videos.
Thats on QuickSync.
the AMD encoder appears to be respecting CBR. set it to 6k and its about 6118 kb/s but the AMD encoder tends to be a bit trashy when compared to QuickSync.
 
Last edited:

dev_el_ops

New Member
retried it again with the 25.0.3 debian build:

Code:
15:07:39.353: ==== Streaming Stop ================================================
15:08:03.980: Settings changed (outputs)
15:08:03.980: ------------------------------------------------
15:08:05.265: ---------------------------------
15:08:05.266: [FFMPEG VAAPI encoder: 'streaming_h264'] settings:
15:08:05.266:     device:       /dev/dri/renderD128
15:08:05.266:     rate_control: CBR
15:08:05.266:     profile:      578
15:08:05.266:     level:        42
15:08:05.266:     qp:           0
15:08:05.266:     bitrate:      2500
15:08:05.266:     maxrate:      2500
15:08:05.266:     keyint:       120
15:08:05.266:     width:        1920
15:08:05.266:     height:       1080
15:08:05.266:     b-frames:     0
15:08:05.266:
15:08:05.267: ---------------------------------
15:08:05.267: [FFmpeg aac encoder: 'avc_aac_stream'] bitrate: 160, channels: 2, channel_layout: 3
15:08:05.267:
15:08:05.268: [rtmp stream: 'adv_stream'] Connecting to RTMP URL rtmp://live-lhr03.twitch.tv/app...
15:08:06.118: [rtmp stream: 'adv_stream'] Connection to rtmp://live-lhr03.twitch.tv/app successful
15:08:06.120: ==== Streaming Start ===============================================
15:08:32.899: [rtmp stream: 'adv_stream'] User stopped the stream
15:08:32.899: Output 'adv_stream': stopping
15:08:32.899: Output 'adv_stream': Total frames output: 1600
15:08:32.899: Output 'adv_stream': Total drawn frames: 1658
15:08:32.903: ==== Streaming Stop ================================================
Seems like it is configured correctly (maxrate:2500kbit), but both the status bar on OBS as well as twitch see 10_000 kbit per second. This is both with and without "enforce streaming service encoder settings" and tested with different "Level" settings (4.0 and 4.1). /dev/dri/renderD128 is my Intel HD Graphics

Code:
00:02.0 0380: 8086:0102 (rev 09)
    DeviceName:  Intel(R) HD Graphics Device
    Subsystem: 8086:2008
 

Tuna

Member
Maybe it still is buggy. If you feel adventurous - there is a GStreamer plugin available that also exposes various encoder if available in GStreamer. That inlcudes VAAPI. I tried it with my AMD card and the CBR mode came quite close to the set bitrate.
 
Top