CESNET / UltraGrid

UltraGrid low-latency audio and video network transmission system
http://www.ultragrid.cz
Other
485 stars 55 forks source link

delay video #370

Open zbynekdrlik opened 5 months ago

zbynekdrlik commented 5 months ago

Hi, I am looking how to delay video in ultragrid as obs video delay filter is unstable and get always different number. I see that ffmpeg has that type of parameter.

Thanks

MartinPulec commented 5 months ago

Hi, it depends. There is an option to delay video in relation to audio. In theory it can be used, depending on actual situation. My questions are:

  1. do you use audio as well or only the video?

  2. what is approximate duration of the delay?

If the responses is "no" and something below 1 second, you could use something like:

uv --audio-delay -AMOUNT_IN_MS

I'll explain – in this mode audio or video is delayed given amount of milliseconds, in case of negative value, video is delayed (as we cannot present video earlier). My second question is because I am not unsure if this trick scales well beyond let say few second; other approach will be perhaps more eligible.

zbynekdrlik commented 5 months ago

Audio is coming to destination by different route and is around 1 second latter then video. Audio is highly processed by high latency ai plugins in daw and thats reason why video is receiving sooner then audio.

MartinPulec commented 5 months ago

Thanks for the info, so we'll try to add video delay postprocessor. Adding the delay to -1000 ms as I proposed above may or may not work but it is slightly on a borderline of what is rather misusing that parameter.

MartinPulec commented 5 months ago

I've just added the delay video postprocessor that might be able to do the task, example usage:

uv -p delay:sec=1.5 -d gl

The code should be built in continuous in few moments.

zbynekdrlik commented 5 months ago

Thanks