[FFmpeg-user] segment_atclocktime problem

Tom Worster fsb at thefsb.org
Sun Nov 15 19:41:47 EET 2020


I'm using ffmpeg to connect to an icecast server and save its AAC audio 
stream to m4a files each 5 minutes long.

Occasionally, about 1 in 15 or 20 files, the name of the file has 
timestamp one second after the desired atclocktime, like

name-20201115T144500Z.m4a
name-20201115T145000Z.m4a
name-20201115T145500Z.m4a
name-20201115T150000Z.m4a
name-20201115T150501Z.m4a

I do not have this issue with MP3 shoutcast/icecast streams.

What can I do to prevent this and get ffmpeg to write files with the 
atclocktime? instead of what I assume is the actual time when the file 
is written.

ffmpeg \
-i http://icecast.ser.ver/mount \
-c copy \
-f segment \
-segment_format_options movflags=+faststart \
-segment_time 300 \
-segment_atclocktime 1 \
-break_non_keyframes 1 \
-strftime 1 \
name-%G%m%dT%H%M%SZ.m4a

When working with an MP3 stream the command has segment_format_options 
write_xing=0 and mp3 output file extension.

Tom


More information about the ffmpeg-user mailing list