[Live-devel] Merry Christmas: A new "RTSP to HLS (HTTP Live Streaming)" proxy application
Ross Finlayson
finlayson at live555.com
Fri Dec 27 09:44:52 PST 2019
As a present for the holidays, I have released a new version (2019.12.27) of the “LIVE555 Streaming Media” software that contains - in the “testProgs” directory - a new demo application called “live555HLSProxy”. This application is ‘work in progress’, which is why, for now, I’m describing/documenting it only on this mailing list.
“live555HLSProxy” converts a live RTSP stream (e.g., from a network camera) into a set of HLS (“HTTP LIve Streaming”) segments that can be viewed in a HLS-compliant browser (e.g., “Safari” on Macs or iPhones). It is a more robust and more portable way to view RTSP streams in web browsers than WebRTC (which I am no longer working on). The big drawback of using HLS (or similar technology), however, is that it introduces significant latency (about 1 minute, currently). (If latency is important to you, then you should not be trying to view a RTSP stream in a web browser; instead, view the stream directly using a RTSP-compliant media player (such as VLC).)
To run “live555HLSProxy”, you must be on a system with a running web server (e.g., Apache):
- cd to a directory accessible by your web server (e.g., /usr/local/www/apache24/data )
- run:
<path-to-live555-software>/live/testProgs/live555HLSProxy <rtsp://-url-of-your-RTSP-stream> <prefix>
where <prefix> is a name to give to your stream (as seen by web browser users).
- If your RTSP stream is password protected, you can add the
-u <username> <password>
option.
- If you wish to receive the RTP/RTCP data over TCP (the RTSP control connection), you can do so by adding the
-t
option. (As always, you should use this only if there is a firewall - between you and the RTSP server - that blocks UDP packets.)
- Note that you can run “live555HLSProxy” several times - for different input RTSP streams - with different <prefix>es
- Once the application has read its first segment of data (about 6 seconds worth), it will ‘beep’ to let you know that the stream is now available for viewing by web browsers.
- HLS-compatible web browsers will then be able to view the stream via the HTTP (or HTTPS) URL:
<URL-of-your-web-server>/<prefix>.m3u8
Note that for this to work, the RTSP stream must contain H.264 video. For now, no other video codec(s) are supported, and any audio stream(s) will not be proxied; the proxy is currently video-only.
Have fun!
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
More information about the live-devel
mailing list