RTSP url can't display stream, even when mainloop is running.

hhony hanshony at gmail.com
Thu Mar 1 23:26:10 UTC 2018


Sounds like you're asking about threading issues rather than gstreamer. Might
be different, but a thread is_running would be valid for the scope of the
thread.. when it falls out of scope it would not be True anymore. I can't
say for sure if that's your issue.. as I don't entirely understand how
you're overridding 'run()'.. unless you're using Python 'def' to redefine it
somehow..

As far as I can tell GStreamer requires a mainloop instance to be running
before you use your pipeline. What I've done in the past is create a
MainLoop object, and then use threading.Thread.start to start a thread
around MainLoop.run function, prior to starting the pipeline.

Basic example of what I'm describing:

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

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

loop_thread = Thread(target=mainloop.run, args=())
loop_thread.start()

.. do your pipeline stuff here while mainloop is running.. 

loop_thread.stop()
exit()



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list