Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In Windows, is there a way to get the duration (e.g. in seconds) of an AVI file from the command line?

I'm fine with using 3rd party tools - the more common, the better.


share|improve this question

1 Answer 1

up vote 4 down vote accepted

MediaInfo is a great tool for extracting such information, there's both a GUI and CLI version. Here is a summary of its basic command line options, you'll probably want to pass it just the filename or include a -f switch for more details.

share|improve this answer
Just found out about this tool on my own :). For the reference, here's the command line that outputs duration in millisesconds: MediaInfo.exe --Output=Video;%Duration% file.avi BTW Running MediaInfo.exe --info-parameters to see what it can output is a bit overwhelming :) –  Cristi Diaconescu May 20 '13 at 11:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.