[gst-devel] RTP+MJPEG - Sniffing packets with wireshark, How clients join the rtp server

Mauro Brenna malloblenne at gmail.com
Tue Dec 21 11:16:21 CET 2010


Hello,

I am studying the RTP protocol in order to implement a server for RTP
with MJPEG payload using RFC 2435.
I read the RFC and I tried to stream and receive a video in rtp using gstreamer.

I read about :
http://www.gstreamer.net/data/doc/gstreamer/head/gst-plugins-good-plugins/html/gst-plugins-good-plugins-rtpjpegpay.html
which is exactly the implementation of the RFC I read.

I tested the streaming and reception of two camera outputs using a
pipeline which I have found in the Internet and which seems to work:

#Streaming rtp mjpeg
gst-launch-0.10 -v gstrtpbin name=rtpbin v4l2src device=/dev/video0 !
video/x-raw-rgb,width=640,height=480,framerate=\(fraction\)30/1 !
ffmpegcolorspace ! jpegenc ! rtpjpegpay ! rtpbin.send_rtp_sink_0
rtpbin.send_rtp_src_0 ! multiudpsink clients="127.0.0.1:9996"
rtpbin.send_rtcp_src_0 ! multiudpsink clients="127.0.0.1:9997"
sync=false async=false udpsrc port=10000 ! rtpbin.recv_rtcp_sink_0
v4l2src device=/dev/video1 !
video/x-raw-rgb,width=640,height=480,framerate=\(fraction\)30/1 !
ffmpegcolorspace ! jpegenc ! rtpjpegpay ! rtpbin.send_rtp_sink_1
rtpbin.send_rtp_src_1 ! multiudpsink clients="127.0.0.1:9998"
rtpbin.send_rtcp_src_1 ! multiudpsink clients="127.0.0.1:9999"
sync=false async=false udpsrc port=10001 ! rtpbin.recv_rtcp_sink_1

#Playing rtp mjpeg
gst-launch-0.10 -v gstrtpbin name=rtpbin udpsrc
caps="application/x-rtp, media=\(string\)video,
clock-rate=\(int\)90000, encoding-name=\(string\)JPEG,
ssrc=\(guint\)469657143, payload=\(int\)96,
clock-base=\(guint\)2841649723, seqnum-base=\(guint\)39869" port=9996
! rtpbin.recv_rtp_sink_1  rtpbin. ! rtpjpegdepay ! jpegdec ! videorate
! video/x-raw-yuv ,framerate=30/1 !  ffmpegcolorspace  ! xvimagesink
udpsrc port=9997 ! rtpbin.recv_rtcp_sink_1 rtpbin.send_rtcp_src_1 !
multiudpsink clients="127.0.0.1:10001" sync=false async=false &
gst-launch-0.10 -v gstrtpbin name=rtpbin udpsrc
caps="application/x-rtp, media=\(string\)video,
clock-rate=\(int\)90000, encoding-name=\(string\)JPEG,
ssrc=\(guint\)469657143, payload=\(int\)96,
clock-base=\(guint\)2841649723, seqnum-base=\(guint\)39869" port=9998
! rtpbin.recv_rtp_sink_1  rtpbin. ! rtpjpegdepay ! jpegdec ! videorate
! video/x-raw-yuv ,framerate=30/1 !  ffmpegcolorspace  ! xvimagesink
udpsrc port=9999 ! rtpbin.recv_rtcp_sink_1 rtpbin.send_rtcp_src_1 !
multiudpsink clients="127.0.0.1:10001" sync=false async=false


Everything works but I would like to ask to this mailinglist a couple
of questions about the implementation and RTP itself:

1) I tried to sniff the packets using wireshark. I can see the packets
that are sent using UDP but not the RTP encapsulation (I see only the
field data of the UDP packet). Is is a problem of wireshark for RTP
(RFC 2435) or the gstreamer plug-in is not compliant to the standard?
I tested the same thing in VLC that streams RTP packets using RFC
2250. In wireshark I can see the RTP packet with the correct payload
type.

2) I do not understand very well how the client (player) join the RTP
server (streamer). I read the general RFC 1889. In the section about
RTP Control Protocol, it is not clear how the initialization works. I
mean, when I start the streamer, does it start to send RTP+MJPEG
packets to the unicast/multicast destination even if nobody is
listening to it? Or does it start sending packets after the reception
of a particular packet from the client ? I read about feedbacks
packets from sender/receiver and about the BYE (Goodbye RTCP packet).
However, I have not found a sort of JOIN packet.


Thanks in advance for the replies,

Mauro




More information about the gstreamer-devel mailing list