[FFmpeg-user] How to get video duration in a script using ffmpeg?

Carl Zwanzig cpz at tuunq.com
Thu Jan 20 18:31:51 EET 2022

On 1/20/2022 6:08 AM, Bo Berglund wrote:
> So it creates 3 instances of the duration output...

It does, because they come from three different places (and the values may 
be different).

> Have to add  | tail -n 1 to the end to get one item only.

Nothing wrong with that, or with telling mediainfo to output only a single 
value (it's in the doc and some of the examples in this thread). Or you 
could adjust your scripts to select one of them.


More information about the ffmpeg-user mailing list