I am trying to record a rtsp stream with ffmpeg, segmented by certain amount of time, and name the file with the start time. I used strftime to expand the output filename with timestamp, but I wonder if there is an option that can expand the filename with rtp timestamp instead of local time.

Below is my current ffmpeg command

ffmpeg -y -i url -f segment -segment_time 60 -segment_format mp4 -segment_atclocktime 1 -strftime 1 -acodec copy -vcodec copy ./%Y/%m/%d/%H/record_%Y-%m-%d-%H-%M-%S.mp4


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.