Sudden bitrate drop mid-stream

exodrifter

New Member
About a week or two ago, I encountered a problem while streaming on Twitch where my video bitrate suddenly and immediately dropped from 6000kbps to 200-300kbps in the middle of my stream, sometimes more than an hour into the stream. I'm pretty sure it's not an internet-related issue; if i stop the stream and then restart it, the bitrate immediately returns to normal, until the same sudden drop in bitrate occurs. Twitch doesn't recognize this as a technical issue, so it doesn't combine the VODs, and other tools which integrate with Twitch will send out a live notification again, which is quite annoying since it can easily happen multiple times over the course of a few hours. The lowered bitrate also affects the recording, but I haven't gotten around to testing if this happens when I only record and don't stream yet since there it doesn't seem like there is a bitrate indicator when you aren't streaming and I'm not sure how to trigger this behaviour. When this drop in video bitrate happens, audio appears to be unaffected. You can see what it looks like in my Twitch VOD here.

Additionally, a friend of mine who lives in a different part of the world than me is also experiencing this issue. Here's what we have in common:
* We both use arch linux
* We both use an AMD graphics card

Things that are different:
* I am using obs-studio-tytan652, they are using obs-studio-git
* I am using FFMPEG VAAPI H.264, they are using GStreamer Encoder H.264

I tried looking through the log, but I didn't notice any obvious error messages. After some discussion with my friend, we're suspicious that this might be the graphics card driver but we're not sure. Any help troubleshooting this problem would be greatly appreciated! Here's some detailed information about what I have installed, in case it matters:
Code:
$ pacman -Qs 'obs|mesa'
local/cef-minimal-obs-bin 103.0.0_5060_shared_textures_143.2591+g4204d54+chromium_103.0.5060.134_1-3
    Chromium Embedded Framework minimal release needed by OBS Studio release in /opt/cef-obs
local/ffmpeg-obs 5.1.2-1
    Complete solution to record, convert and stream audio and video with fixes for OBS Studio. And various
    options in the PKGBUILD
local/glu 9.0.2-3
    Mesa OpenGL utility library
local/lib32-glu 9.0.2-3
    Mesa OpenGL utility library (32 bits)
local/lib32-mesa 22.3.1-1
    An open-source implementation of the OpenGL specification (32-bit)
local/lib32-vulkan-intel 22.3.1-1
    Intel's Vulkan mesa driver (32-bit)
local/lib32-vulkan-radeon 22.3.1-1
    Radeon's Vulkan mesa driver (32-bit)
local/libva-mesa-driver 22.3.1-1
    VA-API implementation for gallium
local/mesa 22.3.1-1
    An open-source implementation of the OpenGL specification
local/mesa-utils 8.5.0-2
    Essential Mesa utilities
local/mesa-vdpau 22.3.1-1
    Mesa VDPAU drivers
local/obs-gstreamer 0.3.5-1
    An OBS Studio source plugin to feed GStreamer launch pipelines into OBS Studio.
local/obs-studio-tytan652 28.1.2-1
    Free and open source software for video recording and live streaming. With everything except service
    integrations. Plus V4L2 devices by paths, my bind interface PR, and sometimes backported fixes
local/opencl-mesa 22.3.1-1
    OpenCL support with clover and rusticl for mesa drivers
local/vlc-luajit 3.0.18-2
    Multi-platform MPEG, VCD/DVD, and DivX player built with luajit for OBS Studio compatibility
local/vulkan-intel 22.3.1-1
    Intel's Vulkan mesa driver
local/vulkan-radeon 22.3.1-1
    Radeon's Vulkan mesa driver
 

Attachments

  • 2022-12-19 17-43-55.txt
    62.5 KB · Views: 24

0xReki

New Member
Hey, archlinux user here, also with an AMD card. I'm running into the same issue using obs-studio-browser-28.1.2. Downgrading to 28.0.2 seems to fix the issue.
 

PassiHD

New Member
Hey, a friend of mine is also experiencing the exact same issue, he has a amd RX 6950xt and it doesnt matter which encoder he's using the problem happens. He's also running arch linux and the newest version of obs. I have a Nvidia GTX 1070, and i never had that problem, so it seems like its obs/amd's fault. hope they'll figure it out. what we also noticed, is that the bitrate dropping can be triggered, by starting the stream with a still image or just going onto a still image (e.g. minimap in minecraft)
 

pollux

New Member
iv been dealing with issue for ages now. happens on ffmepg vaapi still on latest 29.1.0
using a gstreamer vaapi encoder plugin im able to slightly slove the issue by lowering the qp value as for some reason vaapi isnt respecting the cbr constant bitrate and instead does whatever it likes which is stupid. if i use the amf encoder by loading a amdgpu driver i have no issues as it respects my bitrate and doesnt drop on still images and doesnt go above either
 

mystrdat

New Member
Exact same issue on Fedora Silverblue 38, OBS Studio 29.1.0 flatpak using obs-gamecapture. Feels like some kind of optimization as the bitrate tends to drop (and never recover) during more of less static screens. Is there a ticket on OBS GitHub yet or should we perhaps make one?
 

PhysixCat

New Member
I might be experiencing something similar on Debian Sid, also on an AMD GPU. Tested on recordings, and here were my observations

CBR or VBR on FFMPEG VAAPI, if exposed to difficult footage to encode, can result in bitrate plummeting from 6000kbps to a garbled mess, and frames dipping from steady 60fps into slideshow mode. This is even with low (25%) GPU usage, the encoder is not being overloaded. The expected result is that the image will look messy, but that the framerate will remain stable at 60, and that the quality recovers quickly after the difficult-to-encode footage stops. CQP works seemingly without issue.

In Flatpak OBS, I downgraded to 28.1.2 and that seems to be the last good commit (dated Nov 5th 2022). It is possible that when downgrading you will need to delete your old config files for it to work without issue, but I'm not 100% sure on that.
Weirdly enough however, looking at native OBS in the sid repos, downgrading to 28.0.1+dfsg1-3+b1 results in the same bug.

In conclusion: I think that the issue might not be with OBS itself, but with a dependency. I don't understand what else could cause 28.1.2 on Flatpak to work well, but then have the problem in 28.0.1 native. I haven't seen a ticket on the git for this.
 

PhysixCat

New Member
Yeah, they said it's probably a bug in mesa that was already fixed but not released. So it seems for now the choices are

A) Use flatpak 28.1.2 OBS, it werks
B) Downgrade mesa, use current OBS
C) x264

And then when next mesa update comes out we update OBS
 
Top