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.
- 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
- make sure that your router's LAN ip address is
- ssh into your pi
- run
wget -qO- https://raw.githubusercontent.com/bmoren/node-omxplayer-sync/master/install.sh | bash
- dont forget to
sudo raspi-config
and change the boot options tocommand line (auto login as user pi)
- 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!
Prefered Method
- rsync the files onto the pi over ssh
rsync -aP path/to/local/source/video.mp4 [email protected]:/home/pi/node-omxplayer-sync
node omx-sync.js path/to/pi/video.mp4
- If using auto running on startup, dont forget to update the
~/.bashrc
to the new files.
Secondary Method
- if you didnt use the installer script, install usbmount to mount flashdrives:
sudo apt-get install usbmount
- copy the file from a flashdrive:
cp /media/usb/yourfile.mp4 ~/node-omxplayer-sync/
node omx-sync.js path/to/video.mp4
There may be issues with playback / sync when running videos from external USB media, especially for long files. For best results, run the files from the filesystem SD card. This is most easily accomplished using rsync
- run
sudo raspi-config
, navigate to the boot options and choosecommand line (auto login as user pi)
- install forever:
npm install forever -g
nano ~/.bashrc
- 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 - add
forever start ~/node-omxplayer-sync/omx-sync.js ~/absolute/path/to/video.mp4
below the NVM listeners ctrl+x
thenY
thenEnter
to savesudo reboot
- Setup your Pi
sudo apt-get update
sudo apt-get upgrade
git clone
this repository to~/
on your raspberry pi- if you are running raspbian jessie lite, install omxplayer & rsync
sudo apt-get install omxplayer
- install nvm & node.js latest
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.31.2/install.sh | bash
source ~/.bashrc
nvm install stable
- update & install npm packages
cd ~/node-omxplayer-sync
npm install
node omx-sync.js path/to/video.mp4
on each pi to run the sync video!
- Node v9.3.0
- omxplayer Version: 5a25a57 [debian] Repository: XECDesign/omxplayer.git
- RASPBIAN STRETCH LITE | 2017-11-29
- [email protected]
- [email protected]