fzwoch / obs-gstreamer

GStreamer OBS Studio plugin
GNU General Public License v2.0
349 stars 34 forks source link

Latency High when OBS is started, Latency Low when GStreamer Effect is updated / edited #85

Closed ReComplexed closed 1 year ago

ReComplexed commented 2 years ago

Hi, When I start obs the latency is high, but when I update / edit the pipes like in this example (Clicked Apply at the 11.8 Second Mark) the Latency is low! Is this a GStreamer or Plugin issue?

I changed tee name=t ! queue ! pulsesink sync=false async=false t. ! queue to tee name=t ! queue ! pulsesink sync=false async=true t. ! queue

Thanks for your feedback

fzwoch commented 2 years ago

No idea really. It may be due to how OBS sends the first sample on startup. There may be a gap in between and the audio sink tries to compensate it somehow. Audio is difficult with latency and under-flowing buffers..

normen commented 2 years ago

I found a possible reason: When OBS is under load it seems to add buffers to the source plugin output. Disabling these with obs_source_set_async_unbuffered fixes any "buildup" of latency for me I had with RTSP cameras.

My PR #66 includes an added option to disable buffers in OBS.

Edit: Oops, this is about effects, the PR is only about sources, sorry.

ReComplexed commented 1 year ago

I found a possible reason: When OBS is under load it seems to add buffers to the source plugin output. Disabling these with obs_source_set_async_unbuffered fixes any "buildup" of latency for me I had with RTSP cameras.

My PR #66 includes an added option to disable buffers in OBS.

Edit: Oops, this is about effects, the PR is only about sources, sorry.

Well, again... This is like the 100th time where the OBS latency is bugging me. @normen Please add a Fix to your merge request where you add many of the latency options into the effects too, it's SO annoying!

normen commented 1 year ago

wat?

ReComplexed commented 1 year ago

wat?

I am using your Pull Request to disable the OBS buffering in the GStreamer plugin Sources. Would it be possible to implement that into the effects too?

normen commented 1 year ago

I don't know, I didn't look into the effects stuff yet, no idea if it works the same there.

fzwoch commented 1 year ago

Closing as whatever the effect is, I doubt it is solvable in GStreamer or this plugin.