I have an RTSP stream and I need to segment it with 2s segments with 1s overlaps.
i.e.
t(s): 0----1----2----3----4----5----6----7----8----9----10---->
vids: |--1.mp4--|--3.mp4--|--5.mp4--|--7.mp4--|--9.mp4--|
|--2.mp4--|--4.mp4--|--6.mp4--|--8.mp4--|
I can split to 2s segments, every 2 seconds, but I can't see how I can split to 2s segments every one second.
So far I have used the below:
ffmpeg \
-i rtsp://192.168.1.124:8553/unicast \
-c copy -flags +global_header \
-f segment \
-segment_time 2 \
-segment_format_options movflags=+faststart \
-reset_timestamps 1 \
%d.mp4 \
The approach I was thinking was to copy the stream, delay by 1s and then segment that separately but this seems wasteful and there's no way to guarantee the overlap.
Any ideas?