Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I display an RTSP video stream in a web page?

I have an ip camera which provides a live RTSP video stream. I can use VLC media player to view the feed by providing it with the URL:

rtsp://cameraipaddress 

But I need to display the feed on a web page. The camera provider supplied an ActiveX control which I got working, but it is really buggy and causes the browser to frequently hang.

Does anyone know of any alternative video plugins I could use which support RTSP?

The camera can be configured to stream in either H264 or MPEG4.

like image 862
elMarquis Avatar asked Feb 11 '10 14:02

elMarquis


People also ask

Can you view an RTSP stream with a browser?

As a rule, browsers do not support RTSP, so the video stream is converted for a browser using an intermediate server.

Can you view RTSP in Chrome?

Direct RTSP streaming is still not supported by browsers, if you have to play an RTSP stream in the browser then you need a proxy server that will convert RTSP to HTTP stream.


2 Answers

VLC also comes with an ActiveX plugin that can display the feed in a web page:

http://wiki.videolan.org/ActiveX/HTML

<OBJECT classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921"      codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab"      width="640" height="480" id="vlc" events="True">    <param name="Src" value="rtsp://cameraipaddress" />    <param name="ShowDisplay" value="True" />    <param name="AutoLoop" value="False" />    <param name="AutoPlay" value="True" />    <embed id="vlcEmb"  type="application/x-google-vlc-plugin" version="VideoLAN.VLCPlugin.2" autoplay="yes" loop="no" width="640" height="480"      target="rtsp://cameraipaddress" ></embed> </OBJECT> 
like image 174
Russell Avatar answered Oct 19 '22 03:10

Russell


Roughly you can have 3 choices to display RTSP video stream in a web page:

  1. Realplayer
  2. Quicktime player
  3. VLC player

You can find the code to embed the activeX via google search.

As far as I know, there are some limitations for each player.

  1. Realplayer does not support H.264 video natively, you must install a quicktime plugin for Realplayer to achieve H.264 decoding.
  2. Quicktime player does not support RTP/AVP/TCP transport, and it's RTP/AVP (UDP) transport does not include NAT hole punching. Thus the only feasible transport is HTTP tunneling in WAN deployment.
  3. VLC neither supports NAT hole punching for RTP/AVP transport, but RTP/AVP/TCP transport is available.
like image 21
ciphor Avatar answered Oct 19 '22 03:10

ciphor