title: Re-stream RTSP from IP cam with Node Media Server to http/ws and display it with html
body: <h1>Goal</h1>
  
  <p>My goal is to display my IP cam's RTSP-output stream on a standard HTML-page (html5 + css3 + vanilla javascript, no magic = no plugins). The HTML-page should be hosted in a NGINX web server on my Raspberry Pi.</p>
  
  <h1>My equipment</h1>
  
  <p>The setup I am using is a Raspberry Pi 3 B+ with Rasbian OS,  Node.js and <a href="https://github.com/illuspas/Node-Media-Server" rel="nofollow noreferrer">Node-Media-Server package</a>, NGINX (<em>but I do not believe that NGINX is important for my problem? I have not made any config for the Node-Media-Server in it anyway.</em>) An IP-camera, and a browser.
  <a href="https://i.stack.imgur.com/x18Kw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/x18Kw.png" alt="enter image description here"></a></p>
  
  <h1>What I have tried</h1>
  
  <p>The <a href="https://github.com/illuspas/Node-Media-Server#readme" rel="nofollow noreferrer">readme</a> in the Node-Media-Server-project is detailed and there is a tutorial describing almost exactly what I want to do. Specifically, there is a markup example on how the live stream could be accessed:</p>
  
  <pre><code>&lt;html&gt;
  
  &lt;head&gt;
      &lt;title&gt;Camera&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;script src="https://cdn.bootcss.com/flv.js/1.4.0/flv.min.js"&gt;&lt;/script&gt;
      &lt;video id="videoElement"&gt;&lt;/video&gt;
      &lt;script&gt;
          if (flvjs.isSupported()) {
              var videoElement = document.getElementById('videoElement');
              var flvPlayer = flvjs.createPlayer({
                  type: 'flv',
                  url: 'http://localhost:8000/live/uterum.flv'
              });
              flvPlayer.attachMediaElement(videoElement);
              flvPlayer.load();
              flvPlayer.play();
          }
      &lt;/script&gt; 
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>This is how I start the media server on my Raspberry PI, <code>kommandoran-mediaserver.js</code>:</p>
  
  <pre><code>const { NodeMediaServer } = require('node-media-server');
  
  const config = {
      logType: 3, // 3 - Log everything (debug)
      rtmp: {
          port: 1935,
          chunk_size: 60000,
          gop_cache: true,
          ping: 60,
          ping_timeout: 30
      },
      http: {
          port: 8000,
          allow_origin: '*'
      },
      relay: {
          ffmpeg: '/usr/local/bin/ffmpeg',
          tasks: [
              {
                  app: 'cctv',
                  mode: 'static',
                  edge: 'rtsp://&lt;USER&gt;:&lt;PASSWORD&gt;@10.0.0.111/live1.sdp',
                  name: 'uterum',
                  rtsp_transport : 'tcp' //['udp', 'tcp', 'udp_multicast', 'http']
              }
          ]
      }
  };
  
  var nms = new NodeMediaServer(config)
  nms.run();
  </code></pre>
  
  <h1>My problem and question</h1>
  
  <p>When I try to view <code>camera.html</code> (see markup above) via the Chromium browser on Raspberry Pi (i.e. local host), nothing is displayed. In the Chromium debug inspector there are no javascript errors, but I get this:<br />
  <code>GET http://localhost:8000/live/uterum.flv net::ERR_EMPTY_RESPONSE</code></p>
  
  <p>Here is a screenshot from the node terminal:
  <a href="https://i.stack.imgur.com/358Sh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/358Sh.png" alt="enter image description here"></a>
  The red area illustrates the output when I try to make a request to <code>http://localhost:8000/live/uterum.flv</code>.</p>
  
  <p>I suppose I try to reach the wrong endpoint but which is correct? The documentation states <code>http://localhost:8000/live/STREAM_NAME.flv</code>. What is "<code>STREAM_NAME</code>" in my case?</p>