"Bill McClain" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 2008-08-09, dusans <[EMAIL PROTECTED]> wrote:
>> Is there a py module, which would get me information of a movie file:
>> - resolution
>> - fps
>
> I don't know of one. I use the transcode utilities for this and parse
> their
> output.
>
Something like:
from subprocess import Popen, PIPE
probe = Popen(("tcprobe", "-i", ip_file), stdout=PIPE,
stderr=PIPE).communicate()[0]
or
from subprocess import Popen, PIPE
probe = Popen(("mplayer", "-identify", "-frames", "0", "-ao", "null",
ip_file), stdout=PIPE, stderr=PIPE).communicate()[0]
First one uses transcode the second one uses mplayer. I normally follow
these with a regexp search on "probe" for the data I want.
I have found mplayer to be more accurate than transcode which seems to have
a problem with some files notably MPEG program streams although it seems to
work fine for elementary streams.
--
Geoff
--
http://mail.python.org/mailman/listinfo/python-list