RTSP solution for JavaScript/HTML5 [closed]

2019-02-21 18:14发布

问题:

I am developing a Smart TV application and streaming live video from an IP Camera is a huge portion of the functionality.

The camera's manual states that if it is set to stream MPEG-4 or H.264 that HTTP is not supported; only RTSP/RTP is.

The alternative (via HTTP) is Motion JPEG, which I would like to avoid as much as possible (terrible framerate on the TV).

Is there any JavaScript/HTML5 solution/wrapper for RTSP? The TV cannot run a Java applet or anything of the sort, and by default, the browser does not support RTSP.

Thanks!

回答1:

There doesn't seem to be any pure JS or HTML5 solution for this. You'll probably need to go through a server that will transcode the video.

See also: https://stackoverflow.com/a/4900156/3527940



回答2:

You can get 90% of what you need here: https://github.com/SpecForge/html5_rtsp_player

That will enable html5 clients to use web sockets to recieve data from a server which is tunneling the rtp and rtsp data from the server to the client.

The other 10% is going to depend on what technology you want to use in the backend.. e.g. to do the tunneling from the server to the clients.

I have a project @ http://net7mma.codeplex.com which can help for Rtsp consumption and aggregation in .Net

You can then easily use the Html5 Rtsp Player combined with a thin Websocket layer to send the data from the server to the client as required by your application.



回答3:

Two way can play rtsp live video to html5, but both need gateway to tranfer the rtsp real stream to the format html5 can use, and do not need transcode.

a. media source extensions Need a websocket gateway to repack the rtsp H264 stream to mp4 box.

b. WebRTC Send the RTSP H264 data to WebRTC

More detail you can refer https://linkingvision.com/rtsp_in_html5_with_low_latency