[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] pystreamer in pygame? NEW USER: CORRECTION GSTREAMER



Ian Mallett wrote:
On 3/7/08, Darren Enns <darethehair@xxxxxxxxx> wrote:
 My hope/assumption is that some of you in the PyGame community would
 have used 'gstreamer' in your apps, to display videos/movie clips, etc.
Not I, but perhaps someone else...
What sort of movies?
You mention doing this in 10 lines of code not with PyGame.
Here is a very small example that (I think) is running 'gstreamer' in Python to easily play a video:

import pygst
pygst.require('0.10')
import gst
import gobject, sys

def play_uri(uri):
       player = gst.element_factory_make("playbin", "player")

       print 'Playing:', uri
       player.set_property('uri', uri)
       player.set_state(gst.STATE_PLAYING)


play_uri("file:////mnt/sda3/dl/python/dare/test.mpg")
import gtk; gtk.main()

In this case, the 'movie' is a simple 'mpeg' file.

Thanks

Dare