Different video duration formats

Started by faketoe, March 18, 2016, 11:01:18 PM

Previous topic - Next topic

faketoe

Hi,

when I use exiftool to get video duration of two file, I get different duration formats,

"Duration": "14.33 s"
"Duration": "0:01:00"

How can I parse / handle this different formats ? Is it just these two types or exiftool may report other duration formats depending on the video ?

ps. I also added full output into gist, https://gist.github.com/ubaltaci/6c96053b4feef66b7710


Phil Harvey

The format is intended to be human readable, and depends on the length of the video.  Use the -n option to get a consistent machine-readable format.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

djebox

Hi,

but how can we do if we don't want to use '-n' option...
It exists --coordFormat option to format GPS coord, does it exist something like this for duration ? --durationFormat ?

Thanks
FDJ

Phil Harvey

There is no option to change the human-readable format for Duration.

The only options are to use either -n or -duration# to avoid the conversion.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).