Dear all,<br>I'm starting out with Gstreamer in Python, and I've been playing with some code I found on a website, trying to get a picture from my webcam to be saved as a PNG in /dev/shm. It's working, but I would like to have regular updates of the image, such as 12 frames per second or something. However, my code is only producing a single image, and then doesn't do much:<br>
<br><br># Set up the gstreamer pipeline<br> self.player = gst.parse_launch ("v4l2src device="+devname+<br> " ! video/x-raw-yuv,width=320,height=240 ! ffmpegcolorspace ! pngenc ! filesink location=/dev/shm/test.png")<br>
<br># ffmpegcolorspace ! pngenc ! filesink location=/dev/shm/test.png")<br><br># old sink was: autovideosink")<br><br> bus = self.player.get_bus()<br> bus.add_signal_watch()<br> bus.enable_sync_message_emission()<br>
bus.connect("sync-message::element", self.on_sync_message)<br> self.player.set_state(gst.STATE_PLAYING)<br><br> def on_sync_message(self, bus, message):<br> if message.structure is None:<br>
return<br> message_name = message.structure.get_name()<br> if message_name == "prepare-xwindow-id":<br> # Assign the viewport<br> imagesink = message.src<br> imagesink.set_property("force-aspect-ratio", True)<br>
imagesink.set_xwindow_id(self.movie_window.window.xid)<br><br>Please note it still has some remnants of the code that overlayed the image in a GTK window. Any ideas how I can make it update the png regularly please? <br>
<br>Thanks,<br><br>Nawal<br><br clear="all"><br>-- <br>The best way to predict the future is to invent it. - Alan Kay<br><a href="http://www.galileon.co.uk/">http://www.galileon.co.uk/</a><br>