alm4096 / FFMPEG-Live555-H264-H265-Streamer

H264, H265 and more Encoder and Multicast/Unicast Streamer (example of how to use Live555 and FFMPEG)
100 stars 48 forks source link

streaming two input device requires some changes in live555class #6

Open ahmadi219 opened 8 years ago

ahmadi219 commented 8 years ago

Hi According to previous problem in streaming two input device via different threads , if I want to create multiple rtsp server , because of define static variable eventtriggerId , abort occured in env->taskScheduler().doEventLoop(&Stop_RTSP_Loop); I search problem that it must be change static definition of eventtriggerId to non-static. but I do not know how to change this code in FFMPEGClass : Tmp_Head_Node->task->triggerEvent(AnalyserSource::eventTriggerId, Tmp_Head_Node->source); and how to change this line of code in AnalyserSource constructor: if (eventTriggerId == 0) { eventTriggerId = envir().taskScheduler().createEventTrigger(deliverFrame0); } Could you help me ? Thanks

alm4096 commented 8 years ago

I think you may be confusing multiple RTSP streams within the same instance of Live555 with separate Live555 instances with one stream each.

Live555 lies within a class meaning that even static variables are "local" to that class. If you create another instance of the class it will create another static variable within the class.

I will look into it eventually. If you have any Live555 specific questions you should ask the Live555 guys (http://www.live555.com/), this project simply uses their examples.

alm4096 commented 8 years ago

I have looked at the code and you were correct, there is indeed issues with variables being static outside of the classes which is stopping multiple instances of Live555 working.

"AnalyserSource::eventTriggerId" is just one of many issues. It is going to take some time to fix unfortunately. The "AnalyserSource::eventTriggerId" issue is not too bad to fix but the others are much harder to fix and it may take some time to get something stable working.

ahmadi219 commented 8 years ago

Hi thanks for your answers which of these approaches is true ? multiple RTSP streams within the same instance of Live555 or separate Live555 instances with one stream each ?

Is it possible to use one rtsp server in this project but create multiple ffmpeg class for each input device ? so I create multiple ffmpeg instance and then create a rtsp server that communicate weach of them ? Could you help me for a simple solution for this purpose ? Thanks for your attention

alm4096 commented 8 years ago

In our case, the code is orientated in the direction of "separate Live555 instances with one stream each"

Yes it is possible to use one RTSP server but I feel the code would need a fair bit of rework to make it easy to use. A singleton may be the best course of action for the Live555 class.

At the moment I don't have much to spend on development of this project so progress will be a little slow.

I do plan on making the class capable of streaming multiple streams in the future.

magic428 commented 4 years ago

Hi thanks for your answers which of these approaches is true ? multiple RTSP streams within the same instance of Live555 or separate Live555 instances with one stream each ?

Is it possible to use one rtsp server in this project but create multiple ffmpeg class for each input device ? so I create multiple ffmpeg instance and then create a rtsp server that communicate weach of them ? Could you help me for a simple solution for this purpose ? Thanks for your attention

Hi ahmadi219,

Have you get a solution to create several streams communicate with a RTSP server? I also run into the issue now.

I changed the eventTriggerId to an non-satic variable, and make the *rtspSever and *env to static variable. but it didn't works.

Thanks for your attention.