Hello, I like to run FFMPEG as a cron job to loop-record an IP cam stream into wrap-limited segments. To make it power-cut and network-cut proof, I wanted to restart FFMPEG periodically, giving it a timelimit. But it keeps ignoring it on the test bench. ffmpeg -loglevel debug -hide_banner -timelimit 60 -i 'http://192.168.1.23:456/videostream.cgi?user=USER&pwd=PWD' -y -f segment -segment_time 3600 -segment_format mp4 -segment_atclocktime 1 -segment_wrap 3 -c copy /path/to/destination/recording-%03d.mp4 I'm thinking of adding a kill-job to the crontab, then restart FMPEG again as an alternative. Not elegant but a workaround... What could be a reason why this is being ignored? It's a global option
On 7/20/2021 12:23 PM, S. Helbig via ffmpeg-user wrote:
ffmpeg -loglevel debug -hide_banner -timelimit 60 -i 'http://192.168.1.23:456/videostream.cgi?user=USER&pwd=PWD' -y -f segment -segment_time 3600 -segment_format mp4 -segment_atclocktime 1 -segment_wrap 3 -c copy /path/to/destination/recording-%03d.mp4
-timelimit duration (global) Exit after ffmpeg has been running for duration seconds in CPU user time. (not clock time) You probably want -t ("When used as an input option (before -i), limit the duration of data read from the input file.) Not needed with this one, but always post the complete output w/o -hide_banner (check the list FAQ for more info). Later, z!
And cpu time will be smaller when you use "-c copy" than not. -------------------------------------------------------------- hw@LAPTOP-EBDLMFEM:~/work/tmp$ time ffmpeg -hide_banner -timelimit 2 -re -i in.mp4 -y out.mp4 ... Killed 93 fps= 23 q=28.0 size= 0kB time=00:00:03.97 bitrate= 0.1kbits/s speed=0.988x real 0m4.542s user 0m2.997s sys 0m0.081s hw@LAPTOP-EBDLMFEM:~/work/tmp$ time ffmpeg -hide_banner -timelimit 2 -re -i in.mp4 -y -c copy out.mp4 ... real 0m11.468s user 0m0.060s sys 0m0.037s -------------------------------------------------------------- On 7/21/2021 3:32 AM, Carl Zwanzig wrote:
On 7/20/2021 12:23 PM, S. Helbig via ffmpeg-user wrote:
ffmpeg -loglevel debug -hide_banner -timelimit 60 -i 'http://192.168.1.23:456/videostream.cgi?user=USER&pwd=PWD' -y -f segment -segment_time 3600 -segment_format mp4 -segment_atclocktime 1 -segment_wrap 3 -c copy /path/to/destination/recording-%03d.mp4
-timelimit duration (global) Exit after ffmpeg has been running for duration seconds in CPU user time.
(not clock time)
You probably want -t ("When used as an input option (before -i), limit the duration of data read from the input file.)
Not needed with this one, but always post the complete output w/o -hide_banner (check the list FAQ for more info).
Later,
z! _______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
-- yaofahua@qq.com
participants (3)
-
Carl Zwanzig -
Martin Yao -
S. Helbig