[gst-devel] Signals in V4L

Lluis Pamies lluis at pamies.cat
Wed Sep 20 16:11:33 CEST 2006


In the above code, how can I capture the signal "frame-captured" in
v4lsrc to stop the main loop one I've one frame ?

Thanks !!

#!/usr/bin/env python

import sys
import gst
import gobject

gobject.threads_init()
loop = gobject.MainLoop()

def main(args):
    bin = gst.parse_launch('v4lsrc name=videosrc ! ' +
                           'jpegenc name=encoder ! ' +
                           'filesink name=output')

    videosrc = bin.get_by_name('videosrc')
    videosrc.set_property('device', '/dev/video0')
    output = bin.get_by_name('output')
    output.set_property('location', 'aa.jpg')


    bin.set_state(gst.STATE_PLAYING);
    try:
        loop.run()
    except KeyboardInterrupt:
        pass

    bin.set_state(gst.STATE_NULL)

if __name__ == '__main__':
    sys.exit(main(sys.argv))

-- 
Lluís Pàmies i Juarez


More information about the gstreamer-devel mailing list