Question / Help Is it possible to stream at a variable frame rate?

hedgehog90

New Member
I stream in OBS at 30fps, but I've noticed when streaming certain video files in VLC with non-factorial frame rates, say 24 or 25fps, the output is slightly stuttery as it's often recording the same frame twice, repeating a frame about once every 5/6 frames (as to be expected).
Setting the h264 encoder to 60fps makes the stutters less noticeable, but I find it reduces the video quality to a degree that I'm not happy with, while using more resources than necessary... and on top of that, if I set the frame rate higher any than 30fps then my regular streaming service caps the delivery bit rate at 1.2mbps (when it usually goes up to 3mbps)

Is there any way around this issue besides stopping the stream and changing the frame rate or setting a higher frame rate?

If I could just change the frame rate mid-stream that would be great, but the option is greyed out once I've started streaming. If I'm playing video files I can easily probe VLC for the file's frame rate (assuming it's constant) and apply it to OBS through a simple (somewhat hacky) script.
And yes, I know - if the frame rate were to change in the middle of an encoding then that effectively means the video has a VFR, but that's just semantics.

An optional variable frame rate setting would also be great, assuming you can hook it up to a specific capture source, recording a frame every time it updates.
Unless I'm mistaken it appears there used to be a variable frame rate option in OBS Classic, but I can't find it anywhere in OBS Studio.

I'm not sure how window/game capture sources work in the canvas - whether they are capturing at a really high frame rate or are event based I'm not sure - but if I'm playing a video file in VLC or playing a game, no matter what the frame rate, it appears to run just as smoothly in the OBS canvas as it does in the video player / game.
If I could just tell the encoder to listen to one particular source for these updates, it should (in theory) be able to accurately set frame intervals during the encoding process, reducing the stutter significantly, if not eliminating it completely.

Is there a solution already out there that I've not considered?
Any help or suggestions would be very much appreciated.
 

Narcogen

Active Member
The question about whether or not you can stream with a variable frame rate would be a question about whether or not any streaming provider supports that, and I'm not aware of one.
 

hedgehog90

New Member
*bump*

I've been doing lots of research into this issue recently.
Every streaming platform that I've tried accepts and processes variable framerate video without issue, and the results look so much better than using a fixed framerate.
I've managed to test several services using ffmpeg that sends encoded VFR video to an rtmp server.

Now that I know it's possible, it's pretty frustrating when I'm streaming a playlist of videos with differing framerates that OBS can't capture and encode the video at the frame rate that it's playing in the video player.
For now I have to stick with 30fps for a stream and it makes 23.97, 24 and 25 fps video look choppy.

So again, I'd like to know if OBS captures at a fixed rate or if it's event based when using Game Capture.
If the latter, an encoding option to enable VFR (based on a single Game Capture source) should be fairly simple thing to implement.

I'm sure a lot of people would appreciate it.
 
Top