multiple return formats on Duration?

Started by guthrie, December 21, 2014, 10:49:24 PM

Previous topic - Next topic

guthrie

I am using the command line tool to get video file durations and parse the returned strings in Python.

But I find that I am not getting a consistent return string:

#  Video>exiftool -Duration "20141206155829 -File2.MTS"
# Duration                        : 5.67 s
#
#C:Video>exiftool -Duration 20141206160513 -File3.MTS
# Duration                        : 0:00:40

??

Also I'd really like to just get the time back, not the label and formatted string, e.g. "0:00:40", or better yet, just in seconds? "40".

Phil Harvey

Add -n to your command, or request -duration# instead of -duration.

- 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 ($).

guthrie

Thanks, very good!

It would be nice to just get the number/value, and not the tag - since that is already specified in the argument request.

Phil Harvey

...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 ($).