[Live-devel] RSTP Live streaming from USB camera (Ross Finlayson)

Ross Finlayson finlayson at live555.com
Thu Nov 20 13:59:09 PST 2014


> While maintaining a single live source,  is there  a way for which,
> each new client  can always receive a  sequence beginning with  SPS, PPS
> and key frames?

No.  However, each RTSP client will already have the SPS and PPS NAL units - because they will have been present in the SDP description that the client received from the server (as a response to the RTSP "DESCRIBE" command).  Therefore, the client can insert these SPS and PPS NAL units at the front of the stream, before it starts to decode them.

To illustrate this, look at the code for the "openRTSP" client application - see "testProgs/playCommon.cpp", lines 863-865.  Note how the code calls "MediaSubsession::fmtp_spropparametersets()" to get a SDP format string that encodes the SPS and PPS NAL units.  

Then, note the code in "liveMedia/H264or5VideoFileSink.cpp", lines 48-55.  Note how the code calls the function "parseSPropParameterSets()" to decode the SDP format string into a sequence of (binary) NAL units.  (For H.264 video, this will usually be 2 NAL units: the SPS and the PPS.)  You can then feed each of these binary NAL unit to your decoder, before it receives the rest of the NAL units (in the network stream).  (Depending on your decoder, you may need to prepend each one with a 4-byte 0x00 0x00 0x00 0x01 'start code'.)


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/ <http://www.live555.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20141121/fc9f3bfd/attachment.html>


More information about the live-devel mailing list