468,284 Members | 1,515 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,284 developers. It's quick & easy.

tkinter to mpeg

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

Oct 2 '06 #1
3 1976
On Mon, 02 Oct 2006 09:18:13 -0700, "dug" <mm***@yahoo.co.uklet this
slip:
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.

--
Thomas Jollans alias free-zombie
Oct 2 '06 #2
In article <ef*************@news.t-online.com>,
Thomas Jollans <no****@jollans.comwrote:
>On Mon, 02 Oct 2006 09:18:13 -0700, "dug" <mm***@yahoo.co.uklet this
slip:
>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.
Oct 2 '06 #3
cl****@lairds.us (Cameron Laird) writes:

In article <ef*************@news.t-online.com>,
Thomas Jollans <no****@jollans.comwrote:
>>On Mon, 02 Oct 2006 09:18:13 -0700, "dug" <mm***@yahoo.co.uklet this
slip:
>>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.
.
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/Coo.../Recipe/325823

--
Alexander Schliep sc*****@molgen.mpg.de
http://algorithmics.molgen.mpg.de
Oct 4 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Average_Joe | last post: by
2 posts views Thread by Lane LiaBraaten | last post: by
3 posts views Thread by Mickel Grönroos | last post: by
3 posts views Thread by Vroem | last post: by
reply views Thread by Joe | last post: by
7 posts views Thread by Kilian A. Foth | last post: by
reply views Thread by seb | last post: by
reply views Thread by NPC403 | last post: by
2 posts views Thread by MrBee | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.