What is the best way to obtain information as bitrate, framerate, width/height of an movie file (in my case .avi
) from the command line? I am looking for a basic tool that works similarly as ImageMagicks identify
.
Running mplayer
already gives this information (but also does a lot more):
VIDEO: [FMP4] 800x711 24bpp 25.000 fps 1320.9 kbps (161.2 kbyte/s)
Is there a way to make mplayer
only give this output (I did not find it in the man) or is there another standard bash-command to obtain the same information?
Best Answer
mplayer
comes with anmidentify
utility that does mostly what you want.The output looks like variable assignments, so it is pretty easy to use in scripts/simple to parse.
If
midentify
isn't installed with yourmplayer
package, you might have anmidentify.sh
script in/usr/share/mplayer
or something like that. If not,midenfify
just runsmplayer
with a specific set of arguments:The
-ao
,-vo
and-frames
parameters preventmplayer
from actually playing the clip. The rest is just formatting.Example: