Do not do it yourself if you have not written a network application before. It is not an easy task to write a scalable and reliable network application, and it is even more difficult to implement an existing protocol so that the implementation is fully compatible with the specification. You will fail or ultimately exceed your budget.
It is much easier and cheaper to buy an existing component or integrate an existing server.
Google "streamcoders" to search for a library that can handle RTSP.
source share