Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RTSP solution for JavaScript/HTML5 [closed]

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!

like image 905
user3722952 Avatar asked Jun 26 '14 21:06

user3722952


People also ask

Does HTML5 support RTSP?

HTML5 does not support RTSP. Therefore, to use RTSP in HTML5, you must use WebRTC. The usual structure is IP Camera (RTSP) -> Server -> Chrome (HTML5) structure. IP Camera (WebRTC) -> Remote Peer (Chrome, Firefox, etc.)

How do I access my camera through RTSP?

Before you have your RTSP address entered, you're going to go into the web interface for the camera you're going to be streaming and go to “Set Up”, “Network”, and then “Port.” You need to make sure your RTSP Port is set to 554. This should be the default setting, but it doesn't hurt to check before you get going!

Do browsers support RTSP?

Browsers do not support the RTMP protocol, but guess who does? The old faithful Flash Player that works enough well even though it does not support all browsers, so it can display the video stream. var nc:NetConnection = nc. connect( "rtmp://192.168.88.59/live" ,obj);

How do I open a RTSP link?

Step 1: Download and install VLC Player from http://www.videolan.org/vlc/. Step 2: Open VLC player and select“Open Network Stream”from the Media menu. Step 3: Type the network URL in the dialog box below, and then click Play to play the video with RTSP stream.


3 Answers

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

like image 146
jcaron Avatar answered Oct 11 '22 10:10

jcaron


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

like image 28
linkingvision Avatar answered Oct 11 '22 10:10

linkingvision


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.

like image 33
Jay Avatar answered Oct 11 '22 11:10

Jay