To get to this point I’ve tried several different approaches but along the way i realized that it had to apply to three criteria.
- Youtube/RTMP dump
- HLS/DASH source for P2P stream sharing
- RTSP source for Machine Learning Python apps
So i’ve ended up with the following scenario.
So the RTSP stream is pulled of the IP Camera with Wowza from a remote location to my server. There it is split up in several different sub streams (HLS/RTSP/RTMP) and pushed to Youtube. The stress on the server is very minimal. No transcoding is done, the full 2K (1440p) is fed to all the streams.
Now for the interesting part. Using HLS, the stream is pulled from Wowza and served to visitors of my website viewing the Clappr stream. Once a client connects it makes itself known to the tracker. The tracker holds a collections of already connected clients and instructs the WebTorrent script to start sharing the stream among each other. In theory only 25% of all traffic is pulled of of my server and 75% is shared between clients. This makes scalability much easier and more cost efficient.
The last part of the puzzle is used for personal projects. Playing around with machine learning apps in Python. Counting the number of boats passing by every day for example.