def main(): gobject.threads_init() gtk.gdk.threads_init() parser = argparse.ArgumentParser(description='Plays audio/video stream.', add_help=False) parser.add_argument('--player-help', action="help", help="show this help message and exit") parser.add_argument('-l', '--live', action="store_true", help='play in live mode') parser.add_argument('URI', help='URI of the video stream') cmd_args = parser.parse_args() # name = player.get_latest_version(cmd_args.URI) if name is None: print "No content found at %s" % cmd_args.URI return 1 name = name w = player_gui.PlayerWindow(GstPlayer, cmd_args) w.load_file(str(name)) w.show_all() gtk.main() return 0
def main(args): gobject.threads_init() if len(args) < 2: usage(args[0]) return 1 name = player.get_latest_version(args[1]) if name is None: print "No content found at %s" % args[1] return 1 # build pipelines for both realtime progress logging & ascii view PROG = "VideoSrc location=%s/video ! progressreport ! fakesink sync=true" % name ASCII = "VideoSrc location=%s/video ! ffdec_h264 ! aasink" % name if len(args) == 3 and args[2] == "ascii": args = ASCII else: args = PROG pipeline = gst.parse_launch(args) loop = gobject.MainLoop() pipeline.set_state(gst.STATE_PLAYING) try: loop.run() except KeyboardInterrupt: print "Ctrl+C pressed, exitting" pass pipeline.set_state(gst.STATE_NULL) pipeline.get_state(gst.CLOCK_TIME_NONE)
def main(): gobject.threads_init() gtk.gdk.threads_init() parser = argparse.ArgumentParser(description = 'Plays audio/video stream.', add_help = False) parser.add_argument('--player-help', action="help", help = "show this help message and exit") parser.add_argument('-l', '--live', action="store_true", help = 'play in live mode') parser.add_argument('URI', help = 'URI of the video stream') cmd_args = parser.parse_args() # name = player.get_latest_version(cmd_args.URI) if name is None: print "No content found at %s" % cmd_args.URI return 1 w = player_gui.PlayerWindow(GstPlayer, cmd_args) w.load_file(str(name)) w.show_all() gtk.main() return 0
def main(): gobject.threads_init() gtk.gdk.threads_init() parser = argparse.ArgumentParser(description='Plays audio/video stream.', add_help=False) parser.add_argument('--player-help', action="help", help="show this help message and exit") parser.add_argument('-l', '--live', action="store_true", help='play in live mode') parser.add_argument('-d', '--disable-buffering', action="store_false", help='disable buffering') parser.add_argument('-t', '--max-time', default=500, type=float, help='maximum buffer time for multiqueue (in ms)') parser.add_argument( '-p', '--publisher-id', help='fetch data only from specific publisher (in base64)') parser.add_argument( '-r', '--retry-count', type=int, help='how many times retransmit an interest before giving up') parser.add_argument( '-v', '--video-pipeline-size', type=int, help='Maximum number of pending interests for video stream') parser.add_argument( '-a', '--audio-pipeline-size', type=int, help='Maximum number of pending interests for audio stream') parser.add_argument('URI', help='URI of the video stream') cmd_args = parser.parse_args() publisher_id = base64.b64decode( cmd_args.publisher_id) if cmd_args.publisher_id else None name, publisher_id = player.get_latest_version(cmd_args.URI, publisher_id) if name is None: print "No content found at %s" % cmd_args.URI return 1 print("Fetching data from publisher: %s" % base64.b64encode(publisher_id)) w = player_gui.PlayerWindow(GstPlayer, cmd_args) w.load_file(str(name), publisher_id) w.show_all() gtk.main() return 0