Question / Help Recording in (a very) high Frame Rate

Streamia.gr

Member
I have a project requiring recording in a very high frame rate.
On OBS Settings/Video I can see that it is possible to increase frame rate. "Fractional FPS Value" provides unlimited frame rate value.

I'm not familiar with such issues so if someone can enlight me, it would be most appreciated.
- Is there any limitations in frame rate OBS can support?
- Do I need any kind of special video input device?
- Is there something else I should know about?

Thank you in advance.
 

koala

Active Member
OBS is not primarily a recording/capturing application. Its main use is compositing a video from several sources and rendering an overlayed/composited video from these sources. If you need a screen recorder tuned to highest fps, OBS might not be the best app, because compositing takes some overhead.

Having said that, you can record any frame rate, as long as the compositing+encoding process is able to process each frame in time. For example, if you want to record 100 fps, OBS has to process 100 frames a second, so one frame in 1/100 = 0.01 seconds or 10 ms. OBS must not need longer to capture, composite and encode one frame.
So how much time OBS needs for one frame?
Fire up OBS and first use a standard fps like 30 or 60 your hardware is definitely able to handle. Do some recording of what you want to capture. Terminate OBS, then re-open OBS again, then open Help->Log files->Show Log files. You see all logfiles OBS created until now. Open the next to last logfile, which contains the log of your recording you just made. It contains a footer that looks like this (this footer is only written at OBS exit, thus I told you to first terminate OBS after your test recording):
Code:
22:49:44.892: obs_hotkey_thread(25 ms): min=0.004 ms, median=0.007 ms, max=41405.1 ms, 99th percentile=0.211 ms, 99.9977% below 25 ms
22:49:44.892: audio_thread(Audio): min=0 ms, median=0.028 ms, max=41408 ms, 99th percentile=2.795 ms
22:49:44.892:  ┗receive_audio: min=0.003 ms, median=0.236 ms, max=137.254 ms, 99th percentile=2.246 ms, 0.73738 calls per parent call
22:49:44.892:    ┣buffer_audio: min=0 ms, median=0.001 ms, max=0.137 ms, 99th percentile=0.002 ms
22:49:44.892:    ┗do_encode: min=0.003 ms, median=0.234 ms, max=137.251 ms, 99th percentile=2.244 ms
22:49:44.892:      ┣encode(desktop audio): min=0.01 ms, median=0.225 ms, max=1.767 ms, 99th percentile=0.38 ms, 0.200009 calls per parent call
22:49:44.892:      ┣encode(game): min=0.003 ms, median=0.227 ms, max=3.559 ms, 99th percentile=0.388 ms, 0.200009 calls per parent call
22:49:44.892:      ┣encode(headset): min=0.002 ms, median=0.069 ms, max=0.424 ms, 99th percentile=0.124 ms, 0.200009 calls per parent call
22:49:44.892:      ┣encode(mic): min=0.002 ms, median=0.067 ms, max=0.321 ms, 99th percentile=0.118 ms, 0.200009 calls per parent call
22:49:44.892:      ┗encode(everything): min=0.007 ms, median=0.243 ms, max=0.786 ms, 99th percentile=0.392 ms, 0.199965 calls per parent call
22:49:44.892: obs_graphics_thread(16.6667 ms): min=0.088 ms, median=0.287 ms, max=47981.8 ms, 99th percentile=0.815 ms, 99.9948% below 16.667 ms
22:49:44.892:  ┣tick_sources: min=0.002 ms, median=0.019 ms, max=1034.11 ms, 99th percentile=0.249 ms
22:49:44.892:  ┣output_frame: min=0.047 ms, median=0.166 ms, max=47977.8 ms, 99th percentile=0.472 ms
22:49:44.892:  ┃ ┗gs_context(video->graphics): min=0.046 ms, median=0.166 ms, max=47977.8 ms, 99th percentile=0.471 ms
22:49:44.892:  ┃   ┣render_video: min=0.004 ms, median=0.009 ms, max=2.908 ms, 99th percentile=0.425 ms
22:49:44.892:  ┃   ┃ ┣render_main_texture: min=0.003 ms, median=0.007 ms, max=2.691 ms, 99th percentile=0.062 ms
22:49:44.892:  ┃   ┃ ┣render_convert_texture: min=0.01 ms, median=0.012 ms, max=0.155 ms, 99th percentile=0.027 ms, 0.150845 calls per parent call
22:49:44.892:  ┃   ┃ ┗output_gpu_encoders: min=0 ms, median=0.033 ms, max=0.365 ms, 99th percentile=0.129 ms, 0.150845 calls per parent call
22:49:44.892:  ┃   ┗gs_flush: min=0.01 ms, median=0.137 ms, max=47977.6 ms, 99th percentile=0.252 ms
22:49:44.892:  ┗render_displays: min=0.001 ms, median=0.096 ms, max=8.977 ms, 99th percentile=0.406 ms
Pick the line that starts with "obs_graphics_thread". In my example, it is this:
obs_graphics_thread(16.6667 ms): min=0.088 ms, median=0.287 ms, max=47981.8 ms, 99th percentile=0.815 ms, 99.9948% below 16.667 ms
Look at the 99th percentile value. In this case, it is 0.815 ms. It means, 99% of all frames were processed in 0.815 ms. Or 0.000815 seconds. This means I could have recorded with 1/0.000815 = 1227 frames per second. The actual fps is probably somewhat lower, because increasing the recording fps increases system load, which probably decreases real possible fps.
This is a log that is valid only if you use "nvenc (new)" as encoder, the most advanced hardware encoder that also produces the least system load. If you use any other encoder, you get separate entries for the encoder that looks like this:

Code:
15:26:16.179: video_thread(video): min=1.798 ms, median=2.142 ms, max=9.288 ms, 99th percentile=5.907 ms
15:26:16.179:  ┗receive_video: min=1.796 ms, median=2.141 ms, max=9.285 ms, 99th percentile=5.904 ms
15:26:16.179:    ┗do_encode: min=1.796 ms, median=2.14 ms, max=9.284 ms, 99th percentile=5.903 ms
15:26:16.179:      ┗encode(recording_h264): min=1.771 ms, median=2.113 ms, max=5.952 ms, 99th percentile=5.656 ms
Look at the line that starts with "video_thread(video)" and again look at the 99th percentile:
15:26:16.179: video_thread(video): min=1.798 ms, median=2.142 ms, max=9.288 ms, 99th percentile=5.907 ms

Here it is 5.907 ms or 0.005907 seconds. This is the time the encoder needs (I switched to x264). With x264, my machine is able to encode 1/0.005907 = 169 fps.

Both values must be under the maximum frame time of your desired fps: the rendering time (my first snippet) and the encoding time (my second snippet). Don't add the values, they are separate threads, so they run in parallel, so they just need both be below the frame time.
In case of nvenc (new), the encoding is a task within rendering, so you only have the rendering part of the log.

With the above logs, you'd see you would be able to record 1227 fps with nvenc (new) and 169 fps with x264. How your system behaves, depends on your hardware of course, so you have to do this test and produce these logfiles yourself.

If it comes to the input device, it depends on what you want to capture. The fastest capture method is game capture, which can be used for all applications that use directx or opengl for 3D output, such as games. As fast are window and display capture.

Other sources, for example a capture card to capture hdmi output, for example from a console, is not as fast as the capture methods above. In addition, capture cards are usually limited to 30 or 60 fps to suit the needs of streamers, since streamers don't stream above 60 fps.
 
Last edited:
Top