suppose have streaming video url rtsp://whatever , wish store video stream file system series of files off approximately same size or duration. ideally store files start , stop timestamp part of filename, , each file should such can stand on own displayed video file if wants view it. understand ffmpeg has segment command option allows me segment time , store in series of files outfile%3d.dat or whatever. suppose want perpetually , cycle files (age out old ones) when total size of saved files exceeds specific value. example, suppose want save recent 500gb of video streaming url , keep doing day after day continuously distant future. happens output filename after outfile999.dat saved? count start on @ 0? or ffmpeg stop or crash? there ffmpeg command can segment , age out old files, or have running program simultaneously or have hack ffmpeg this? i'm pretty new ffmpeg suggestions ffmpeg experts might have on how welcome. welcome suggestions other command line linux tools might better application.
update: turns out ffmpeg has segmenter built in, , can segment files such filenames have video start datetime part of filename. used command this:
ffmpeg -i rtsp://camera_feed_url_here -c copy -f segment -segment_list out.list -segment_time 900 \ -segment_atclocktime 1 -strftime 1 "%y-%m-%d_%h-%m-%s.mkv"
that's news. bad news when run command, after 1 minute throws error , stops:
rtsp://camera_feed_url_here: invalid data found when processing input
no other error or diagnostic mesages printed out. when run -loglevel debug, seems die error message.
when built ffmpeg, used this:
./configure --enable-demux='rtsp,rtp,sdp,flac,gif,image2,image2pipe,matrosk' --enable-network --enable-protocols --enable-decoder=h264
any ideas i'm doing wrong , how can make error go away?
well turns out using wrong rtsp url. above command ffmpeg segmentation works fine. option works fine (with correct url) openrtsp. sued openrtsp command , works fine too:
/path/to/openrtsp -4 -w 1920 -h 1080 -f 25 -b 1000000 -v -t -p 60 -u username password -f outfiles rtsp://ipaddress_here/streaming/channels/1
the above save new file every 60 seconds , call outfiles-xxxx.mp4 xxxx indicator of time slice of file. -u option lets eneter username , password password-protected rtsp source.