Hi All, Sebastian - thank you so much for pointing me in the right direction with this earlier. It was very helpful in allowing me to progress with this and I have finally had a chance to put some code together. I have written an RTSP server in Python trying to re-implement the code that was in test-netclock.c / test-netclock-client.c, however I have a few problems with synchronisation. I must be close. My server is configured with a pipeline as follows: My launch string for the factory on the server is as follows: udpsrc uri=udp://127.0.0.1:6001 caps="application/x-rtp, media=(string)audio, clock-rate=(int)44100, channels=(int)2, format=(string)S16LE" ! rtpL16depay ! audioconvert ! audioresample ! opusenc bitrate=96000 inband-fec=1 ! rtpopuspay name=pay0 It captures raw audio through RTP on port 6001 and converts it to OPUS. which will be sent out to the clients (which should all play out in sync). For this factory, I'm also setting: factory.set_shared(True) Where clock is a time provider that I want to run from the server and use that to sync the clients: clock = Gst.SystemClock.obtain() clock_provider = GstNet.NetTimeProvider.new(clock, None, 8555) On my clients, where I have sync=true on my alsaaudiosink, I get about 2 seconds of audio followed by silence and a lot of this: audiobasesink gstaudiobasesink.c:1807:gst_audio_base_sink_get_alignment:<autoaudiosink0-actual-sink-alsa> Unexpected discontinuity in audio timestamps of +1012391:15:11.969041666, resyncing audiobasesink gstaudiobasesink.c:1512:gst_audio_base_sink_skew_slaving:<autoaudiosink0-actual-sink-alsa> correct clock skew -0:00:00.020016938 < -+0:00:00.020000000 The client comprises the following pipeline (location is the server and buffer is usually configured as 1000 or 5000)
My client contains the following: self.pipeline = Gst.parse_launch('rtspsrc location=%s latency=%s buffer-mode=synced ntp-time-source=clock-time ntp-sync=1 do-rtcp=true ! rtpopusdepay name=pay0 ! opusdec ! audioconvert ! autoaudiosink sync=true async=false' % (src, latency)) # make a clock slaving to the network # Wait for initial clock sync self.pipeline.use_clock(self.clock) self.pipeline.set_state(Gst.State.PLAYING) # Wait until error or EOS. The intention for this set up is to: This configuration plays audio fine if I change "sync=false" on the audio sink, but this also breaks synchronisation. Any pointers as to what I've done wrong? I'm currently running GStreamer out of git. Kind Regards, Jonathan Message: 5 _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Doh! Looks like I might have missed this:
In my factory subclass: self.set_media_gtype(MyRTSPMediaType) Which should reference: class MyRTSPMediaType(GstRtspServer.RTSPMedia): def do_setup_rtpbin(self, rtpbin): rtpbin.set_property('ntp-time-source', 'clock-time') return(rtpbin) And suddenly my timestamp issues seem to go away :) On 29 May 2016 at 23:07, Jonathan Thorpe <[hidden email]> wrote:
_______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
On Mo, 2016-05-30 at 19:08 +1000, Jonathan Thorpe wrote:
> Doh! Looks like I might have missed this: > > In my factory subclass: > self.set_media_gtype(MyRTSPMediaType) > > Which should reference: > > class MyRTSPMediaType(GstRtspServer.RTSPMedia): > def do_setup_rtpbin(self, rtpbin): > rtpbin.set_property('ntp-time-source', 'clock-time') > return(rtpbin) > > And suddenly my timestamp issues seem to go away :) Is the synchronization also working accurate enough for you? -- Sebastian Dröge, Centricular Ltd · http://www.centricular.com _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel signature.asc (968 bytes) Download Attachment |
Hi Sebastian,
Not testing it too scientifically, it appears to be performing well. Using the NetClock seems to be more than sufficient - the next step was to look at P2P, but I'll see how I go with this for the moment. Kind Regards, Jonathan > And suddenly my timestamp issues seem to go away :) Good to hear that it works for you now :) Is the synchronization also working accurate enough for you? -- Sebastian Dröge, Centricular Ltd · http://www.centricular.com _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel signature.asc (968 bytes) <http://gstreamer-devel.966125.n4.nabble.com/attachment/4677803/0/signature.asc> |
Free forum by Nabble | Edit this page |