Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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.