Video information

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dusans

    Video information

    Is there a py module, which would get me information of a movie file:
    - resolution
    - fps
  • Bill McClain

    #2
    Re: Video information

    On 2008-08-09, dusans <dusan.smitran@ gmail.comwrote:
    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.

    -Bill
    --
    Sattre Press In the Quarter
    http://sattre-press.com/ by Robert W. Chambers
    info@sattre-press.com http://sattre-press.com/itq.html

    Comment

    • Geoffrey Clements

      #3
      Re: Video information

      "Bill McClain" <20071214.20.wm cclain@spamgour met.comwrote in message
      news:g7l13401al i@news1.newsguy .com...
      On 2008-08-09, dusans <dusan.smitran@ gmail.comwrote:
      >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).co mmunicate()[0]

      or
      from subprocess import Popen, PIPE
      probe = Popen(("mplayer ", "-identify", "-frames", "0", "-ao", "null",
      ip_file), stdout=PIPE, stderr=PIPE).co mmunicate()[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


      Comment

      • Peter Otten

        #4
        Re: Video information

        dusans wrote:
        Is there a py module, which would get me information of a movie file:
        - resolution
        - fps


        (I haven't used it myself)

        Peter

        Comment

        Working...