libvpx-vp9 not keeping up

Moto9000

New Member
When trying to stream with libvpx-vp9 via OBS, the stream is constantly cutting off and OBS is reporting the encoder to be overburdened. It essentially gives me a frame every ~20 seconds.
Using the same settings in ffmpeg directly on a recording of the screen, makes the encoder run at ~2,5x speed, which makes me think that the encoder should easily be able to keep up. The cpu utilization doesn't seem weird. It is using ~105% which is lower than the ~130% that encoding the recording uses, but that absolutely makes sense to me.

Here is my codec settings:
-deadline realtime -minrate 1M -maxrate 1M -b:v 1M -cpu-used 8 -row-mt 1 -f webm -content_type video/webm -cluster_size_limit 10M

If I lower the resolution and framerate it does work. 1080p@20fps just barely works, and I am trying to run 1440p@30fps. Though the resolution is more important than the framerate, but even 1440p@10fps doesn't run.
In my case I am trying to stream to an icecast2 server, but I am up for suggestions if someone knows something better.

I don't see anything useful at all in the logs, but if someone wants to take a look: https://obsproject.com/logs/_WHu8g4eSnck5M23
 

Moto9000

New Member
I think I get what is happening now. The settings aren't passed to ffmpeg, but to the actual encoder. So essentially -f webm -content_type video/webm -cluster_size_limit 10M gets ignored. Now the question would be: How do I give options to ffmpeg, rather than the encoder? Or can I even do that?
 

The Head Obamid

New Member
Thanks to your post and realization that the settings aren't being passed to ffmpeg, I've made a breakthrough in vp9 encoding in obs, prior to having seen this all of my trial and error would've confirmed basically the same results that you've said here, can't do highish resolutions at more than like 15 fps. So the only way I would've gotten semi fluid video before was to use around 360p, however I decided to try using the encoder options as key value pairs instead of as they would be input in ffmpeg, and performance went way up.

These are the settings I'm using now:
threads=4 quality=1 speed=16 lag-in-frames=0 row-mt=1 error-resilient=1
With this change it can manage 1080@60 as well as 720@120 for me, which is a bit lackluster compared to my performance in ffmpeg, which can do 1080@120, leading me to believe that not all of the options are working properly, but it's still far better than before. It seems to do 1440@30 fine as well, albeit I'm just upscaling, so if you still care at all this might help, should also mention I'm using ffmpeg 4.4 libraries as opposed to the default obs ffmpeg.
 
Top