#!/usr/bin/python import time import sys import pygst pygst.require("0.10") import gst import gobject #gst.init() loop = gobject.MainLoop() def on_message(bus, message): t = message.type if t == gst.MESSAGE_EOS: print 'EOS' loop.quit() elif t == gst.MESSAGE_ERROR: err, debug = message.parse_error() print "Error: %s" % err, debug loop.quit() camerabin = gst.element_factory_make('camerabin2', None) wrappersrc = gst.element_factory_make ('wrappercamerabinsrc') videotestsrc = gst.element_factory_make('videotestsrc') videotestsrc.set_property('is-live', True) wrappersrc.set_property('video-source', videotestsrc) camerabin.set_property('camera-source', wrappersrc) res = camerabin.set_state(gst.STATE_PLAYING) if res == gst.STATE_CHANGE_FAILURE: print 'Failed to go playing' sys.exit(1) loop.run() camerabin.set_state(gst.STATE_NULL)