Python module for making Quicktime or mpeg movies from images

Discussion in 'Python' started by jeremito, Oct 11, 2007.

  1. jeremito

    jeremito Guest

    My Python script makes a bunch of images that I want to use as frames
    in a movie. I've tried searching for a module that will take these
    images and put them together in a Quicktime or mpeg movie, but haven't
    found anything. My images are currently pdfs, but I could make them
    into just about anything if needed.

    Is there a module, or example of how to do this?
    Thanks,
    Jeremy
    jeremito, Oct 11, 2007
    #1
    1. Advertising

  2. jeremito wrote:

    > My Python script makes a bunch of images that I want to use as frames
    > in a movie. I've tried searching for a module that will take these
    > images and put them together in a Quicktime or mpeg movie, but haven't
    > found anything. My images are currently pdfs, but I could make them
    > into just about anything if needed.
    >
    > Is there a module, or example of how to do this?


    http://pymedia.org/

    Diez
    Diez B. Roggisch, Oct 11, 2007
    #2
    1. Advertising

  3. jeremito

    jeremito Guest

    On Oct 11, 10:43 am, "Diez B. Roggisch" <> wrote:
    > jeremito wrote:
    > > My Python script makes a bunch of images that I want to use as frames
    > > in a movie. I've tried searching for a module that will take these
    > > images and put them together in a Quicktime or mpeg movie, but haven't
    > > found anything. My images are currently pdfs, but I could make them
    > > into just about anything if needed.

    >
    > > Is there a module, or example of how to do this?

    >
    > http://pymedia.org/
    >
    > Diez


    That initially looked promising, but it looks like nobody is working
    on it anymore and it doesn't compile on Mac. (I should have mentioned
    I am using a Mac.) Any other suggestions?

    Thanks,
    Jeremy
    jeremito, Oct 11, 2007
    #3
  4. jeremito

    Tim Golden Guest

    jeremito wrote:
    > On Oct 11, 10:43 am, "Diez B. Roggisch" <> wrote:
    >> jeremito wrote:
    >>> My Python script makes a bunch of images that I want to use as frames
    >>> in a movie. I've tried searching for a module that will take these
    >>> images and put them together in a Quicktime or mpeg movie, but haven't
    >>> found anything. My images are currently pdfs, but I could make them
    >>> into just about anything if needed.
    >>> Is there a module, or example of how to do this?

    >> http://pymedia.org/
    >>
    >> Diez

    >
    > That initially looked promising, but it looks like nobody is working
    > on it anymore and it doesn't compile on Mac. (I should have mentioned
    > I am using a Mac.) Any other suggestions?


    Not really a Python module but... run them
    through mencoder? (Haven't tried it but it
    seems to be saying it's possible).

    http://www.mplayerhq.hu/DOCS/man/en/mplayer.1.html#EXAMPLES OF MENCODER USAGE

    TJG
    Tim Golden, Oct 11, 2007
    #4
  5. jeremito

    TYR Guest

    On Oct 11, 4:17 pm, Tim Golden <> wrote:
    > jeremito wrote:
    > > On Oct 11, 10:43 am, "Diez B. Roggisch" <> wrote:
    > >> jeremito wrote:
    > >>> My Python script makes a bunch of images that I want to use as frames
    > >>> in a movie. I've tried searching for a module that will take these
    > >>> images and put them together in a Quicktime or mpeg movie, but haven't
    > >>> found anything. My images are currently pdfs, but I could make them
    > >>> into just about anything if needed.
    > >>> Is there a module, or example of how to do this?
    > >>http://pymedia.org/

    >
    > >> Diez

    >
    > > That initially looked promising, but it looks like nobody is working
    > > on it anymore and it doesn't compile on Mac. (I should have mentioned
    > > I am using a Mac.) Any other suggestions?

    >
    > Not really a Python module but... run them
    > through mencoder? (Haven't tried it but it
    > seems to be saying it's possible).
    >
    > http://www.mplayerhq.hu/DOCS/man/en/mplayer.1.html#EXAMPLES OF ME...
    >
    > TJG


    NodeBox; nodebox.org

    GUI application that creates either PDFs or Quicktime vids from python
    code. Unix/Linux/MacOS.
    TYR, Oct 12, 2007
    #5
  6. > My Python script makes a bunch of images that I want to use as frames
    > in a movie. I've tried searching for a module that will take these
    > images and put them together in a Quicktime or mpeg movie, but haven't
    > found anything. My images are currently pdfs, but I could make them
    > into just about anything if needed.
    >
    > Is there a module, or example of how to do this?
    > Thanks,
    > Jeremy


    If you'll be happy with a flash movie you can try ming: ming.sf.net
    which is a C library for creating flash files and there is a python
    binding for it (among other languages).
    Daniel Fetchinson, Oct 12, 2007
    #6
  7. jeremito

    jeremito Guest

    On Oct 12, 10:37 am, TYR <> wrote:
    > On Oct 11, 4:17 pm, Tim Golden <> wrote:
    >
    >
    >
    > > jeremito wrote:
    > > > On Oct 11, 10:43 am, "Diez B. Roggisch" <> wrote:
    > > >> jeremito wrote:
    > > >>> My Python script makes a bunch of images that I want to use as frames
    > > >>> in a movie. I've tried searching for a module that will take these
    > > >>> images and put them together in a Quicktime or mpeg movie, but haven't
    > > >>> found anything. My images are currently pdfs, but I could make them
    > > >>> into just about anything if needed.
    > > >>> Is there a module, or example of how to do this?
    > > >>http://pymedia.org/

    >
    > > >> Diez

    >
    > > > That initially looked promising, but it looks like nobody is working
    > > > on it anymore and it doesn't compile on Mac. (I should have mentioned
    > > > I am using a Mac.) Any other suggestions?

    >
    > > Not really a Python module but... run them
    > > through mencoder? (Haven't tried it but it
    > > seems to be saying it's possible).

    >
    > >http://www.mplayerhq.hu/DOCS/man/en/mplayer.1.html#EXAMPLES OF ME...

    >
    > > TJG

    >
    > NodeBox; nodebox.org
    >
    > GUI application that creates either PDFs or Quicktime vids from python
    > code. Unix/Linux/MacOS.


    I actually found NodeBox in my googling. This seems to be a stand
    alone application. I need to be able to convert my images to a movie
    from my code I wrote myself.

    Thanks,
    Jeremy
    jeremito, Oct 12, 2007
    #7
  8. jeremito

    has Guest

    On 12 Oct, 20:53, jeremito <> wrote:

    > I actually found NodeBox in my googling. This seems to be a stand
    > alone application. I need to be able to convert my images to a movie
    > from my code I wrote myself.


    Some Mac-specific options:

    - QuickTime Player is standard on OS X and its scripting interface
    (which you can access from Python via appscript, and is fully usable
    even in unpaid mode) includes an 'open image sequence' command. This
    would be the simplest solution as long as you don't mind launching
    another application to do the work.

    - The Cocoa API's QTKit class (accessible via PyObjC) includes a -
    addImage:forDuration:withAttributes: method that you could use to
    build up a movie yourself.

    - The Mac version of Python includes wrappers for a number of Carbon
    APIs, including QuickTime. One for brave souls only; QT's C APIs are
    notoriously complex, and I've no idea of the quality/reliability of
    the Carbon.Qt wrapper (most of Python's Carbon wrappers haven't been
    fully maintained since OS9 days).

    HTH

    has
    --
    http://appscript.sourceforge.net
    http://rb-appscript.rubyforge.org
    has, Oct 13, 2007
    #8
  9. >- The Mac version of Python includes wrappers for a number of Carbon
    > APIs, including QuickTime. One for brave souls only; QT's C APIs are
    > notoriously complex,


    AMEN. I tried to work with that stuff, and it was close to a totally
    failure & desaster...

    Diez
    Diez B. Roggisch, Oct 13, 2007
    #9
  10. jeremito

    Hyuga Guest

    On Oct 12, 3:53 pm, jeremito <> wrote:
    > > NodeBox; nodebox.org

    >
    > > GUI application that creates either PDFs or Quicktime vids from python
    > > code. Unix/Linux/MacOS.

    >
    > I actually found NodeBox in my googling. This seems to be a stand
    > alone application. I need to be able to convert my images to a movie
    > from my code I wrote myself.


    Why? Whether you're using a library or an external application, it's
    not code that you wrote yourself. There's shouldn't be any reason you
    couldn't call an application like mencoder from your program. Either
    way you're certainly not going to find anything written in pure Python
    for encoding video.
    Hyuga, Oct 15, 2007
    #10
  11. jeremito

    jeremito Guest

    On Oct 13, 5:30 am, has <> wrote:
    > On 12 Oct, 20:53, jeremito <> wrote:
    >
    > > I actually found NodeBox in my googling. This seems to be a stand
    > > alone application. I need to be able to convert my images to a movie
    > > from my code I wrote myself.

    >
    > Some Mac-specific options:
    >
    > -QuickTimePlayer is standard on OS X and its scripting interface
    > (which you can access from Python via appscript, and is fully usable
    > even in unpaid mode) includes an 'open image sequence' command. This
    > would be the simplest solution as long as you don't mind launching
    > another application to do the work.


    I have used this, but I want to automate this so I wanted something I
    could call from my Python script.
    >
    > - The Cocoa API's QTKit class (accessible via PyObjC) includes a -
    > addImage:forDuration:withAttributes: method that you could use to
    > build up a movie yourself.
    >


    This sounds like a good option. I have downloaded and installed
    PyObjC and am currently looking for the QTKit class but have been
    unsuccessful so far. A cursory glance at the documentation hasn't
    produced any help, yet. I'll keep looking unless you can point to it
    directly.

    Thanks again,
    Jeremy
    jeremito, Oct 16, 2007
    #11
  12. jeremito

    has Guest

    On 16 Oct, 00:55, jeremito <> wrote:
    >
    > > -QuickTimePlayer is standard on OS X and its scripting interface
    > > (which you can access from Python via appscript, and is fully usable
    > > even in unpaid mode) includes an 'open image sequence' command.

    >
    > I have used this, but I want to automate this so I wanted something I
    > could call from my Python script.


    That's the idea. e.g. Something like:

    from appscript import *
    from mactypes import *

    mov = app ('Quicktime Player.app').open_image_sequence(Alias('/path/to/
    image-1.jpg'), frames_per_second=5)
    mov.export(to=File('/path/to/output.mov'), as_=k.QuickTime_movie,
    timeout=0)
    mov.close(saving=k.no)

    The only downside of this approach is that if you're making, say, a
    highly polished shrinkwrapped product, having it launch external
    applications to do some of the work might not create quite the
    impression you want with users.


    > > - The Cocoa API's QTKit class (accessible via PyObjC) includes a -
    > > addImage:forDuration:withAttributes: method that you could use to
    > > build up a movie yourself.

    >
    > This sounds like a good option. I have downloaded and installed
    > PyObjC and am currently looking for the QTKit class but have been
    > unsuccessful so far. A cursory glance at the documentation hasn't
    > produced any help, yet. I'll keep looking unless you can point to it
    > directly.


    import QTKit

    will import the PyObjC wrapper for the QTKit framework. See PyObjC's
    documentation for general usage information Apple's Cocoa
    documentation for further information on QTKit itself, e.g.:

    http://developer.apple.com/quicktime/qtkit.html

    HTH

    has
    --
    http://appscript.sourceforge.net
    http://rb-appscript.rubyforge.org
    has, Oct 16, 2007
    #12
    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. EightNineThree
    Replies:
    3
    Views:
    398
    Whitecrest
    Aug 24, 2003
  2. nick
    Replies:
    5
    Views:
    4,467
    kayodeok
    Jan 11, 2004
  3. Eric Biller

    embedding quicktime-movies in html

    Eric Biller, Dec 31, 2004, in forum: HTML
    Replies:
    2
    Views:
    593
    Spartanicus
    Dec 31, 2004
  4. Axel Etzold
    Replies:
    4
    Views:
    94
  5. Creegan

    Playing Quicktime movies

    Creegan, Sep 25, 2003, in forum: Javascript
    Replies:
    1
    Views:
    141
    Randell D.
    Sep 26, 2003
Loading...

Share This Page