[gst-devel] python bindings for swfdec

F.Fix at westminster.ac.uk F.Fix at westminster.ac.uk
Wed Mar 10 00:06:26 CET 2004


Hello,
I've created Python bindings for libswfdec. Their written in SWIG and so it
should be easy to adapt them to other languages like Ruby or TCL. Here's an
example in Python:

import swfdec
import Image

w = 800
h = 600

f = open(filename)
d = f.read()
f.close()

dec = swfdec.SwfdecDecoder()
dec.addBits(d)
dec.setImageSize(w,h)
dec.parse()

while dec.parse() == swfdec.SWF_IMAGE:
	image = Image.fromstring("RGB", (w,h), dec.peekImage())
#	image.show()

On a related note is it somehow possible to reset the parser? So that I don't
have to constantly reload the file if I want to play an animation in an endless
loop.

Frederik Fix
-------------- next part --------------
A non-text attachment was scrubbed...
Name: configure.diff
Type: text/x-diff
Size: 2324 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20040310/e27d9dd5/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: python.tar.gz
Type: application/x-tgz
Size: 1180 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20040310/e27d9dd5/attachment.bin>


More information about the gstreamer-devel mailing list