1

In trying to add a 10 second delay between a number of cameras and livestreams being fed into OBS, I wanted to be able to switch the stream before certain events occurred and the 10 second delay would allow that.

I found that using a command of the form:

ffmpeg -i input -vf tpad=start_duration=10 -af adelay=10000|10000 stream-out

would insert 10 seconds of blank content at the beginning of the video stream, but that it would stream out all of the blank content in the first several seconds so that the outgoing livestream was effectively caught up with the incoming camera stream.

Looking at the outgoing network traffic, I would see a burst of high network traffic when the stream starts sending the first 10 seconds of data and then the network traffic settles to the usual constant traffic level for the video stream.

If I start watching the outgoing stream at the beginning, there is a 10 second delay in the livestream that stays as I watch. If I ever lose the stream and reconnect or start watching the stream after it was already running, the 10 second delay is no longer there.

I am really trying to cause ffmpeg to delay the sending of the output stream in time, so that it is always buffering 10 seconds of data, and the -vf tpad=start_duration=10 -af adelay=10000|10000 commands do not do that.

Is there another ffmpeg command that will force the actual output traffic of ffmpeg to stay delayed?

  • Some basic understanding is severely lacking. Those two filters are not designed for delaying network streams. –  Aug 13 '20 at 10:10
  • I would agree that those filters do not accomplish it, but there were fairly recent posts that said they did: https://stackoverflow.com/questions/53383354/how-do-i-add-a-delay-to-a-live-stream-sourced-from-webcam-v4l2-with-ffmpeg. I have been able to achieve the desired effect using Gstreamer. – Ken Ocheltree Aug 13 '20 at 16:55
  • Those filter accomplish what are designed just fine, just not what you want. They cannot add delay to streams for each and every time someone joins in. –  Aug 14 '20 at 07:52
  • OK, if those filters are appropriate for adding the desire delay, are there other filters that are? Would making the buffer size larger be the way to accomplish this? – kamprath Dec 31 '20 at 20:45

1 Answers1

0

The best way to do this is in OBS by adding a delay on each input using the Video Delay (Async) Filter that can add a delay up to 20 seconds.