libav - save (segmented) stream capture with timestamp in filename

1

I was looking on the internet how to make a homemade DVR (using a Linux machine) and what I found was this avconv command:

avconv -i rtsp://<user>:<password>@xxx.xxx.xxx.xxx:xxx/play1.sdp -c copy -map 0 -f segment -segment_time 300 -segment_format mp4 "capture-%03d.mp4"

However, as seen in the command, the file name pattern is sequential (capture-001.mp4) and I need the name with the date and time (capture-12-08-2017_15-54.mp4), and searching the libav documentation apparently only this sequential option is possible.

I would like to know if it is possible to use only avconv and bash (if so how), or otherwise what tools I need.

Thank you in advance.

    
asked by anonymous 12.08.2017 / 10:17

1 answer

1

As discussed in the English version of this question , a user recommended me to change to ffmpeg which already has an attribute supporting timestamp, so I got what I needed with this command:

ffmpeg -i rtsp://<user>:<password>@xxx.xxx.xxx.xxx:xxx/play1.sdp -c copy -map 0 -f segment -strftime 1 -segment_time 1800 -segment_format mp4 out-%d_%m_%Y-%H_%M_%S.mp4

    
14.08.2017 / 11:04