bourdakos1 / node-red-contrib-ffmpeg

📹 A simple ffmpeg wrapper for streaming video in Node-RED

Home Page:https://flows.nodered.org/node/node-red-contrib-ffmpeg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

node-red-contrib-ffmpeg

NPM Version NPM Downloads

A simple ffmpeg wrapper for streaming video from a DJI Tello Drone or a Raspberry Pi.

Installation

$ npm install node-red-contrib-ffmpeg

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

Configure your node

Open the node's configuration panel to set Device Type 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.

Tello Drone

Before you can use your Tello Drone you MUST activate it in the official Tello Drone app. Once your drone is activated, you can connect to it's WiFi Network TELLO-XXXXXX and send it commands via UDP.

In the example flow, to start the video stream, click the command command followed by streamon command.

Check out this blog post to get started

Raspberry Pi

Before you can stream with a Raspberry Pi, you will need to attach a camera and enable it.

To enable camera support, run the following command:

sudo raspi-config

Then use the arrow keys to choose Interfacing Options > Camera and select to enable the camera. Once the camera is enabled, reboot your Raspberry Pi.

Note: For the most up-to-date instructions for Raspberry Pi Camera setup, check out the official documentation.

The Raspberry Pi will start streaming as soon as you start node red.

Authors

About

📹 A simple ffmpeg wrapper for streaming video in Node-RED

https://flows.nodered.org/node/node-red-contrib-ffmpeg

License:MIT License


Languages

Language:JavaScript 78.4%Language:HTML 21.6%