
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 -- My Main Blog http://etbe.coker.com.au/ My Documents Blog http://doc.coker.com.au/

On 19/10/2012, at 23:32, Russell Coker <russell@coker.com.au> 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.
I use this script that comes in the Mplayer source: http://dl.dropbox.com/u/2643992/midentify.sh It pulls out most all of the media metadata and displays it in a way re-usable for shell input. It also doesn't actually play the media, so no pop-ups for 1 frame. hannah

On Fri, 19 Oct 2012, hannah commodore <hannah@tinfoilhat.net> wrote:
I use this script that comes in the Mplayer source: http://dl.dropbox.com/u/2643992/midentify.sh
It pulls out most all of the media metadata and displays it in a way re-usable for shell input. It also doesn't actually play the media, so no pop-ups for 1 frame.
Thanks for that tip. It turns out that it's in the Debian package but for some reason they put it under /usr/share/mplayer/ instead of /usr/bin. So when looking for mplayer binaries I missed it but when looking for what happens to the midentify.sh script it was easy to find. I considered filing a Debian bug report, but there are plenty of open bugs against mplayer so it's probably not worth doing. -- My Main Blog http://etbe.coker.com.au/ My Documents Blog http://doc.coker.com.au/

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.

Russell Coker <russell@coker.com.au> 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.
Try avprobe, which in Debian can be found in the libav-tools package.

On Fri, Oct 19, 2012 at 11:32:13PM +1100, Russell Coker wrote:
Is there any good way to get the resolution of a video file?
i've used mediainfo in the past. Package: mediainfo Version: 0.7.60-1 Depends: libc6 (>= 2.4), libgcc1 (>= 1:4.1.1), libmediainfo0 (>= 0.7.52), libstdc++6 (>= 4.4.0), libzen0 (>= 0.4.23) Description-en: command-line utility for reading information from audio/video files MediaInfo is a utility used for retrieving technical information and other metadata about audio or video files. . A non-exhaustive list of the information MediaInfo can retrieve from media files include: - General: title, author, director, album, track number, date, duration... - Video: codec, aspect, fps, bitrate... - Audio: codec, sample rate, channels, language, bitrate... - Text: language of subtitle - Chapters: number of chapters, list of chapters . MediaInfo supports the following formats: - Video: MKV, OGM, AVI, DivX, WMV, QuickTime, Real, MPEG-1, MPEG-2, MPEG-4, DVD (VOB)... - Video Codecs: DivX, XviD, MSMPEG4, ASP, H.264, AVC...) - Audio: OGG, MP3, WAV, RA, AC3, DTS, AAC, M4A, AU, AIFF... - Subtitles: SRT, SSA, ASS, SAMI... MediaInfo supplies technical and tag information about a video or audio file . This package includes the command line interface. Homepage: http://mediainfo.sourceforge.net craig -- craig sanders <cas@taz.net.au> BOFH excuse #71: The file system is full of it

Russell Coker writes:
Currently I use [mplayer] which is ugly but works, unfortunately it flashes up an X window and probably doesn't work if you aren't using X.
Others answered the real question, but re that immediate issue, there is -vo null -ao null. Handy when "watching" youtube where the video mux is just some guy standing in front of a camera.
participants (6)
-
Con Tassios
-
Craig Sanders
-
hannah commodore
-
Jason White
-
Russell Coker
-
trentbuck@gmail.com