LinHES Forums
http://forums.linhes.org/

Unix command to query resolution of an mpeg2 file
http://forums.linhes.org/viewtopic.php?f=5&t=9659
Page 1 of 1

Author:  marc.aronson [ Sun Apr 16, 2006 10:53 pm ]
Post subject:  Unix command to query resolution of an mpeg2 file

I'm looking for a command that will return the resolution of the mpeg2 video stream embedded in a ".nuv" file. I want to use this in a script, so I need something that isn't GUI-based. Any pointers you can provided would be appreciated -- thanks!

Marc

Author:  mac [ Mon Apr 17, 2006 12:36 am ]
Post subject: 

mplayer -identify <some nuv> 2>/dev/null | grep VIDEO:

Author:  Greg Frost [ Mon Apr 17, 2006 12:47 am ]
Post subject: 

You could try something like (unset DISPLAY ; mplayer -identify filename). This will display the info about the file, but when it tries to display it, it will error out because of no display. Just be careful that it is never used on an audio only file because mplayer will happily play an audio file without a valid display.

There may be some way to have it barf when trying to play an audio file to. Look at the man page.

Author:  marc.aronson [ Mon Apr 17, 2006 8:03 am ]
Post subject: 

Mac, you approach worked perfectly, thanks!

Author:  marc.aronson [ Mon Apr 17, 2006 11:10 pm ]
Post subject: 

Greg, I also needed to apply your suggestion of "unset DISPLAY" to prevent mplayer from attempting to play the video. Thanks!

Marc

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/