Node.js Express FFMPEG Project to Embed LIVE Streaming Video Feeds in Browser Using ffmpeg-streamer Library in Javascript

 

ffmpeg-streamer

ffmpeg-streamer is a packaged nodejs express server that wraps ffmpeg to allow easy streaming of video feeds directly to modern browsers for testing purposes. It currently includes 6 different types of output streaming which are mjpegjpeg via socket.ioprogressive mp4native hlshls.js, and mse via socket.io. Video input types supported are rtspmp4mjpeg, and hls.

Installation

ffmpeg-streamer has been packaged into an executable using pkg. The current binaries can be found on the releases page.

  • For desktop installation, simply download and extract.
  • For command line installation, see the following steps.
Downloading zipped archive

linux

mac

Extracting zipped archive

linux

mac

Usage

  • For desktop usage, double click the executable to run it.
  • For command line usage, the following shows 2 options.
Start the app from the command line

linux

mac

Or start the app from the command line via pm2

linux

mac

After launching, you can use it via the web interface on port 8181. For example, if your are running it on your current machine, visit it in a modern browser via http://localhost:8181. If port 8181 was already in use, it will keep incrementing the port number by 1 until it finds one available. You can launch multiple copies of the app up to a total of 10, each listening on its own port. If you would like to store your last used settings, go to http://localhost:8181/activity and click the “create” button to use the activity log.

Dependencies

Ffmpeg is the only external software required to run the app. Nodejs is packaged inside the binary and is not needed to be installed separately on your system. When launching the app, it tries to find ffmpeg on your system using ffbinaries. If it cannot find ffmpeg, you will be prompted to install it to the current running directory via the web interface on port 8181. If it does find ffmpeg, but you would like to install a newer version, you can visit http://localhost:8181/install and force the installation.

Development

Clone the repo and move into the newly created directory
Install the module dependencies
Start the app in development mode
Build the binaries

Feature requests and problems

If you have an idea for a new feature or have a problem, please do not hesitate to open an issue. For problems, please include information about what operating system the app is running on and which operating system and browser you are using to view it. Any additional details would be helpful.

Screenshots

screenshot1 screenshot2

TODO

  •  Add support for more input types such as local video hardware and artificially generated input
  •  Add more ffmpeg settings to further customize the generated video for streaming
  •  Improve playback of hls.js
  •  Improve playback of mse via socket.io

Leave a Reply