# Ability to delay video in negative ms



## Saturn2888 (May 21, 2015)

I have a similar issue to others where my video is outta sync with my audio. I'd like to set the video delay to -10ms, but I can only go 0 or greater. I know this is a programming nightmare, but you allow negatives in the Advanced Audio Properties, so I figure something is already setup to accommodate impossibilities like this.

The only way I can seem to get them sync'd up right now is by delaying the audio to match. Sadly, the desktop audio is ahead of my mics and then it'd require an even further delay to get it all working properly.

To me, it's more logical to set desktop audio to 0ms offset and set my mics to -3ms and set my video capture to -10ms instead of setting mics to 10ms, desktop to 13ms, and video to 0ms. The issue being, if I get another video source which is even further delayed, then all of my other values have to change to accomodate for the new 0ms offset of the most-delayed device.


----------



## Jim (May 21, 2015)

The concept of "negative delay" on video requires a tremendous amount of memory, and isn't especially feasible with texture-based video sources involved (which are the majority of sources).  The reason for that is because the only way negative video can be achieved is by delaying all sources and then removing the delay for the specific source that you want to be "negative".  It's not actually possible to do "negative" delay any other way.  So all other sources in the scene have to be delayed instead of actually applying some sort of negative video delay.

Negative audio delay is a completely different matter and much easier to do because it requires insignificant memory to buffer, but video delay is definitely not quite as feasible.  That being said, tiny amounts aren't too huge of a deal, so I might add a texture-based video delay effect filter in the future so people can manually delay all their sources themselves, but the idea of making obs internally buffer all its video data automatically is something I don't like due to the resource requirements and isn't worth the coding investment for the vast majority of cases.


----------



## Saturn2888 (May 22, 2015)

I see. I didn't know it took a lot of memory. But yes, that moving everything else is what I was seeing as well, everything else would have to be moved.

So are you saying I should push everything forward so the video looks like it's in time?


----------



## Jim (May 23, 2015)

Well if it were regular memory it would be fine, but it's GPU memory in this case, which is very limited, but like I said I'll see about adding a filter for it with a limited amount of max delay.


----------



## Saturn2888 (May 25, 2015)

In OBS MP with buffering enabled, I messed w/ the mic settings, and it's like 300-350ms off or something around there.

The other issue comes when pushing the ms offset forward on the mics and desktop audio. Once I do that, the game capture's way ahead of the audio. It's just a mess trying to get this video in sync w/ the audio while buffering is enabled.


----------



## Saturn2888 (Jun 1, 2015)

@Jim, do you know how many milliseconds max could be buffered for something like this or is it going to be trial and error?


----------



## balloonhead (Jun 2, 2022)

I'm having the same situation here. A webbrowser Source gives me a live video stream from an android phone. this is delayed around 100 to 150ms. I'm thinking about getting the other sources seperated into a group in the scene and then putting a delay on the complete group. Don't know if this works.


----------

