Windows AVIFile problems

Discussion in 'Python' started by c d saunter, Jan 25, 2008.

  1. c d saunter

    c d saunter Guest

    Hi All,

    I'm trying to access individual video frames of an AVI file from within
    Python 2.4 or 2.5 under Windows XP.

    I have found this example code here for that does exactly what I want,
    using the windows avifile.dll but I am unable to find the AVIFile.h
    header...

    http://mail.python.org/pipermail/image-sig/2002-February/001748.html

    An alternative is to call into avifile.dll dynamically using ctypes,
    however under both Python 2.4 and 2.5 the following error happens:

    >>> from ctypes import *
    >>> windll.AVIFile


    Traceback (most recent call last):
    File "<pyshell#2>", line 1, in <module>
    windll.AVIFile
    File "C:\Python25\lib\ctypes\__init__.py", line 415, in __getattr__
    dll = self._dlltype(name)
    File "C:\Python25\lib\ctypes\__init__.py", line 340, in __init__
    self._handle = _dlopen(self._name, mode)
    WindowsError: [Error 193] %1 is not a valid Win32 application

    or

    WinDLL('c:/windows/system/AVIFILE.DLL') # same for .../system32/AVI...
    Traceback (most recent call last):
    File "<pyshell#2>", line 1, in <module>
    windll.AVIFile
    File "C:\Python25\lib\ctypes\__init__.py", line 415, in __getattr__
    dll = self._dlltype(name)
    File "C:\Python25\lib\ctypes\__init__.py", line 340, in __init__
    self._handle = _dlopen(self._name, mode)
    WindowsError: [Error 193] %1 is not a valid Win32 application

    This suggests that the dll is corrupt? However if I download
    and run the exe's from this example of a VB program calling
    the DLL, they work:
    http://www.shrinkwrapvb.com/avihelp/avihelp.htm

    I'm open to suggestions about the specific problems above
    or other ways of getting at the frames. I've tried pymedia
    but it also has issues.

    Regards
    Chris Saunter
     
    c d saunter, Jan 25, 2008
    #1
    1. Advertising

  2. c d saunter schrieb:
    > Hi All,
    >
    > I'm trying to access individual video frames of an AVI file from within
    > Python 2.4 or 2.5 under Windows XP.
    >
    > I have found this example code here for that does exactly what I want,
    > using the windows avifile.dll but I am unable to find the AVIFile.h
    > header...
    >
    > http://mail.python.org/pipermail/image-sig/2002-February/001748.html
    >
    > An alternative is to call into avifile.dll dynamically using ctypes,
    > however under both Python 2.4 and 2.5 the following error happens:
    >
    >>>> from ctypes import *
    >>>> windll.AVIFile

    >
    > Traceback (most recent call last):
    > File "<pyshell#2>", line 1, in <module>
    > windll.AVIFile
    > File "C:\Python25\lib\ctypes\__init__.py", line 415, in __getattr__
    > dll = self._dlltype(name)
    > File "C:\Python25\lib\ctypes\__init__.py", line 340, in __init__
    > self._handle = _dlopen(self._name, mode)
    > WindowsError: [Error 193] %1 is not a valid Win32 application
    >


    The dll is not corrupt. It is the 16-bit dll, possibly present for legacy
    16-bit support.

    You must use the 32-bit dll, it seems it called avifil32.dll.

    Also I guess to get the AVIFILE.H header file, you need to install some
    MS SDK or the platform sdk.

    Thomas
     
    Thomas Heller, Jan 25, 2008
    #2
    1. Advertising

  3. c d saunter

    Tim Golden Guest

    c d saunter wrote:
    > I'm trying to access individual video frames of an AVI file from within
    > Python 2.4 or 2.5 under Windows XP.


    I thought that the recently-at-1.0 pyglet did that, only I can't
    now see it in their docs anywhere. Might be worth asking over
    there anyway [1] since it certainly comes close, is a much easier
    way of dealing with video images, and seems to have an active
    community.

    TJG

    [1] http://www.pyglet.org/
     
    Tim Golden, Jan 25, 2008
    #3
  4. c d saunter

    c d saunter Guest

    Thomas Heller () wrote:
    : c d saunter schrieb:
    : > Hi All,
    : >

    : The dll is not corrupt. It is the 16-bit dll, possibly present for legacy
    : 16-bit support.

    Thomas,
    Thanks, that explains a lot.

    Regards,
    Chris Saunter
     
    c d saunter, Jan 25, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sergio
    Replies:
    1
    Views:
    595
    Sergio
    Mar 7, 2005
  2. pataN
    Replies:
    1
    Views:
    297
    Dino Chiesa [MSFT]
    Aug 22, 2003
  3. Susan Baker
    Replies:
    2
    Views:
    826
    kelvSYC
    Jun 26, 2005
  4. Shelly

    Problems, problems for newbie

    Shelly, Sep 2, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    2,212
    Shelly
    Sep 3, 2007
  5. Sak Na rede
    Replies:
    0
    Views:
    429
    Sak Na rede
    Jan 30, 2009
Loading...

Share This Page