[Live-devel] How to add , delete more camera connect resource for multi-thread in live555

Ross Finlayson finlayson at live555.com
Wed Mar 16 17:53:10 PDT 2016


>        I'm very glad to use live555 to develop our project.And now I encountered a few questions when developing a program for our project. 
>        I want to develop a rtspclient  program to connect more cameras via live555 at one time, and dynamically  add or delete these connected resouces. 
> Our team want to modify "testRTSPClient" demo application, and create multi-thread for camera connections. But this is dificult  because live555 is designed for single thread.Could you please give me some advice on this work? 

If you haven’t done so already, please read
	http://live555.com/liveMedia/faq.html#threads

It’s important to understand that LIVE555-based applications run with a single thread of control, using an event loop - rather than threads - to provide concurrency.  Note, in particular, that the “testRTSPClient” demo application *already* allows you to specify more than one “rtsp://“ URL on the command line; each of these RTSP streams will be opened and received concurrently - i.e., using a *single* event-loop thread.  For example:
	testRTSPClient rtsp://stream1 rtsp://stream2 rtsp://stream3

If, however, you *really* want to run multiple RTSP clients - each with its own thread of control - then the best way to do this is to run each RTSP client in its own *process*, not as multiple threads within a single process.  For example, you can run the “testRTSPClient” application (or your own RTSP client application) multiple times, concurrently - for example:
	testRTSPClient rtsp://stream1 &
	testRTSPClient rtsp://stream2 &
	testRTSPClient rtsp://stream3 &


(Also, if you plan to use the LIVE555 software in a product, please review: http://live555.com/liveMedia/faq.html#copyright-and-license )

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




More information about the live-devel mailing list