Why should deactivating and reactivating a video device (temporarily) fix out-of-sync framerates?

Kizzume

Member
I don't understand why OBS has such a hard time syncing framerates sometimes. When it starts going out-of-sync, it can be anywhere ranging from just slightly glitchy to looking like 8fps. I can wait quite a while for the sync to come back, though sometimes it never comes back until I deactivate and reactivate the video input device. It could be a 4K video input source I have my camera hooked up to, or it could be transferring VHS tapes to digital at 640x480, though to be fair, it happens less at that lower resolution, but it still happens. And I'm not even talking about streaming, just recording as well as simply looking at what is displayed in the OBS window.

Every time there's a new version, I have hopes that this issue would be fixed, but it never happens. Is there an "auto-sync" option planned?

AMD Ryzen 9 3900X 12-Core Processor, 32gb ram, GTX 1060 6GB
 

Kizzume

Member
What's a keyframe-interval? Ah, I see now, it's set for 0.

It's random as far as when it happens. I sync my audio by adding a delay.
 

Lawrence_SoCal

Active Member
Why do you think it is OBS Studio's fault? ancient warning about confusing correlation with causation

And then there is RTFM... see pinned post in this forum about posting OBS Studio log when asking for help/support... and the details matter, like 15-30 seconds + from a Recording and/or Streaming session

The vast majority of the time when I've seen similar posts in the last 4+ years, it has been either
- video driver and or related settings (ex Psychovisual Tuning and Look-ahead combined with various driver settings sometimes don't play well together)... lots of possibilities
though I'll add AMD motherboard BIOS bugs to this list
- inappropriate (or outright wrong) OBS Studio settings
- higher system workload (could be a small subsystem) than hardware capable of supporting
running demanding apps, especially ones impacting GPU/PCIe bus or GPU internals, or simply overloading PC (CPU, GPU, RAM, Disk I/O, etc)

Syncing audio from a separate source is to be expected (audio and video take vastly different (in computer measurement) time to process. But if you mean you have to adjust audio delay on audio in VHS capture to video in VHS capture, then you have some far more basic wrong with your system/setup
 

Benman2785

Member
set your keyframe-interval to 2s for streaming and leave it at 0 for recording.
try to use "timestamps" (in source settings) for each device (like microphone etc)
 

Kizzume

Member
Why do you think it is OBS Studio's fault? ancient warning about confusing correlation with causation

And then there is RTFM... see pinned post in this forum about posting OBS Studio log when asking for help/support... and the details matter, like 15-30 seconds + from a Recording and/or Streaming session

The vast majority of the time when I've seen similar posts in the last 4+ years, it has been either
- video driver and or related settings (ex Psychovisual Tuning and Look-ahead combined with various driver settings sometimes don't play well together)... lots of possibilities
though I'll add AMD motherboard BIOS bugs to this list
- inappropriate (or outright wrong) OBS Studio settings
- higher system workload (could be a small subsystem) than hardware capable of supporting
running demanding apps, especially ones impacting GPU/PCIe bus or GPU internals, or simply overloading PC (CPU, GPU, RAM, Disk I/O, etc)

Syncing audio from a separate source is to be expected (audio and video take vastly different (in computer measurement) time to process. But if you mean you have to adjust audio delay on audio in VHS capture to video in VHS capture, then you have some far more basic wrong with your system/setup
I think it's OBS' fault because if I use other software, like Elgato 4K Capture Utility, it's perfectly smooth the whole time. I've used countless tutorials over the many years of using OBS to try to get the best framerates possible.

My original question remains completely unanswered: Why should deactivating and reactivating a video device fix out-of-sync framerates? Why does that work if there's not some weird problem with how OBS handles video sources?
 

Xsoulsin

Member
Post a log

Well could start off by posting a log so others could possible review and see if anything could be affecting that. Hard to troubleshoot without looking at a log. As mentioned above to post one
 

Benman2785

Member
there "cant" be a resync button :)

if you stop the source and restart it again (in OBS) than the "Sync" will start from the beginning.

many possibilities why your stream/recording is out-of-sync after a while: no timestamps used, your pc cant handle source well, your pc cant handle encoding well, your source is damaged, your settings are wrong, your settings push it too far, your ram/cpu/system hangs (due to random hardware issues)

i will look into your log tomorrow
 

Kizzume

Member
Yes, there COULD be a resync button. If stopping the source and restarting it fixes it for a while, then why couldn't there just be an option that starts the sync over from the beginning, with a single click? I don't understand your argument against such an option.

And thanks.
 

Benman2785

Member
there CANT be a resync button - well actually there can, but than you lose data :)
some microphones can use timestamps - those are given by OS and can help with sync
to enable them please go into "properties" of your microphone in OBS
 

rockbottom

Active Member
Some suggestions to reduce load, improve performance & hopefully eliminate the audio sync issue.

13:46:44.455: Game DVR: On > Off

13:46:44.819: HAGS Status: Enabled (Default: No, Driver status: Supported) > Disable
13:46:44.819: Driver Version: 31.0.15.3699


13:46:44.819: name=LG ULTRAGEAR
13:46:44.819: pos={0, 0}
13:46:44.819: size={1920, 1080}
13:46:44.819: attached=true
13:46:44.819: refresh=120 > 60
13:46:44.819: bits_per_color=8
13:46:44.819: space=RGB_FULL_G22_NONE_P709
13:46:44.819: primaries=[r=(0.665039, 0.328125), g=(0.304688, 0.620117), b=(0.150391, 0.059570), wp=(0.313477, 0.329102)]
13:46:44.819: relative_gamut_area=[709=1.102398, P3=0.812656, 2020=0.583026]
13:46:44.819: sdr_white_nits=80
13:46:44.819: nit_range=[min=0.095900, max=295.380310, max_full_frame=295.380310]
13:46:44.819: dpi=96 (100%)
13:46:44.819: id=\\?\DISPLAY#GSM775C#5&2715e134&0&UID184579#{e6f07b5f-ee97-4a90-b076-33f57bf4eaa7}
13:46:44.819: alt_id=\\.\DISPLAY3

13:46:45.405: video settings reset:
13:46:45.405: base resolution: 3840x2160 > 1920x1080
13:46:45.405: output resolution: 1920x1080


13:46:46.667: Switched to scene 'Scene'
13:46:46.667: ------------------------------------------------
13:46:46.667: Loaded scenes:
13:46:46.667: - scene 'Scene':
13:46:46.667: - source: 'VCR' (dshow_input)
13:46:46.667: - source: 'Display Capture 3' (monitor_capture) > Remove
13:46:46.667: - source: 'Display Capture' (monitor_capture) > Use Window capture if possible, better performance
13:46:46.667: - source: 'Display Capture 2' (monitor_capture) > Remove

13:46:46.667: - source: 'Scene 2' (scene)
13:46:46.667: - filter: 'Image Mask/Blend' (mask_filter_v2)
13:46:46.667: - source: 'camlink' (dshow_input)
13:46:46.667: - filter: 'Image Mask/Blend' (mask_filter_v2)
13:46:46.667: - source: 'Media Source' (ffmpeg_source)
13:46:46.667: - filter: 'Image Mask/Blend' (mask_filter_v2)
13:46:46.667: - source: 'Video Capture Device' (dshow_input)
13:46:46.667: - filter: 'Image Mask/Blend' (mask_filter_v2)

Switch your encoding rate control to CQP

Fix your Sample rate mis-matches, audio will never sync correctly.
13:46:44.798: OBS 30.2.3 (64-bit, windows)
13:46:44.799: ---------------------------------
13:46:44.799: ---------------------------------
13:46:44.799: audio settings reset:
13:46:44.799: samples per sec: 48000
13:46:44.799: speakers: 2
13:46:44.799: max buffering: 960 milliseconds
13:46:44.799: buffering type: dynamically increasing

13:46:46.679: WASAPI: Device 'Focusrite USB (Focusrite USB Audio)' [44100 Hz] initialized (source: Mic/Aux)
13:46:46.684: WASAPI: Device 'Focusrite USB (Focusrite USB Audio)' [44100 Hz] initialized (source: Desktop Audio)

Test
 

Kizzume

Member
Some suggestions to reduce load, improve performance & hopefully eliminate the audio sync issue.

13:46:44.455: Game DVR: On > Off

13:46:44.819: HAGS Status: Enabled (Default: No, Driver status: Supported) > Disable
13:46:44.819: Driver Version: 31.0.15.3699


13:46:44.819: name=LG ULTRAGEAR
13:46:44.819: pos={0, 0}
13:46:44.819: size={1920, 1080}
13:46:44.819: attached=true
13:46:44.819: refresh=120 > 60
13:46:44.819: bits_per_color=8
13:46:44.819: space=RGB_FULL_G22_NONE_P709
13:46:44.819: primaries=[r=(0.665039, 0.328125), g=(0.304688, 0.620117), b=(0.150391, 0.059570), wp=(0.313477, 0.329102)]
13:46:44.819: relative_gamut_area=[709=1.102398, P3=0.812656, 2020=0.583026]
13:46:44.819: sdr_white_nits=80
13:46:44.819: nit_range=[min=0.095900, max=295.380310, max_full_frame=295.380310]
13:46:44.819: dpi=96 (100%)
13:46:44.819: id=\\?\DISPLAY#GSM775C#5&2715e134&0&UID184579#{e6f07b5f-ee97-4a90-b076-33f57bf4eaa7}
13:46:44.819: alt_id=\\.\DISPLAY3

13:46:45.405: video settings reset:
13:46:45.405: base resolution: 3840x2160 > 1920x1080
13:46:45.405: output resolution: 1920x1080


13:46:46.667: Switched to scene 'Scene'
13:46:46.667: ------------------------------------------------
13:46:46.667: Loaded scenes:
13:46:46.667: - scene 'Scene':
13:46:46.667: - source: 'VCR' (dshow_input)
13:46:46.667: - source: 'Display Capture 3' (monitor_capture) > Remove
13:46:46.667: - source: 'Display Capture' (monitor_capture) > Use Window capture if possible, better performance
13:46:46.667: - source: 'Display Capture 2' (monitor_capture) > Remove

13:46:46.667: - source: 'Scene 2' (scene)
13:46:46.667: - filter: 'Image Mask/Blend' (mask_filter_v2)
13:46:46.667: - source: 'camlink' (dshow_input)
13:46:46.667: - filter: 'Image Mask/Blend' (mask_filter_v2)
13:46:46.667: - source: 'Media Source' (ffmpeg_source)
13:46:46.667: - filter: 'Image Mask/Blend' (mask_filter_v2)
13:46:46.667: - source: 'Video Capture Device' (dshow_input)
13:46:46.667: - filter: 'Image Mask/Blend' (mask_filter_v2)

Switch your encoding rate control to CQP

Fix your Sample rate mis-matches, audio will never sync correctly.
13:46:44.798: OBS 30.2.3 (64-bit, windows)
13:46:44.799: ---------------------------------
13:46:44.799: ---------------------------------
13:46:44.799: audio settings reset:
13:46:44.799: samples per sec: 48000
13:46:44.799: speakers: 2
13:46:44.799: max buffering: 960 milliseconds
13:46:44.799: buffering type: dynamically increasing

13:46:46.679: WASAPI: Device 'Focusrite USB (Focusrite USB Audio)' [44100 Hz] initialized (source: Mic/Aux)
13:46:46.684: WASAPI: Device 'Focusrite USB (Focusrite USB Audio)' [44100 Hz] initialized (source: Desktop Audio)

Test
Where did you get the idea that I have an audio sync issue?
 

rockbottom

Active Member
The log. Sample rate mismatches always cause audio sync issues at some point.

There may be more needed to fix your frame sync issue, like a driver update or something else. Wanted you to test with the updated settings first to see if there's any improvement before proceeding any further.
 

Kizzume

Member
Well I'm not deleting my display captures, they aren't enabled unless I click to enable them. Display captures seem pretty solid, honestly. I'm also not degrading my large monitor to 60fps, 120fps shows 60fps content just fine. It's the Elgato video capture that I'm having particular issues with. It seems I'd have to go through a lot to disable the Game DVR--I went through the motions this forum recommended, but there's a multi-step process one can go through to truly disable it.

And I switched it to 44100, though I wasn't really having issues there.

OBS' behavior is so confusing in regards to this: I get fewer sync glitches in 60fps, I get the most sync glitches in 24fps (with my camera's output set for 24fps).

Thanks. And still, I'd be satisfied with them simply adding a "sync" button.
 

rockbottom

Active Member
Potential interference with multiple display, game or window captures in the same scene.

Strongly disagree. It's simple really, easy to use.

I prefer to fix my rig/set-up but you do you.
 
Top