Question / Help Frame-Timing / Sync issue

BK-Morpheus

Active Member
Hi,
I'll start by explaining, what I found out and maybe you guys can suggest me a way to improve this behavior.
I can add a log file later, but this has nothing to do with sources, rendering lag or encoder overload, so I don't think it's necessary.

I'm running Windows 10 1903 all updates installed, Game Mode and Game DVR disabled.
Ryzen 3700X
Vega56
16GB DDR4 3200MHz

Whenever the ingame framerate is not exactly in sync with the recording frame rate (1:1 ratio or 1:2 ratio), the recording will not be 100% smooth.
Example: Playing with locked 60fps (framelimiter or vsync) and recording with 60 or 30fps will result in smooth footage, but playing with 64fps and recording with 30 or 60fps will not be 100% smooth.
I could even lock the fps to 120fps and record with 30, 60 or 120fps and get smooth recordings, if I make sure the GPU is not running at full load (to avoid rendering lag).

So this seems to be an issue of the frame timing difference between ingame fps and recording fps.
Therefore the recording is not really stuttering, but you can see, that it's not 100% smooth, when the recording framerate is not matching the ingame framerate.

I have a freesync monitor with 30-70Hz range. As most online video content has 24, 25, 30, 50 or 60fps I let my monitor run at 60Hz instead of the 70Hz that it is capable of. This way I can watch 60fps youtube footage smoothly where I would see very slight stutter if I watch 60fps content on a 70Hz display (which is to be expected).
To reduce input lag while gaming, I don't use vsync and cap my framerate slightly under the monitors refreshrate (for example fps limit at 58fps on 60Hz), so I'm in the freesync range, got no clipping/tearing and less input lag than running at 60fps with vsync.
But as I said, a 60fps or 30fps recording of ingame 58fps will not be smooth, so at the moment my workaround for this is to set my monitor to 70Hz, cap the fps at 60fps (so still in freesync range and low input lag) and when I'm done with gaming+recording, I switch back to 60Hz, so I can watch the recording or other online media without stutters.

I want to emphasis, that I did those tests with locked/capped fps, not with unlocked and fluctuating fps. GPU and CPU load were always below 60% in theses tests, there are NO rendering or encoding issues (log shows no droppep/skippe frames etc.). Tests were done with a clean scene collection with only a game_capture source in it.
So this has nothing to do with the usual "overload" of the GPU, CPU or bad "sources" like some browser sources or even webcam/capture card sources/drivers.
 
D

Deleted member 121471

How are you capping your FPS, aside from vsync? FTRC?
 

BK-Morpheus

Active Member
I tried the most common ways...Ingame if available in options, AMD driver (FRTC, but this is garbage) and usually I use Rivatuner Statistics Server, as it is the most precise with low additional lag.
 
D

Deleted member 121471

I own an AMD GPU and have the same issue with mismatched game FPS vs stream FPS. I use the same workaround but use radeon chill set at 60 or 120 min/max as my frame rate limiter, depending on the game, as FTRC is a piece of hot garbage.

What's really odd is that, if I use hardware encoding on OBS or Relive, the frame pacing and sync looks and "feels" way better during playback without needing any workarounds.
 

BK-Morpheus

Active Member
Yep. Shadowplay and Relive seem to work better.

A few weeks ago I asked my buddy to do the same test with his Nvidia card (limit game to 75fps and record with 60fps).
He said his recording would look smooth....I asked him to send me the recording file and there it is...the same micro stutter here and there that comes from frame pacing / sync issues.
So I'd say this is not AMD exclusive but most people don't even notice the difference between correct frame pacing and bad frame pacing on a 60fps recording. Many don't even recognize that the 60fps youtube content is not playing smooth on their 70Hz monitor, so I'm not to surprised, that there is not much information about this behavior in OBS.
 

koala

Active Member
I don't know if this stutter can be eliminated completely. A video source generates frames every few ms. A recorded video of this source appears smooth to the viewer, if the visible pause (on the monitor) between each frame is as long as it was at generating time.

If you record with 58 fps, you have a frame every 17.2 ms, and if you display it on a 60 Hz monitor, you display one frame every 16.6 ms.
The frames are generated at 0, 17.2, 34.4, 51.2, 67.9, 86.2 ms.
On a 60 Hz monitor, frames are displayed at 0, 16.6, 33.3, 50, 66.6, 83.3 ms.

There is a gap of 0.6 ms between generation and display, so after 1/60 / 0.6 = 28 frames one frame is missing for display. The monitor has to display the previous frame a second time. This is about twice every second and is visible as stutter.

If you had a freesync monitor and a media player that is able to signal the display a frame every 1/58 ms instead of every 1/60 ms, it would appear smooth. But probably no media player is able to do that. Perhaps media players that switch to real directx fullscreen and use directx functions to switch to the next frame might do this.

The same stutter appears if the frames are recorded in a different time pattern than they were generated. A similar duplicated frame is produced and appears as stutter as soon as the accumulated gaps sum up to a whole missing frame. In this case, the stutter is already in the video file and not generated between media player and monitor at display time. To fight this, modern container formats include timestamps for each frame, but if there is a delay of unknown length between the app generating the frame and OBS reading the frame from the frame buffer, a correct timestamp cannot be obtained. I assume this delay is near 0 only if the system is not fully loaded. If you don't limit fps in the game, this delay might increase due to increased pipelining within the GPU. But this is speculation from my part, I don't really know much of the inner workings of directx or frame capturing.
 

BK-Morpheus

Active Member
It would definitely be cool if webbrowsers and video player software would also be able to use freesync/gsync. I think there are some video player programs out there, that can do this, but I like to keep VLC player and as for now, I don't think it can use variable sync with the monitor.

Relive and Shadowplay seem to have a way to record for example 73fps ingame smoothly into a 60fps video. No clue, how they do it, as it makes sense, that there are some frame doubling or frame time spacing issues, when the recorded footage has different fps than the recording frame rate.
 

jeanmonday

New Member
But as I said, a 60fps or 30fps recording of ingame 58fps will not be smooth, so at the moment my workaround for this is to set my monitor to 70Hz, cap the fps at 60fps (so still in freesync range and low input lag) and when I'm done with gaming+recording, I switch back to 60Hz, so I can watch the recording or other online media without stutters.
So, for recording should I run

OPTION 1
  • Refreshrate: 144Hz
  • Max Framerate: 120FPS
  • G-SYNC & V-SYNC: On,
or

OPTION 2
  • Refreshrate: 144Hz
  • Max Framerate: 120FPS
  • G-SYNC: On
  • V-SYNC: Off?
Or what would you suggest? Gotta make clear that my playback settings are:
  • Refreshrate: 60Hz
  • G-SYNC: Off
  • V-SYNC: On
 

RealNC

New Member
The only way to achieve correctly paced frame capture would be if OBS had an option to only capture every other frame (or every N frame.) That way, we could run games at 120FPS and capturing in 1/2 mode, resulting in correctly paced 60FPS captures. Or when running games at 240FPS, we would use 1/4 mode, capturing every 4th frame, again giving a good 60FPS capture.

Unfortunately, OBS does not provide such a capture mode and as a result it very often captures the wrong frame, resulting in jitter.
 
Top