pipelne.get_clock() returns None

Stuart Axon stuaxo2 at yahoo.com
Tue Sep 13 16:42:06 UTC 2016


Hi all,   I'm using gstreamer 1.0 on python + having a go at getting network time working.

The code below is what I use to build the pipeline + play a video, the only thing I can think is that I need to manually set the clock, but all the examples on the net seem to grab it from the pipeline -


#!/usr/bin/python
 
# gst-launch-1.0 filesrc location=3.mp4 ! decodebin ! glimagesink
FILENAME="1.mp4"

import gi

gi.require_version('Gst', '1.0')
from gi.repository import GObject, Gst, GLib

Gst.init()
mainloop = GLib.MainLoop()

src = Gst.ElementFactory.make('filesrc', None)
src.set_property("location", FILENAME)

decode = Gst.ElementFactory.make('decodebin', 'decode')
sink = Gst.ElementFactory.make('glimagesink', None)

def decode_src_created(element, pad):
    pad.link(sink.get_static_pad('sink'))
    
decode.connect('pad-added', decode_src_created)

pipeline = Gst.Pipeline()
pipeline.add(src)
pipeline.add(decode)
pipeline.add(sink)

src.link(decode)

def quit():
    print("quit")
    pipeline.set_state(Gst.State.READY)
    mainloop.quit()

GLib.timeout_add_seconds(5, quit)

print("clock: ", pipeline.get_clock())

print("play")
pipeline.set_state(Gst.State.PLAYING)

print("start mainloop")
mainloop.run()
print("bye !")


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160913/e95db32a/attachment.html>


More information about the gstreamer-devel mailing list