<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
-------- Original Message --------<br>
Subject: Re: [LAU] Retrieving audio info from a video file<br>
From: luigi curzi <a class="moz-txt-link-rfc2396E" href="mailto:luigi_curzi@yahoo.it">&lt;luigi_curzi@yahoo.it&gt;</a><br>
To: <a class="moz-txt-link-abbreviated" href="mailto:linux-audio-user@lists.linuxaudio.org">linux-audio-user@lists.linuxaudio.org</a><br>
Date: 09/02/2010 12.57<br>
<blockquote cite="mid:20100209125751.2390d1bd@pozzaibe" type="cite">
  <pre wrap="">Il giorno Tue, 09 Feb 2010 11:12:30 +0000
Jonathan Gazeley <a class="moz-txt-link-rfc2396E" href="mailto:jonathan.gazeley@bristol.ac.uk">&lt;jonathan.gazeley@bristol.ac.uk&gt;</a> ha scritto:

  </pre>
  <blockquote type="cite">
    <pre wrap="">On 02/09/2010 10:38 AM, Emiliano Grilli wrote:
    </pre>
    <blockquote type="cite">
      <pre wrap="">Jonathan Gazeley<a class="moz-txt-link-rfc2396E" href="mailto:jonathan.gazeley@bristol.ac.uk">&lt;jonathan.gazeley@bristol.ac.uk&gt;</a>  writes:

   
      </pre>
      <blockquote type="cite">
        <pre wrap="">Hi all,

This is slightly OT for the group, but I hope someone can tell me.

I have thousands of large AVI files and I want a quick way to
determine from the command line whether their audio is stereo,
5.1, etc.

I've read about ffmpeg and haven't seen anything jumping out at
me, and it's hard to pick the right search keywords to find
relevant pages on Google.

Anyone know a trick to get this info? Currently I can do it by
right-clicking on the file and viewing its properties, but there
*has* to be a better way...
     
        </pre>
      </blockquote>
      <pre wrap="">
maybe "mplayer -frame 0 -identify myfile.avi" ?


   
      </pre>
      <blockquote type="cite">
        <pre wrap="">Cheers,
Jonathan
     
        </pre>
      </blockquote>
      <pre wrap="">HTH
Ciao

   
      </pre>
    </blockquote>
    <pre wrap="">
Thanks for your advice. Unfortunately this seems to require a
graphical machine, but I'm trying to run this on a headless
fileserver that has all my media.

[jonathan@zeus ~]$ mplayer -frame 0 -identify movie.avi
Creating config file: /home/jonathan/.mplayer/config
Unknown option on the command line: -frame
Error parsing option on the command line: -frame
MPlayer SVN-r29701-4.4.1 (C) 2000-2009 MPlayer Team

Any other ideas?

    </pre>
  </blockquote>
  <pre wrap="">the right command line is:
mplayer -frames 0 -identify -ao null -vo null movie.avi

  </pre>
</blockquote>
Also if you have many files in (say) a dir you could do something like
this with ffmpeg (warning untested!):<br>
<br>
<div style="position: fixed; z-index: 50; display: none;" class="FRB">
<div class="HRB">
<div title="Reply to this message" class="gwt-Label GRB">Reply</div>
<div title="Edit this message" class="gwt-Label GRB">Edit</div>
</div>
</div>
#!/bin/bash<br>
for videoFile in `ls *.avi`; do<br>
    ffmpeg -i "$videoFile" 2&gt; ffInfoTemp<br>
    echo $videoFile: `cat ffInfoTemp | grep "Audio"`<br>
done<br>
rm ffInfoTemp<br>
<br>
This *should* print the avi file name and the "Audio..." string(s) from
ffmpeg for all avi files in the dir<br>
<br>
Lorenzo<br>
</body>
</html>