I'm using ffmpeg to capture a RTSP stream to a file using the following command:
ffmpeg -i rtsp://[IP Address]:[port]/[URL] -vcodec copy -r 60 -t 2600 -y /[outputfile].mp4
This works ok and captures 60 mins fine. What I'd like to be able to do is:
- Output hourly files, e.g.
capture1.mp4 capture2.mp4
etc. - Put the current timestamp as the overlay in the current file (currently
VLC says something like
LIVE555...
). I'd like to change this tosource + timestamp
. - Delete old mp4 files over x days old, e.g. keep files for 1 or 2 days
Is this possible in ffmpeg or do i need to put a script wrapper around the ffmpeg command? If so, any examples of those I can re-use please?
This is on Ubuntu linux using latest ffmpeg package and using apt-get install ffmpeg
to install so it's built from source.
Thanks