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.

I'm currently writing a regular expression for deciphering the output from FFmpeg, after using FFmpeg to determine the attributes from a file with the following command;

ffmpeg.exe -i .\test.avi

The output would be along the lines of this;

FFmpeg version SVN-r26400, Copyright (c) 2000-2011 the FFmpeg developers
built on Jan 18 2011 04:07:05 with gcc 4.4.2

Seems stream 0 codec frame rate differs from container frame rate: 30000.00 (30000/1) -> 15.00 (15/1) Input #0, avi, from 'test.avi':
Duration: 00:27:46.60, start: 0.000000, bitrate: 154 kb/s Stream #0.0: Video: mpeg4, yuv420p, 320x240 [PAR 1:1 DAR 4:3], 15 fps, 15 tbr, 15 tbn, 30k tbc Stream #0.1: Audio: mp3, 24000 Hz, 2 channels, s16, 40 kb/s At least one output file must be specified

Now what I'm looking for guide for the all the abbreviations and possible names so that my regular expression won't potentially break. For example, mpeg4, mp3, 2 channel, mono, a list of formats supported and their names. I've looked through the FFmpeg documentation but can't find exactly what I want

Thanks for any help!

share|improve this question
1  
Maybe it is better to write dedicated program for metainfo retrieving using ffmpeg's library (libavcodec) instead of parsing the output of ffmpeg utility? –  ulidtko Jan 19 '11 at 14:16
1  
Also, you may find all possible abbreviations and output variations in the source of ffmpeg utility. –  ulidtko Jan 19 '11 at 14:17

1 Answer 1

up vote 3 down vote accepted

There's a tool that comes with ffmpeg that is far better suited to what you are trying to do: ffprobe. Using the -show_streams option, it is much more amenable to regex (one key=value pair per line by default, and it outputs to stdout). To show information about all the streams:

ffprobe -i input.file -show_streams

You can also view information about specific streams with -select_streams.

##  shows information about all video streams:
ffprobe -i input.file -show_streams -select_streams v
##  shows information about the first audio stream:
ffprobe -i input.file -show_streams -select_streams a:0

To view information about the container format, use -show_format

Check out the documentation for more information.

share|improve this answer

Your Answer

 
discard

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.