
19 Oct
2012
19 Oct
'12
9:30 p.m.
On Fri, 19 Oct 2012, Russell Coker wrote:
Is there any good way to get the resolution of a video file? For jpegs ImageMagick has the "identify" command which works really well, I'd like to have something similar for movies, particularly flv files. Currently I use the below shell script which is ugly but works, unfortunately it flashes up an X window and probably doesn't work if you aren't using X.
#!/bin/sh while [ "$1" != "" ]; do echo q| mplayer $1 2>&1|grep ^VO.*x11| sed -e s/\ =.*$// -e s/^.*\ // shift done
I'd use mediainfo, for both video and image files. mediainfo filename.flv | grep -E "^(Height|Width)" Could also use a mediainfo template for customisable output.