Giter Club home page Giter Club logo

node-omxplayer-sync's Introduction

node-omxplayer-sync

synchronized looping video for raspberry pi & omxplayer!

node-omxplayer-sync utilizes a socket.io connection between and broadcaster and many listener raspberry pis provided to synchronized playback. The broadcaster sends out a notification to all listeners when its video has looped. This resets all listeners (including itself) to the start of the loop playback. All listeners synchronize on one full playback loop of the main broadcaster and will continually attempt to re-sync each time the main broadcaster's file loops.

Important Details

  • configure the ip address of one of the raspberry pis to act as the main broadcaster with a Static IP of 192.168.0.99, or dive into the omx-sync.js file and adjust the socket.io IP assignment manually to whatever you like.
  • connect all pis to the same local network via wifi or ethernet
    • make sure that your router's LAN ip address is 192.168.0.1

Installer Script

  1. ssh into your pi
  2. run wget -qO- https://raw.githubusercontent.com/bmoren/node-omxplayer-sync/master/install.sh | bash
  3. dont forget to sudo raspi-config and change the boot options to command line (auto login as user pi)
  4. to change the video file which plays on boot, alter the video file path in your ~/.bashrc or change the filepath in the installer script before running it!

How to get files onto each pi system

  1. if you didnt use the installer script, install usbmount to mount flashdrives: sudo apt-get install usbmount
  2. copy the file from a flashdrive: cp /media/usb/yourfile.mp4 ~/node-omxplayer-sync/
  3. node omx-sync.js path/to/video.mp4

auto-run on startup (the installer script does this automatically!)

  1. run sudo raspi-config, navigate to the boot options and choose command line (auto login as user pi)
  2. install forever: npm install forever -g
  3. nano ~/.bashrc
  4. find the line to load NVM export NVM_DIR="/home/pi/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm or something similar
  5. add forever start ~/node-omxplayer-sync/omx-sync.js ~/absolute/path/to/video.mp4 below the NVM listeners
  6. ctrl+x then Y then Enter to save
  7. sudo reboot

Manual Install:

  1. Setup your Pi
  2. sudo apt-get update
  3. sudo apt-get upgrade
  4. git clone this repository to ~/ on your raspberry pi
  5. if you are running raspbian jessie lite, install omxplayer & rsync
  6. sudo apt-get install omxplayer
  7. install nvm & node.js latest
  8. wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.31.2/install.sh | bash
  9. source ~/.bashrc
  10. nvm install stable
  11. update & install npm packages
  12. cd ~/node-omxplayer-sync
  13. npm install
  14. node omx-sync.js path/to/video.mp4 on each pi to run the sync video!

Tested on

node-omxplayer-sync's People

Contributors

bmoren avatar

Watchers

 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.