Reputation: 680
I would like to embed a video stream from an IP camera into a website. The URL for this stream looks like this:
rtsp://my.camera.com/axis-media/media.amp
If I open the stream in VLC it is working fine. I have tried to use stuff from here but nothing is working: https://wiki.videolan.org/Documentation:WebPlugin
Upvotes: 1
Views: 20840
Reputation: 11
It can be done with VLC or Quicktime but the actual problem your most likely experiencing is that web browsers have stopped suporting the VLC and Quicktime plugins. At time of writing this reply only Firefox still supports this plugin. This also means you need VLC or Quicktime installed on your PC (Which I gather you have since it plays the steam in VLC).
Try Firefox for now to see if your stream works. If it asks to Activate the VLC / Quicktime plugin click Allow or Allow and remember.
When using VLC the HTML Code in your website should resemble this:
<div id="cctv-container">
<object classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab" id="vlc" events="True" width="640" height="480">
<param name="Src" value="rtsp://my.camera.com/axis-media/media.amp"/>
<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" target="rtsp://my.camera.com/axis-media/media.amp" width="640" height="480"/>
</object>
</div>
The only way at present to have it stream in Chrome or IE is to have VLC transcode the RSTP stream for you to a HTML5 supported stream.
Here is a sample VLC command to do just that:
vlc rtsp://my.camera.com/axis-media/media.amp :network-caching=1000 :sout=#transcode{vcodec=theo,vb=1600,scale=1,acodec=none}:http{mux=ogg,dst=:8181/stream} :no-sout-rtp-sap :no-sout-standard-sap :sout-keep
The new output stream can then be embedded in a HTML5 shim:
You can obviously change the port or encoding type as you see fit e.g.
:http{mux=flv,dst=:1234/stream}
Upvotes: 1