Video delay filter does not refresh properly

Chaser4132

New Member
We have two cameras splitted into two scenes with shared audio source:
- RTSP (1200ms delay)
- HDMI via grabber (AVerMedia Live Gamer HD 2, 140ms delay)

To sync them up we delayed HDMI camera video to RTSP (Video Delay (Async) filter, 1060ms) and shared audio to RTSP (1200ms). When we switch from RTSP scene to HDMI there is a visible delay (1200ms) before OBS refreshs video. This is visible on preview and on stream too. When we switch HDMI to RTSP - issue does not happen but from RTSP to HDMI where filter is used OBS displays old frame (before switched to RTSP) until it reach 1200ms and "new" video (refreshed) appears. Why it happens if a filter is asynchronous? If it is async i thought it should work in background but it does not (it seems synchronous). What am I doing wrong?

Thank you in advance
 

carlmmii

Active Member
It happens because you are literally delaying the visibility of the HDMI source, and you likely have it set to deactivate the device capture when not visible. Ensure this is not checked in the video capture device settings for your HDMI capture.

When OBS has to display a source using async delay, it will store the frames it receives into VRAM for later. If the source is deactivated at the time that you switch to a scene that uses it, then OBS only starts getting frames at that transition point, because the source is only active once the scene is. That means that there's no frames waiting in VRAM to be displayed, so until the time has passed to where the first frames can actually be shown after the delay, OBS has nothing to show other than the last frame that it used from before.
 

Chaser4132

New Member
It happens because you are literally delaying the visibility of the HDMI source, and you likely have it set to deactivate the device capture when not visible. Ensure this is not checked in the video capture device settings for your HDMI capture.
Thanks for reply. Unfortunately - the checkbox is unchecked so it isn't a reason of this behavior. Maybe the filters works only when source is present on current scene and that's why it happens and it need 1200ms to buffer video? How to force OBS to stay device and filter active all the time?

115558508_290919595579998_925002467582632123_n.png


It looks like OBS bug. There is probably possible workaround which I have to check: if I add HDMI source to the second scene and hide it (alternatively it can be visible but out of scene screen) - OBS should't stop processing this source even it's not visible. I will check this workaround but the question is: why it doesn't work normally?
 
Last edited:

Chaser4132

New Member
I checked an issue on different configuration (PC with Intel CPU, different GPU, USB camera Logitech HD Webcam C270, RTSP test stream) and problem occurs too. Without filter everything seems fine but with enabled filter - OBS probably doesn't process video from device even if deactivation options are disabled. I attach simpler log without streaming, just switching scenes.

Simplest steps to reproduce:
1. Get any video device, create first scene and set them as "Video Capture Device" source with disabled buffering and unchecked "Deactivate when not showing"
2. Add "Video Delay (Async)" filter with 1500ms delay and apply to previously added source
3. Create a second scene without any sources
4. Switch from first scene to second and wait about 2 seconds
5. Switch from second scene to first. You will see a buffering error (lag)

My workaround (add same video source to second scene and place them out of screen) works but it isn't a solution - it's definitely a bug in OBS to fix.
 

Attachments

  • 2020-07-29 00-27-55.txt
    14.6 KB · Views: 12

Chaser4132

New Member
There is no audio in provided example (default camera fader is set to 0). In my base configuration I use ASIO plugin with Behringer UMC22 interface delayed by 1200ms as shared source between scenes.
 

hpmoon

New Member
I'm surprised that this problem hasn't been addressed or worked around in years; keeping different video sources in sync that vary based on Ethernet versus HDMI versus USB is extremely commonplace: using the video filter's delay on certain sources that have lowest latency, to stay in sync with ones that have bad latency, should not be resulting in freeze frames after switching. As pointed out here, OBS should simply be keeping the video source and filter active so as not to take a lazy break and waiting for the scene switch before adding the delay.
 
Top