proxysink/src timing/lag/stutter issue.
Chris Duncan
jcsduncan2011 at gmail.com
Thu May 24 14:56:15 UTC 2018
I may be implementing proxysink/src incorrectly but i am having issues. It
seems as though proxysrc is either queuing up buffers or there is a
timestamping issue. Any help would be greatly appreciated.
#!/usr/bin/python3
import gi
gi.require_version('Gst', '1.0')
gi.require_version('GstRtspServer', '1.0')
from gi.repository import Gst, GstRtspServer, GObject
class RTSP_Factory(GstRtspServer.RTSPMediaFactory):
def __init__(self, pipeline, clock):
self.clock=clock
self.pipeline = pipeline
GstRtspServer.RTSPMediaFactory.__init__(self)
def do_create_element(self, url):
self.pipeline.set_start_time(Gst.CLOCK_TIME_NONE)
return self.pipeline
def do_configure(self, media):
media.set_shared(True)
Gst.init()
GObject.threads_init()
loop = GObject.MainLoop()
Gst.debug_set_active(True)
Gst.debug_set_default_threshold(4)
mainpipeline = Gst.parse_launch("nvcamerasrc "
"! video/x-raw(memory:NVMM),
width=(int)2592, height=(int)1458, format=(string)I420,
framerate=(fraction)30/1 "
"! omxh264enc bitrate=4000000
profile=2 control-rate=2 insert-sps-pps=true insert-aud=true
insert-vui=true iframeinterval=20 "
"! video/x-h264,
stream-format=byte-stream, profile=(string)main "
"! tee ! proxysink name=psink")
rtsppipeline = Gst.parse_launch("proxysrc name=psrc is-live=true !
queue name=rq max-size-buffers=3 ! h264parse ! rtph264pay name=pay0
pt=96 config-interval=1")
sysclock = Gst.SystemClock.obtain()
psink = mainpipeline.get_by_name("psink")
psrc = rtsppipeline.get_by_name("psrc")
psrc.set_property("proxysink", psink)
mainpipeline.use_clock(sysclock)
rtsppipeline.use_clock(sysclock)
mainpipeline.set_base_time(0)
rtsppipeline.set_base_time(0)
#mainpipeline.set_start_time(Gst.CLOCK_TIME_NONE)
rtsppipeline.set_start_time(Gst.CLOCK_TIME_NONE)
server = GstRtspServer.RTSPServer()
mounts = server.get_mount_points()
factory = RTSP_Factory(rtsppipeline, sysclock)
mounts.add_factory("/test", factory)
server.attach(None)
mainpipeline.set_state(Gst.State.PLAYING)
loop.run()
Regards,
Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20180524/f80a40e2/attachment.html>
More information about the gstreamer-devel
mailing list