tkinter to mpeg

D

dug

Hi,

I have a small program that moves some shapes around a tkinter canvas.
Is there any way to save the output in a movie file, maybe mpeg?

Thank you,

Douglas
 
T

Thomas Jollans

Hi,

I have a small program that moves some shapes around a tkinter canvas.
Is there any way to save the output in a movie file, maybe mpeg?

you can record any app with special programs designed for the job, such as
vnc2swf (which produces macromedia flash), vncrec (which produces a
special format readable by transcode) or istanbul (which produces
ogg/theora). I doubt Tk would have a special mechanism to do this.
 
C

Cameron Laird

you can record any app with special programs designed for the job, such as
vnc2swf (which produces macromedia flash), vncrec (which produces a
special format readable by transcode) or istanbul (which produces
ogg/theora). I doubt Tk would have a special mechanism to do this.
.
.
.
I've actually been thinking about implementing just such a special
mechanism. Let me know if there's sufficient interest.
 
A

Alexander Schliep

.
I've actually been thinking about implementing just such a special
mechanism. Let me know if there's sufficient interest.

I think it would be most helpful to have a general way to dump the contents
of a Tkinter canvas including animated elements to some sort of file.
However, I would think that mpeg will look pretty bad compared to SVG.
In fact, as SVG renders much prettier (anti-aliasing etc.) than Tkinter,
the exported file would look much better.

I actually started coding SVG output for Gato (http://gato.sf.net). Some
of the things I realized:
- SVG support is somewhat limited on *nix.
- The SMIL type animations are even less supported. One would have to
resort to javascript. There is SmilScript which implements a SMIL
subset for Firefox 2.0?
- Due to a bug in the SVG 1.1 specification multi-colored lines with
same color arrow-heads are difficult to draw. Supposedly, this will
be fixed in 1.2.
- The geometry works differently in SVG compared to Tk. Arrow heads
are stuck onto the end of a line for example.

It would be trivial to wrap the Tkinter canvas in an object which
records what function is called when. For the basic canvas
items mapping this to SVG is quite straightforward.

Alexander

PS: There is some python code to output SVG, which I didn't use since
I wanted to work on my applications abstraction level.
http://www2.sfk.nl/svg
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/325823
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top