module to get video file dimensions

Reply

Join Date: May 2005
Posts: 215
Reputation: shanenin is an unknown quantity at this point 
Solved Threads: 16
shanenin shanenin is offline Offline
Posting Whiz in Training

module to get video file dimensions

 
0
  #1
Jul 31st, 2005
Is their a python module that can get the dimensions of a video file?
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 3,959
Reputation: vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice 
Solved Threads: 917
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
DaniWeb's Hypocrite

Re: module to get video file dimensions

 
0
  #2
Aug 1st, 2005
What video file format are you talking about?
May 'the Google' be with you!
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 215
Reputation: shanenin is an unknown quantity at this point 
Solved Threads: 16
shanenin shanenin is offline Offline
Posting Whiz in Training

Re: module to get video file dimensions

 
0
  #3
Aug 1st, 2005
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
  1. shane@mainbox shane $ avitype movies/collateral2/collateral.avi | grep WxH
  2. InitialFrames=0 Streams=2 SuggestedBufferSize=0 WxH=650x366
I am specifiacally looking for this data 650,366
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 215
Reputation: shanenin is an unknown quantity at this point 
Solved Threads: 16
shanenin shanenin is offline Offline
Posting Whiz in Training

Re: module to get video file dimensions

 
0
  #4
Aug 1st, 2005
using the linux program avitype, I have written this function. It still would be nice to find an all python way of doing it
  1. # this python function gets the dimensions of a video file and returns them as a tuple (width,height)
  2. # it uses the linux video program avitype (I think this is part of the transcode package)
  3.  
  4. # getdimensions.py
  5.  
  6. def getdimensions(video_file):
  7.  
  8. import commands
  9. avitype_command= "/usr/bin/avitype %s | grep WxH" % video_file
  10. dimensions = commands.getoutput(avitype_command)
  11. width = dimensions[-7:-4]
  12. height = dimensions[-3:]
  13. WxH = (width,height)
  14. return WxH
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 3,959
Reputation: vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice 
Solved Threads: 917
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
DaniWeb's Hypocrite

Re: module to get video file dimensions

 
0
  #5
Aug 5th, 2005
I have never managed to get my hands on a linux box, this sounds interesting. I have done some work with the Windows avi player in my C++ days mostly through shared COM.
May 'the Google' be with you!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC