All pastes #277726 Raw Edit

Someone

public python v1 · immutable
·published 2006-12-13 14:59 UTC
rendered paste body
#!/usr/bin/env pythonimport sysimport pygstpygst.require('0.10')import gstdef main(args):    _, uri, ip, port, base_time = args    port, base_time = int(port), int(base_time)    # make the pipeline    pipeline = gst.parse_launch('filesrc name=src ! decodebin ! ffmpegcolorspace ! videoscale ! ximagesink')    pipeline.get_by_name('src').set_property('location', uri)    # disable the pipeline's management of base_time -- we're going    # to set it ourselves.    pipeline.set_new_stream_time(gst.CLOCK_TIME_NONE)    # make a clock slaving to the network    clock = gst.NetClientClock(None, ip, port, base_time)    # use it in the pipeline    pipeline.set_base_time(base_time)    pipeline.use_clock(clock)    # now we go :)    pipeline.set_state(gst.STATE_PLAYING)    # wait until things stop    pipeline.get_bus().poll(gst.MESSAGE_EOS | gst.MESSAGE_ERROR, -1)    pipeline.set_state(gst.STATE_NULL)if __name__ == '__main__':    main(sys.argv)