[Live-devel] question RTSP server

g.jaegy g.jaegy at imagine3d.fr
Mon Jan 9 11:41:26 PST 2023


Perfect, that what I've done and it's working like a charm 👍 I've indeed extracted an underlying class with one instance shared across all my custom source inputs, so that input sources can be destroyed/created at anytime. Works great.

I'll now try to have the stream to be accessible on the internet, I think I have seen some example or documentation mentioning http/port 80 somewhere, I will check that tomorrow.

Thanks once again for your help, really appreciated.


________________________________
From: live-devel <live-devel-bounces at us.live555.com> on behalf of Ross Finlayson <finlayson at live555.com>
Sent: Monday, January 9, 2023 6:24:49 PM
To: LIVE555 Streaming Media - development & use <live-devel at us.live555.com>
Subject: Re: [Live-devel] question RTSP server



> On Jan 9, 2023, at 6:21 AM, g.jaegy <g.jaegy at imagine3d.fr> wrote:
>
> Fantastic, thanks a lot for that quick and very precise answer.
>
> I've managed to update the code quickly, however, I'm just facing a little issue : I am not completely sure what the "reuseFirstSource" parameter in the OnDemandServerMediaSubsession() constructor means.

This parameter is important if more than one RTSP client is streaming from the server at the same time.  If "reuseFirstSource” is set to True, then each of these multiple RTSP clients will get data from the same source object, rather than the source object being created anew for each new RTSP client.  So, when you’re streaming from a live source (rather than a file), as you are doing, setting “reuseFirstSource” to True is the right thing to do.

HOWEVER, this doesn’t mean that your source object will be created only once, and destroyed only once.  As you discovered, the source object will get created once by “sdpLines()” (to implement the first RTSP “DESCRIBE” command), and then destroyed.  It will then get created again (to implement the RTSP “SETUP” command), and later destroyed when the streaming ends.  And this latter create/destroy sequence can happen multiple times, if a new client starts streaming after the previous client has ended.

Therefore, it’s important that you take this into account when you implement the constructor and destructor for your source object.  These can get called multiple times, in sequence - but not concurrently (provided that “reuseFirstSource” is True).  E.g., you can see constructor,destructor,constructor,destructor - but not constructor,constructor,destructor,destructor.


> So, I guess I'll have to instanciate both the framer, and my custom input source to that, each time createNewStreamSource() gets called.

Yes, your “createNewStreamSource()” implementation must create a new input source object, and then a new “H265VideoStreamDiscreteFramer” object that uses it.  However, the implementation of your input source object can use a single underlying data structure (the actual data source).


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


_______________________________________________
live-devel mailing list
live-devel at lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20230109/b3e58560/attachment-0001.htm>


More information about the live-devel mailing list