Re: [LAU] Retrieving audio info from a video file

From: Lorenzo <lsutton@email-addr-hidden>
Date: Tue Feb 09 2010 - 14:15:05 EET

-------- Original Message --------
Subject: Re: [LAU] Retrieving audio info from a video file
From: luigi curzi <luigi_curzi@email-addr-hidden>
To: linux-audio-user@email-addr-hidden
Date: 09/02/2010 12.57
> Il giorno Tue, 09 Feb 2010 11:12:30 +0000
> Jonathan Gazeley<jonathan.gazeley@email-addr-hidden> ha scritto:
>
>
>> On 02/09/2010 10:38 AM, Emiliano Grilli wrote:
>>
>>> Jonathan Gazeley<jonathan.gazeley@email-addr-hidden> writes:
>>>
>>>
>>>
>>>> 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...
>>>>
>>>>
>>> maybe "mplayer -frame 0 -identify myfile.avi" ?
>>>
>>>
>>>
>>>
>>>> Cheers,
>>>> Jonathan
>>>>
>>>>
>>> HTH
>>> Ciao
>>>
>>>
>>>
>> 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@email-addr-hidden ~]$ 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?
>>
>>
> the right command line is:
> mplayer -frames 0 -identify -ao null -vo null movie.avi
>
>
Also if you have many files in (say) a dir you could do something like
this with ffmpeg (warning untested!):

Reply
Edit
#!/bin/bash
for videoFile in `ls *.avi`; do
     ffmpeg -i "$videoFile" 2> ffInfoTemp
     echo $videoFile: `cat ffInfoTemp | grep "Audio"`
done
rm ffInfoTemp

This *should* print the avi file name and the "Audio..." string(s) from
ffmpeg for all avi files in the dir

Lorenzo

_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-user
Received on Tue Feb 9 16:15:03 2010

This archive was generated by hypermail 2.1.8 : Tue Feb 09 2010 - 16:15:03 EET