| | |
module to get video file dimensions
![]() |
•
•
Join Date: May 2005
Posts: 215
Reputation:
Solved Threads: 16
mainly mpeg4, this can vary from divx, to xvid, and other mpeg4 formats. I want a simple program to help he write a config file that is passed to mplayer(avi player). To have the config file automatically written, I need the original WxH. I have found a program that runs on linux that would work, but would still be insterested in using a python module
this is the linux command line program called avitype
I am specifiacally looking for this data 650,366
this is the linux command line program called avitype
Python Syntax (Toggle Plain Text)
shane@mainbox shane $ avitype movies/collateral2/collateral.avi | grep WxH InitialFrames=0 Streams=2 SuggestedBufferSize=0 WxH=650x366
•
•
Join Date: May 2005
Posts: 215
Reputation:
Solved Threads: 16
using the linux program avitype, I have written this function. It still would be nice to find an all python way of doing it
Python Syntax (Toggle Plain Text)
# this python function gets the dimensions of a video file and returns them as a tuple (width,height) # it uses the linux video program avitype (I think this is part of the transcode package) # getdimensions.py def getdimensions(video_file): import commands avitype_command= "/usr/bin/avitype %s | grep WxH" % video_file dimensions = commands.getoutput(avitype_command) width = dimensions[-7:-4] height = dimensions[-3:] WxH = (width,height) return WxH
![]() |
Similar Threads
- Convert .wmv video to a file that imovie can recognize? (OS X)
- Get video file total time of playing using php (PHP)
- Problem with video file timing (Windows Software)
- Unable to execute a video file in browser using Java (Java)
Other Threads in the Python Forum
- Previous Thread: class based on Tk() . example
- Next Thread: Processing two Lists (Python)
| Thread Tools | Search this Thread |
accessdenied advanced aliased argv beginner bits calling casino change changecolor clear command convert corners count csv cturtle cursor def definedlines dictionary digital dynamic dynamically enter event events external file float format frange function google homework i/o iframe import input jaunty java keyboard lapse line linux list lists loop matching microphone mouse multiple newb number numbers obexftp output parameters parsing path port prime programming projects py py2exe pygame pyopengl python random rational raw_input recursion return scrolledtext signal simple singleton skinning sprite string strings tails text threading time tlapse tuple tutorial ubuntu unicode urllib urllib2 valueerror variable voip web-scrape whileloop word wxpython






