Do you realize, that it is rather hard task to do it really right? =))
RTSP camera change timestamps on each reconnect, so you need to change
it properly.
Kevin,
Thanks for the feedback; its great to hear that someone else finds this idea as being worthwhile.
BTW, where’s your patch? Id like to check it out if you don’t mind.
Ive managed to make some changes to the ‘flvplayback’ app so that external streams aren’t pulled at server startup, but are instead pulled right before stream initialization when a client requests a stream (assuming a given stream name has been defined as an external stream). More specifically, Ive over-ridden some of the functions that handle the ‘external stream’ routines, so that the streams aren’t automatically pulled when the app initializes. This seems to work fine so far for the rtmp streams Im working with; the first client to request an externally-defined stream will initiate the stream pull, all subsequent requests for that same external stream will be ignored (since there’s already built-in logic to disable duplicate stream creation by name). Right now, its not very elegant, but it seems to do the job. I can share what Ive done so far if anyone is interested in helping…
The problem now is ‘how to disconnect an idle/unused external stream once there are no longer any clients subscribing to that stream?’
Im figuring that the next step is to dig into the stream-management code and find a relatively simple, unobtrusive way to keep track of connected users (on a per-stream basis, via stream name or stream ID?), and then find an effective point in to code to hook into in order to run a ‘check_if_any_clients_are_still_connected_to_any_running_external_streams()’ routine: if an external stream is running without any clients, its time to shut it down (obviously, I need help figuring out how to implement the above two items; the activeClient count and the active check routine).
Anymore feedback would be greatly appreciated.
Thanks,
cs
You received this message because you are subscribed to "C++ RTMP Server" mailing list.
To post to this group, send email to c-rtmp...@googlegroups.com
To unsubscribe from this group, send email to
c-rtmp-serve...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/c-rtmp-server?hl=en
When the ref count goes to zero, I'll call EnqueueForDelete on the stream.
Kevin,
I think we ended up having the same concept.
Ive attached my source files.
I’ve managed to put something together that’s working so far…
Take a look, give it a try and let me know how it goes.
Basically, what happens is that the external stream config data is loaded on app. initialization, but the streams aren’t actually pulled at that point.
The pulling starts only once a new stream is registered that matches an external stream by name.
I overrode the stream pull/reg/unreg functions and added logic to launch the external streams, keep track of them, and then kill them once no clients are left.
Im still not comfortable working with the variant/maps that are common in the rtmpd source, so my book keeping methods are probably really ugly & inefficient (see the _external* class variables Ive added).
The stream killing method that I used is pretty ‘brute force’; there’s probably a better, cleaner way to do it, but for now it works…
If you can help come up with a more elegant, more efficient way to keep track of the streams, please share…
Thanks,
cs
You received this message because you are subscribed to "C++ RTMP Server" mailing list.
I Forgot to mention, I performed a pretty ugly ‘cludge’ to distinguish which types of streams I was interested in.
In my case, I was only concerned with the streams of type ‘ONR4R’, and Im kinda embarrassed about the way I went about it, it looks really bad.
…
string target_type="ONR4R";
string source_type=STR(tagToString(pStream->GetType()));
if (target_type.compare(source_type)==0){
…
Anyway, it works, but I think it definitely could use help…
Thanks,
cs
From: c-rtmp...@googlegroups.com [mailto:c-rtmp...@googlegroups.com] On Behalf Of Kevin Ross
Sent: Monday, September 19, 2011 9:03 PM
To: c-rtmp...@googlegroups.com
You received this message because you are subscribed to "C++ RTMP Server" mailing list.
I Forgot to mention, I performed a pretty ugly ‘cludge’ to distinguish which types of streams I was interested in.
In my case, I was only concerned with the streams of type ‘ONR4R’, and Im kinda embarrassed about the way I went about it, it looks really bad.
…
string target_type="ONR4R";
string source_type=STR(tagToString(pStream->GetType()));
if (target_type.compare(source_type)==0){
…
Anyway, it works, but I think it definitely could use help…
Thanks,
cs
Im using openvideoplayer, http://openvideoplayer.sourceforge.net/
I’ll try implementing your stream test, it looks good…
Let me know if you have any prob’s with my patch, or if it works.
Thanks,
cs
From: c-rtmp...@googlegroups.com [mailto:c-rtmp...@googlegroups.com] On Behalf Of Kevin Ross
Sent: Monday, September 19, 2011 11:54 PM
To: c-rtmp...@googlegroups.com
You received this message because you are subscribed to "C++ RTMP Server" mailing list.
JW Player does the same. I haven't tried OVP, it appears to be for Flex
applications, I'm not sure though.
What version of the source are you using? I'm using the tarball,
version 575. Are you using something newer from SVN?
-- Kevin
You can download the ovp player package without needing to compile it with
flex.
http://openvideoplayer.sourceforge.net/ovpfl/akamai_multi_player/akamai-mult
i-player-files.zip
give it a try, ovp seems to be pretty good at just 'waiting' for a stream to
come to life (or come back from the dead).
cs
-----Original Message-----
From: c-rtmp...@googlegroups.com [mailto:c-rtmp...@googlegroups.com]
On Behalf Of Kevin Ross
Sent: Tuesday, September 20, 2011 1:10 AM
To: c-rtmp...@googlegroups.com
-- Kevin
You received this message because you are subscribed to "C++ RTMP Server"
Oh well, I'll try again tomorrow. Bed time.
-- Kevin
I think it would be worthwhile to include this functionality into rtmpd.
Would anyone be willing to help me with implementing this into the source?
Thanks,
cs
Unfortunately, I haven't had time to work on it again. I probably won't
have time again until this weekend.
-- Kevin