Python module for making Quicktime or mpeg movies from images

J

jeremito

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
 
D

Diez B. Roggisch

jeremito said:
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
 
D

Daniel Fetchinson

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).
 
J

jeremito

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
 
H

has

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
 
D

Diez B. Roggisch

- 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
 
H

Hyuga

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.
 
J

jeremito

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
 
H

has

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.

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top