[Live-devel] RTSP server on live555 start send client on I-Frame (h264)

Ross Finlayson finlayson at live555.com
Tue Feb 27 23:39:10 PST 2024


> How can I make the new client start receiving data from the last GOP (SPS, PPS and I-FRAME)?

You can’t do this if you ever want to have more than one client playing/receiving the stream concurrently, otherwise your server would need to (somehow) arrange to send different data, at different times, to each concurrent client.  Instead, your server currently sends the same data - at the same time - to each client, which is much simpler to implement.

But you should not need to do this, because each client - when it connects to the server using a RTSP “DESCRIBE” command - should receive in return a SDP description that contains a "sprop-parameter-sets=“ attribute.  This attribute encodees the SPS and PPS NAL units, which should give the client enough information to decode the stream (at least, after the arrival of the next ‘key frame’), even if the SPS and PPS NAL units do not appear in the stream.


> I took most of the code from here Live555: X264 Stream Live source based on "testOnDemandRTSPServer".

Note that this is not our code (although it’s modeled after some of our code), so we don’t support it.  But note that the “checkForAuxSDPLine1()” code in your server is intended to read through the input video source - when the server starts up - until it sees a SPS and PPL NAL unit.  Once it sees this, the server code should save this, so that it can include it in the SDP description that it returns in response to each RTSP “DESCRIBE” command.

I suggest first using our “openRTSP” command-line client; see
	http://live555.com/openRTSP/
to receive your stream, to make sure that the SDP description contains a "sprop-parameter-sets=“ attribute.   If so, your server should be working correctly, and clients should be able to use this information to help decode the stream.


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/




More information about the live-devel mailing list