Ticket #1753 (new enhancement)
Delay output for X seconds
|Reported by:||burek||Owned by:|
|Blocking:||Reproduced by developer:||no|
|Analyzed by developer:||no|
It would be nice to add a feature where the output could be delayed for certain amount of time (specified in seconds or hh:mm:ss.mmm). One use case for this might be the case where we want to capture the video, only when a certain event occurs (like lightning bolt, robbery or trespassing for example). If we start capturing the output at that exact moment, we might loose some valuable time, but if the output was buffered, then capturing would start in the past, enabling people to record an important event.
How to make use of the feature?
Start one ffmpeg to capture and buffer the webcam input (the output will start after 10 seconds and will continue real-time, always being late for 10 seconds, comparing to the current time):
ffmpeg -f v4l2 -i /dev/video0 -vf delay 10 -af delay 10 -f mpegts udp://localhost:1234
Start another ffmpeg only when some important event occurs (triggered by the sensor or something similar):
ffmpeg -f mpegts -i udp://localhost:1234 -map 0 -c copy capture.avi
Obviously capture.avi will start recording from the past, considering the current time the event was triggered, which will allow the beginning of the event to get recorded as well.