(ffmpeg-utils)2.3. Syntax | Time durationΒΆ


Time duration

Official documentation says:

There are two accepted syntaxes for expressing time duration.


HH expresses the number of hours, MM the number of minutes for a maximum of 2 digits, and SS the number of seconds for a maximum of 2 digits. The m at the end expresses decimal value for SS.



S expresses the number of seconds, with the optional decimal part m. The optional literal suffixes s, ms or us indicate to interpret the value as seconds, milliseconds or microseconds, respectively.

In both expressions, the optional - indicates negative duration.

[me@host: ~]$ # transcode 30 seconds
[me@host: ~]$ ffmpeg -y -i video.mkv -t 30 out.mkv
[me@host: ~]$ # 3500 milliseconds
[me@host: ~]$ ffmpeg -y -i video.mkv -t 3500ms out.mkv
[me@host: ~]$ # 1 minutes 20 seconds
[me@host: ~]$ ffmpeg -y -i video.mkv -t 01:20 out.mkv
[me@host: ~]$ # generates 30 seconds of sound
[me@host: ~]$ ffplay -f lavfi "sine=880:d=30" -autoexit
[me@host: ~]$ # 3500 milliseconds
[me@host: ~]$ ffplay -f lavfi "sine=880:d=3500ms" -autoexit
[me@host: ~]$ # 1 minutes 20 seconds of sound
[me@host: ~]$ ffplay -f lavfi "sine=880:d='01\:20'" -autoexit