appsink in gstreamer1.0 python

troywang troywang123 at gmail.com
Sat Feb 22 00:40:35 PST 2014


hi all:

I use appsink in gstreamer1.0(python) to  grab data from pipeline ,but I
cann't get the data ? the program is as follow ,what should I do?


def on_new_buffer(appsink):
    #Gst.MapInfo info
    buf = appsink.emit('pull-sample')
    print 'new buffer '
    info = Gst.Buffer.map(buf)
    return False  

def on_new_preroll(appsink):
    buf = appsink.emit('pull-preroll')
    print 'new preroll ',len(buf)
    return  False


pipeline = Gst.Pipeline()
src = Gst.ElementFactory.make('filesrc', 'src')
src.set_property("location","file")
pipeline.add(src)

appsink = Gst.ElementFactory.make('appsink', 'sink')
appsink.set_property('emit-signals', True)
# turns off sync to make decoding as fast as possible
appsink.set_property('sync', False)
appsink.connect('new-sample', on_new_buffer)
appsink.connect('new-preroll', on_new_preroll)
pipeline.add(appsink)
src.link(appsink)
pipeline.set_state(Gst.State.PLAYING)

GObject.MainLoop().run()




--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/appsink-in-gstreamer1-0-python-tp4665434.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list