Convert RTSP stream to HTTP Live Stream

9

How do I convert RTSP stream to HTTP Live stream?

I own an IP Camera that uses the RTSP protocol to stream video, and would like to make it work on iOS using the Safari browser. According to the Safari documentation 1

  

Safari on the desktop plays the RTSP stream, while Safari on iOS plays   the HTTP Live stream.

The browser in iOS only supports the HTTP Live stream protocol. How to convert this stream?

1 HTML5 Safari Audio and Video Guide

    
asked by anonymous 13.02.2015 / 18:35

1 answer

1

As mentioned, one can run VLC or ffmpeg. I do not know exactly the commands to use them, so I'll give you a third option: GStreamer

Make sure your OS has some installation package for GStreamer (I believe you do not have it for OS / X), if not you can install it by downloading from the URL below:

link

At a terminal, you can test whether your system can decode the RTSP stream using:

gst-launch-1.0 playbin uri="<url do stream>"

If you run correctly then all right. Otherwise, it may be that the version you installed does not support the format used or you ran into a bug. You can report on link

Having executed correctly, you now need to transcode to HLS

gst-launch-1.0 uridecodebin uri="<url do stream>" name=d ! queue ! videoconvert ! x264enc ! h264parse ! queue ! mpegtsmux name=mux ! hlssink d. ! queue ! audioconvert ! faac ! queue ! mux.

You can use gst-inspect-1.0 hlssink to see some properties you can add to hlssink and configure the HLS playlist location and other details if you want. The default will be that the files for HLS will be placed in the folder where you execute the command.

Now you need to run an HTTP server to serve the generated files. The simplest would be:

python -m SimpleHTTPServer

and will start a server on port 8000, then you just need to point the client to link

p>     
27.02.2015 / 23:25