title: Extracting basic info from animation file
body: <p>I'm writing an application that handles metadata for images and all kinds of animations, so I'm looking for a way to find basic info about an animation file, e.g:</p>
  
  <ul>
  <li>length (in minutes/seconds/frames)</li>
  <li>aspect ratio of pixels</li>
  <li>resolution of individual frames</li>
  <li>framerate</li>
  </ul>
  
  <p>Right now, I let my program execute</p>
  
  <pre><code>mplayer -identify animfile.avi
  </code></pre>
  
  <p>and parse its console output, which contains all the info I need in a machine-readable format. This works fine, but I know that some potential users of the program prefer <strong>vlc</strong> as a media player so I'd rather avoid having a hard dependence on mplayer being installed.</p>
  
  <p>I've tried</p>
  
  <pre><code>vlc -vv animfile.avi
  </code></pre>
  
  <p>which prints an ungodly amount of junk on the console, sometimes containing the stuff I'm looking for. The formatting and what data gets printed seems to vary depending on the file format of the animation though. </p>
  
  <p>Is there an easier way to extract basic info from an animation of any format one has a decoder for (especially the length of the animation)  using vlc or som other app/library that is usually available on a typical Linux installation?</p>
  
  <p>Edit: I'd rather use another program to do the dirty work, as this is supposed to work for any animation format, e.g avi, mpg, mov, wmv, vob etc.</p>
  
  <p>Edit: totem-video-indexer seems more promising, and was also included with the standard installation. Enough codecs to make it useful, however, was not. That could be fixed by installing the "non-free-codecs" package from medibuntu.</p>