Website integration - WS stream for WQHD cameras

This manual is only intended for 1080p Full HD camera models. For 1080p Full HD camera models please follow our guide here. For 720p HD models please see the HD guide here.

See also:

WS Video Stream

With your INSTAR WQHD cameras you can integrate the HTML5 (plugin-free) websocket video stream directly into a website. We have provided you with the required HTML and JavaScript code in our download area.

To test this code:

  1. Simply drag the HTML file and the folder with scripts into the active directory of your web server.
  2. rename the HTML file to index.html and open it in your text or code editor
  3. specify in the file the address of your camera, the HTTP port, your camera login and the desired stream:

INSTAR Kamera Websocket Videostream

  • ws_protocol = ws or wss *
  • ws_hostname = (DDNS or local IP)
  • ws_port = 80 (Camera HTTP or HTTPS Port) *
  • ws_endpoint = /ws (The URL where the ws stream is served)
  • cam_username = admin (User name for the camera Login)
  • cam_password = instar (User login for the camera Login)

* Note: When using TLS (secure websocket) you will have to use a CA signed certificate like from Let's Encrypt. Follow the link at the bottom of this article to a Github repository that helps you to setup a NGINX Docker container you can use to handle the encryption part for you.

Google Chrome is very strict when it comes to MIME Types (Firefox mostly does not care - it is best to start testing in Firefox and then try to get the stream to work in Chrome...). Depending on your settings you will have to adjust them here:

  • 0 = h.264 video & audio
  • 1 = h.264 video & NO audio
  • 2 = h.265 video & audio
  • 3 = h.265 video & NO audio
// Add media mime type
// 0 => 'video/mp4; codecs="avc1.4D001E, mp4a.40.2"'
// 1 => 'video/mp4; codecs="avc1.4D001E"'
// 2 => 'video/mp4; codecs="hev1.2.4.L120.B0, mp4a.40.2"'
// 3 => 'video/mp4; codecs="hev1.2.4.L120.B0"'
var codec_mime = 0;

Then start your web server and open the provided page in your web browser. The code you downloaded above is a minimal example. For a more complete version check:

INSTAR Kamera Websocket Videostream

The Forum entry also contains a link to a repository for an NGINX web proxy you can use to expose your camera's video stream to the internet and handle the encryption using an e.g. Let's Encrypt certificate