Producing a udp stream delay with ffmpeg
I have a stream coming in from an RTP stream over UDP. With FFMPEG, I am redirecting that stream to another port. I would like to know if there is a way to intentionally add a delay to this output stream.
An example of the current stream function:
ffmpeg -an -i rtsp://stream-ip:port -an -r 10 -tune zerolatency -preset fast -vcodec libx264 -f mpegts udp://outgoing-ip:port
I would like to add an intentional 30 - 180 second latency to the stream. This would allow systems on the outbound-end to be alerted to perform some video processing with a nice healthy buffer. Does ffmpeg has such a feature, if not is there an alternative route to produce such an intentional delay?
No direct feature but you can prefix a blank stream of N seconds to achieve the same goal.
ffmpeg -f lavfi -i nullsrc=s=WxH:d=N -an -i rtsp://stream-ip:port -filter_complex "concat" -an -r 10 -tune zerolatency -preset fast -vcodec libx264 -f mpegts udp://outgoing-ip:port
You have to replace WxH with the resolution of the input feed, and N with the duration of the 'delay' in seconds.