Anakooter
Anakooter

Reputation: 327

FFMPEG: Output to a new file after certain period of time with creation time stamp?

Suppose I have a command:

ffmpeg -f v4l2 -framerate 30 -video_size 640x480 -i /dev/video1 -c:v libx265 -x265-params bitrate=60:vbv-maxrate=60:vbv-bufsize=16:keyint=10:qcomp=0.5 -tune zerolatency -s 640x480 -preset ultrafast -pix_fmt yuv420p -r 5 -strict experimental -f somedate.ts

What I want to do is that after 30 minutes ffmpeg starts writing the stream to new file with filename as time of creation of new file.

Upvotes: 0

Views: 2736

Answers (1)

aergistal
aergistal

Reputation: 31209

Use the segmenter instead of -f somedate.ts plus strftime:

-f segment -segment_time 1800 -strftime 1 "%Y-%m-%d_%H-%M-%S.ts

Where 1800 = 30 * 60 seconds.

Upvotes: 8

Related Questions