[Live-devel] question RTSP server

Ross Finlayson finlayson at live555.com
Mon Jan 9 03:27:27 PST 2023



> On Jan 9, 2023, at 2:57 AM, g.jaegy <g.jaegy at imagine3d.fr> wrote:
> 
> Hi,
>  I have a RTSP server that can stream a H265 stream from a custom H265 packet source, used by a “H265VideoStreamDiscreteFramer” object (basically a live screen capture of a Vulkan application sent down to NVenc which generated the H265 packets). It uses a “PassiveServerMediaSubsession” object and thus relies on multicast UDP packets.
>  This works great, however, I would like to add support for an optional TCP transport for RTP/RTCP (so user can configure the service to stream over TCP rather than multicast UDP).
>  I’ve managed to figure out I must replace the “PassiveServerMediaSubsession” subsession with an “OnDemandServerMediaSubsession” one. Is that correct ?

Yes.


>  “OnDemandServerMediaSubsession” being a base class, I’ve then tried to find a class that inherit from it, however, all I’ve found was the “H265VideoFileServerMediaSubsession”, which uses a file as input.
>  So, I’m not sure how to move forward. Should I write a custom class, that inherits from “OnDemandServerMediaSubsession” ?

Yes.  However, this requires reimplementing just two virtual functions in this subclass: “createNewStreamSource()” and “createNewRTPSink()”.  “createNewStreamSource()” should be simple: Just create an instance of your source object, and pass it to “H265VideoStreamDiscreteFramer::createNew()”.  And the code for “createNewRTPSink()” will probably be exactly the same as that in “H265VideoFileServerMediaSubsession.cpp”.

For more details, see: http://live555.com/liveMedia/faq.html#liveInput-unicast


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




More information about the live-devel mailing list