Troubles with Rtpbin
Giacomo D
omagico.olo at gmail.com
Mon Oct 26 00:29:15 PDT 2015
*Hi,
I am trying to use Rtpbin to send audio+video via rtp using this link below
as an example:*
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/qt-gstreamer/html/examples_2voip_2main_8cpp-example.html
<http://gstreamer.freedesktop.org/data/doc/gstreamer/head/qt-gstreamer/html/examples_2voip_2main_8cpp-example.html>
*
On the sending side my pipeline is this:*
self.ClientPipeline = Gst.Pipeline()
self.rtpbin = Gst.ElementFactory.make('rtpbin', None)
self.ClientPipeline.add(self.rtpbin)
videosrc = Gst.parse_bin_from_description("videotestsrc is-live=true
! video/x-raw,width=320,height=240,framerate=15/1 ! x264enc tune=zerolatency
byte-stream=true bitrate=300 ! rtph264pay",True)
self.ClientPipeline.add(videosrc)
videosrc.link_pads("src",self.rtpbin, "send_rtp_sink_1")
self.udpsink = Gst.ElementFactory.make('udpsink', None)
self.udpsink.set_property("host", "127.0.0.1")
self.udpsink.set_property("port", 8554)
self.ClientPipeline.add(self.udpsink)
self.rtpbin.link_pads("send_rtp_src_1", self.udpsink,"sink")
# rtcp connection
self.rtcpudpsink = Gst.ElementFactory.make('udpsink', None)
self.rtcpudpsink.set_property("host", "127.0.0.1")
self.rtcpudpsink.set_property("port", 8554)
self.rtcpudpsink.set_property("sync", False)
self.rtcpudpsink.set_property("async", False)
self.ClientPipeline.add(self.rtcpudpsink)
self.rtpbin.link_pads("send_rtcp_src_1", self.rtcpudpsink,"sink")
audiosrc = Gst.parse_bin_from_description("autoaudiosrc ! queue !
audioconvert ! audiorate ! audio/x-raw,rate=8000 ! speexenc !
rtpspeexpay",True)
self.ClientPipeline.add(audiosrc)
audiosrc.link_pads('src',self.rtpbin, "send_rtp_sink_2")
self.udpsink = Gst.ElementFactory.make('udpsink', None)
self.udpsink.set_property("host", "127.0.0.1")
self.udpsink.set_property("port", 8554+10)
self.ClientPipeline.add(self.udpsink)
self.rtpbin.link_pads("send_rtp_src_2", self.udpsink, 'sink')
# rtcp connection
self.rtcpudpsink = Gst.ElementFactory.make('udpsink', None)
self.rtcpudpsink.set_property("host", "127.0.0.1")
self.rtcpudpsink.set_property("port", 8554+10)
self.rtcpudpsink.set_property("sync", False)
self.rtcpudpsink.set_property("async", False)
self.ClientPipeline.add(self.rtcpudpsink)
self.rtpbin.link_pads("send_rtcp_src_2", self.rtcpudpsink,"sink")
self.ClientPipeline.set_state(Gst.State.PLAYING)
*
And on the receiving side I have:*
def rtpbin_pad_added(self,obj, pad):
print("PAD ADDED")
pad_name = pad.get_name()
# //recv_rtp_src_1_* -> session 1 - video
if pad_name.startswith('recv_rtp_src_1'):
bin = Gst.parse_bin_from_description("rtph264depay
name=rtph264depay ! avdec_h264 ! videoconvert ! autovideosink ",True)
print("Video stream is coming")
# //recv_rtp_src_2_* -> session 2 - audio
else:
bin = Gst.parse_bin_from_description("rtpspeexdepay
name=rtpspeexdepay ! speexdec ! audioconvert ! autoaudiosink",True)
print("audio stream is coming")
self.pipeline.add(bin)
bin.sync_state_with_parent()
pad.link(bin.get_static_pad("sink"))
*...*
#rtp VIDEO parts elements
self.udpsrc_rtpin_video = Gst.ElementFactory.make('udpsrc',
'udpsrc_rtpin_video')
self.udpsrc_rtpin_video.set_property('port',8554)
self.udpsrc_caps_video =
Gst.caps_from_string('application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264')
self.udpsrc_rtpin_video.set_property('caps',
self.udpsrc_caps_video)
self.pipeline.add(self.udpsrc_rtpin_video)
self.udpsrc_rtpin_video.link_pads("src", self.rtpbin,
"recv_rtp_sink_1")
#
self.udpsrc_rtpin_video.get_static_pad("src").link(self.rtpbin.get_static_pad("recv_rtp_sink_1"))
# //recv sink will be added when the pad becomes available
# //rtcp connection
self.udpsrc_rtcpin_video = Gst.ElementFactory.make('udpsrc',
'udpsrc_rtcpin_video')
self.udpsrc_rtcpin_video.set_property('port',8554)
self.pipeline.add(self.udpsrc_rtcpin_video)
self.udpsrc_rtcpin_video.link_pads("src", self.rtpbin,
"recv_rtcp_sink_1")
#
self.udpsrc_rtcpin_video.get_static_pad("src").link(self.rtpbin.get_static_pad("recv_rtcp_sink_1"))
#rtp AUDIO parts elements
self.udpsrc_rtpin_audio = Gst.ElementFactory.make('udpsrc',
'udpsrc_rtpin_audio')
self.udpsrc_rtpin_audio.set_property('port',8554+10)
self.udpsrc_caps_audio =
Gst.caps_from_string('application/x-rtp,media=(string)audio,clock-rate=(int)8000,encoding-name=(string)SPEEX')
self.udpsrc_rtpin_audio.set_property('caps',
self.udpsrc_caps_audio)
self.pipeline.add(self.udpsrc_rtpin_audio)
self.udpsrc_rtpin_audio.link_pads("src", self.rtpbin,
"recv_rtp_sink_2")
#
self.udpsrc_rtpin_audio.get_static_pad("src").link(self.rtpbin.get_static_pad("recv_rtp_sink_2"))
# //recv sink will be added when the pad becomes available
# //rtcp connection
self.udpsrc_rtcpin_audio = Gst.ElementFactory.make('udpsrc',
'udpsrc_rtcpin_audio')
self.udpsrc_rtcpin_audio.set_property('port',8554+10)
self.pipeline.add(self.udpsrc_rtcpin_audio)
self.udpsrc_rtcpin_audio.link_pads("src", self.rtpbin,
"recv_rtcp_sink_2")
#
self.udpsrc_rtcpin_audio.get_static_pad("src").link(self.rtpbin.get_static_pad("recv_rtcp_sink_2"))
self.rtpbin.connect('pad-added', self.rtpbin_pad_added)
*
But I'm getting this error:*
0:00:01.889827762 8606 0x1bf1cf0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 110
0:00:01.898146969 8606 0x7f50880045e0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 96
0:00:01.898982312 8606 0x7f50880045e0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 96
0:00:01.899082812 8606 0x7f50880045e0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 96
0:00:01.899168748 8606 0x7f50880045e0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 96
0:00:01.909678189 8606 0x1bf1cf0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 110
0:00:01.929594483 8606 0x1bf1cf0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 110
0:00:01.949800628 8606 0x1bf1cf0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 110
0:00:01.964575006 8606 0x7f50880045e0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 96
0:00:01.964797103 8606 0x7f50880045e0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 96
0:00:01.964895877 8606 0x7f50880045e0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 96
0:00:01.964990463 8606 0x7f50880045e0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 96
0:00:01.965070603 8606 0x7f50880045e0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 96
0:00:01.969517709 8606 0x1bf1cf0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 110
0:00:01.989502976 8606 0x1bf1cf0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 110
0:00:02.009383481 8606 0x1bf1cf0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 110
0:00:02.029322784 8606 0x1bf1cf0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 110
0:00:02.030965860 8606 0x7f50880045e0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 96
0:00:02.031117049 8606 0x7f50880045e0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 96
0:00:02.031232927 8606 0x7f50880045e0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 96
0:00:02.031328010 8606 0x7f50880045e0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 96
0:00:02.031441019 8606 0x7f50880045e0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 96
0:00:02.049308322 8606 0x1bf1cf0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 110
0:00:02.069267131 8606 0x1bf1cf0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 110
PAD ADDED
0:00:02.089246396 8606 0x1bf1cf0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 110
0:00:02.098364522 8606 0x7f50880045e0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 96
0:00:02.098473256 8606 0x7f50880045e0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 96
0:00:02.098562024 8606 0x7f50880045e0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 96
0:00:02.098723586 8606 0x7f50880045e0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 96
0:00:02.099613604 8606 0x7f50880045e0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 96
PAD ADDED
0:00:02.109882033 8606 0x1bf1cf0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 110
0:00:02.129083008 8606 0x1bf1cf0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 110
audio stream is coming
Video stream is coming
0:00:02.149019717 8606 0x1bf1cf0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 110
libva info: VA-API version 0.38.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_38
libva info: va_openDriver() returns 0
Error: gst-stream-error-quark: Errore interno nel flusso di dati. (1)
gstbasesrc.c(2943): gst_base_src_loop ():
/GstPipeline:pipeline0/GstUDPSrc:udpsrc_rtpin_video:
streaming task paused, reason not-linked (-1)
0:00:02.164049590 8606 0x7f50880045e0 WARN rtpsource
rtpsource.c:950:calculate_jitter: cannot get clock-rate for pt 96
0:00:02.164151502 8606 0x7f50880045e0 WARN basesrc
gstbasesrc.c:2943:gst_base_src_loop:<udpsrc_rtpin_video> error: Errore
interno nel flusso di dati.
0:00:02.164172550 8606 0x7f50880045e0 WARN basesrc
gstbasesrc.c:2943:gst_base_src_loop:<udpsrc_rtpin_video> error: streaming
task paused, reason not-linked (-1)
exit
*
Can someone help me?
Thanks in advance,
Giacomo*
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Troubles-with-Rtpbin-tp4674257.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list