flarefox Posted September 4, 2009 Report Share Posted September 4, 2009 Hello! This is a little off topic since it is video related but not exactly mandriva only. I'm hoping someone here knows how to grab a frame size from an mpg video file. I'm writing a tcl script (It's the first language I learned and the one I'm most comfortable with) to try and simplify my life. I run mythtv, but mythtranscode doesn't work for my setup with the output I need. I run myth on my mandriva pc and my mac and need to rescale everything to 720p video if it is HD or leave it as is if it is SD and transcode to h264 for streaming to my other computers and TV. I have several shortcuts already to check for commercials, transcode if it is 720p video, or transcode if it is 1080i, but I don't know how to query whether the video is large and interlaced or not. Does anyone know a command I can run which will give me back the frame size? Something simple? Is there a command built-into tcl that I don't know about or some command-line utility to dump the size? I'm using ffmpeg for transcoding now. I can get it if I run ffmpeg -i infile.mpg but that gives me many many lines of data and is difficult to work with and doesn't always output the same. There's got to be a simpler way to get the file statistics... Does anyone know? Any help would be appreciated! Thank you! Quote Link to comment Share on other sites More sharing options...
Greg2 Posted September 4, 2009 Report Share Posted September 4, 2009 If you have mencoder installed, you can use midentify infile.mpg | egrep -i 'width|height' Is that what you need? Quote Link to comment Share on other sites More sharing options...
flarefox Posted September 4, 2009 Author Report Share Posted September 4, 2009 If you have mencoder installed, you can use midentify infile.mpg | egrep -i 'width|height' Is that what you need? Yes, that's perfect! Thank you! Quote Link to comment Share on other sites More sharing options...
Recommended Posts