[Live-devel] Multicast addresses for MPEG4 and H.264 streams

Piers Hawksley piers.hawksley at amgsystems.com
Tue Jul 23 09:36:56 PDT 2013


Can I test my understanding of the testMPEG4VideoStreamer multicast 
sample application and ask a question on the server media session 
reference count ?

testMPEG4VideoStreamer creates an RTSP server to stream test.m4e and 
reports 'Play using this stream using the URL ...'. The URL is of the 
form RTSP://<Source_IP_Addr>:8554/testStream, which is a unicast 
address. When connecting using VLC the RTSP SETUP response provides the 
multicast address with the line:
Transport: RTP/AVP;multicast;destination=<Source Specific Multicast 
Address>;source=<Source_IP_Addr>;port=1234-1235;ttl=1

Using wireshark I can see the image data is being sent from the source 
address to the multicast address.

The FAQ mentions that the testMPEG4VideoStreamer program incorporates an 
RTSP server to provide the SDP description - is this why the RTP 
multicast stream is accessed using the RTSP unicast address ?

VLC instructions (http://www.videolan.org/doc/play-howto/en/ch04.html) 
suggest an RTP multicast stream can be received using 
rtp://@<multicast_addr>:1234/, however VLC does not display a video 
stream when this address is used - is this because it cannot decode the 
stream as it doesn't have the information required ?

I am extending a program (a camera  application running on Embedded 
Linux and using live555 to server the video streams) that we have been 
using to provide multiple unicast streams (MPEG4, H.264, JPEG (sorry - 
its for Onvif standard compliance)) at different resolutions. The aim is 
to allow some of the streams to be multicast streams (either SSM or 
non-SSM) and the rest unicast.

I am testing this on a LAN with simple unmanaged switches and have set 
ttl to 1 to avoid issues with routers.
On start-up the camera joins the multicast group(s) (one for every 
stream that is set to use multicast) with an IGMP v2 Membership Report 
(0x16);
When each VLC client connects the PC it is running on joins the 
multicast group for the stream requested (if it is not already a member) 
with an IGMP v2 Membership Report (0x16);
Each connection to RTSP://<Source_IP_Addr>:8554/streamN produces the 
RTSP Options, Describe, Setup, Play sequence;
Each connection causes that stream's ServerMediaSession reference count 
to increase;
When each connection is closed that stream's ServerMediaSession 
reference count decreases;
When all connections from one PC are closed we get an RTSP Teardown 
followed by an IGMP v2 Leave Group (0x17) (from the PC);
When the program on the camera stops the live555 event thread / closes 
the RTSP server we get an IGMP v2 Leave Group (0x17) (from the camera).

Each stream's ServerMediaSession reference count (from 
sms->referenceCount(), where sms was created with ServerMediaSession 
*sms = ServerMediaSession::createNew(...) ) increments with each new 
multicast connection. Is this a count of the number of clients not a 
count of the number of streams being sent ?

Many thanks,

Piers Hawksley



More information about the live-devel mailing list