node-red-contrib-custom-ffmpeg-video

0.1.2 • Public • Published

node-red-contrib-ffmpeg

NPM Version NPM Downloads

A simple ffmpeg wrapper for streaming video.

Installation

$ npm install node-red-contrib-custom-ffmpeg-video

Note: This node requires that you have ffmpeg installed on your machine.

Configure your node

Open the node's configuration panel to set Input URL and the Stream URL.

Note: In this example our stream will be accessible at ws://<host>:<port>/stream

Using the stream

To render the video stream in the browser, we use a library called JSMpeg.

<html>
  <body>
    <!-- import JSMpeg -->
    <script src="jsmpeg.min.js"></script>
    <!-- create a canvas tag to render our video stream -->
    <canvas id="video-canvas"></canvas>
    <script>
      const videoCanvas = document.getElementById('video-canvas')
      
      // The stream URL that we set in the previous step.
      const url = `ws://${window.location.hostname}:${window.location.port}/stream`

      new JSMpeg.Player(url, { canvas: videoCanvas })
    </script>
  </body>
</html>

Device specific instructions

There are a few minor hardware specific steps depending on your device.

sudo raspi-config

Package Sidebar

Install

npm i node-red-contrib-custom-ffmpeg-video

Weekly Downloads

18

Version

0.1.2

License

MIT

Unpacked Size

1.15 MB

Total Files

10

Last publish

Collaborators

  • jarn