appsink in gstreamer1.0 python

troywang troywang123 at
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 =
    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')

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)


View this message in context:
Sent from the GStreamer-devel mailing list archive at

More information about the gstreamer-devel mailing list