GithubHelp home page GithubHelp logo

banaoa / raspi-live Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jaredpetersen/raspilive

0.0 2.0 0.0 23 KB

Stream live video from the Raspberry Pi camera module to the web using HLS

License: MIT License

JavaScript 100.00%

raspi-live's Introduction

raspi-live

raspi-live is a Node.js Express webserver that takes streaming video from the Raspberry Pi Camera module and makes it available on the web via HLS.

Usage

Run the usual npm start after downloading all of the dependencies. The application will start providing AES-128 encrypted streaming video from the Raspberry Pi camera module via the /camera/livestream.m3u8 resource on port 8080.

To disable stream encryption or change the port number, edit the config.json file.

Installation

raspi-live only supports streaming video from the Raspberry Pi camera module. Here's a the official documentation on how to connect and configure it: https://www.raspberrypi.org/documentation/usage/camera/.

Since this is a Node.js application that has Node.js dependencies, run npm install as well.

raspi-live uses FFmpeg, a video conversion command-line utility, to process the streaming H.264 video that the Raspberry Pi camera module outputs. Here's how to install it on your Raspberry Pi:

  1. Download and configure FFmpeg via:
git clone https://github.com/FFmpeg/FFmpeg.git
cd FFmpeg
sudo ./configure --arch=armel --target-os=linux --enable-gpl --enable-omx --enable-omx-rpi --enable-nonfree
  1. If you're working with a Raspbery Pi 2 or 3, then run sudo make -j4 to build FFmpeg. If you're working with a Raspberry Pi Zero, then run sudo make.
  2. Install FFmpeg via sudo make install regardless of the model of your Raspberry Pi.
  3. Delete the FFmpeg directory that was created during the git clone process in Step 1. FFmpeg has already been installed and the directory is no longer needed.

Video Stream Playback

raspi-live is only concerned with streaming video from the camera module and does not offer a playback solution. Some browsers support HLS natively and others support it through JavaScript and MSE. If you're looking for a place to start, hls.js is a good option.

Why HLS instead of MPEG DASH?

While MPEG DASH is a more open standard for streaming video over the internet, HLS is more widely adopted and supported. FFmpeg, chosen for its near-ubiquitousness in the video processing space, technically supports both formats but to varying degrees. The MPEG DASH format is not listed in the FFmpeg format documentation and there are minor performance issues in terms of framerate drops and and degraded image quality with FFmpeg's implementation. While these performance issues can likely be configured away with more advanced options, HLS is simply easier to implement out of the box.

raspi-live's People

Contributors

jaredpetersen avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.