A simple video looper that you can remotely update across the Internet using Syncthing.
This is an instruction guide for a "no-frills" video looper that you can remotely update across the Internet using Syncthing. I use it to display ads and informational content on some televisions at a local restaurant using a couple of Raspberry Pi Zero 2W SBCs. To update the content, I just drop the new video file into my local Syncthing shared folder and it gets pushed to all of the Pi's automatically.
- These instructions assume that you have general working knowledge of Raspberry Pi SBCs and are comfortable using terminal commands.
- The instructions are designed around one Raspberry Pi per display. Output to two displays is possible, but I have not researched or tested it.
- I have only done this on Raspberry Pi Zero 2W SBCs, though there's no reason these instructions shouldn't work on higher-end models.
- I do this as a hobby, so I can’t provide technical support other than to direct you to official instructions and guides.
- If you use firewalls, proxies, or need more advanced sync features, be sure to check out the Syncthing Wiki.
- A networked computer running Windows, macOS, or Linux
- 1 Raspberry Pi SBC and 1 Micro-SD Card per display
- Raspberry Pi Imager or Balena Etcher to write the SD-Card
- On Windows, use the Syncthing Windows Installer
- On macOS, use the Syncthing macOS Installer, or install via Homebrew
- On Debian or a Debian derivative, you can use the four steps listed below under the heading 3. Install Syncthing on the Pi, or install via Homebrew
- On other distros, look for Syncthing in your distro’s package manager, or install via Homebrew
- Syncthing is also available as a Flatpak bundled with a tray icon app, and there are other tray icon apps for Linux as well, but the tray icon really isn’t necessary.
If you install Syncthing via Homebrew, be sure to enable the Syncthing service as described in the notes.
Once Syncthing is installed, use the getting started guide for a detailed walk-through on how to set it up and share a folder. Your local computer is now ready to sync. Next, we set up the Raspberry Pi.
- Install Raspberry Pi OS Lite 32-bit on your Pi's SD card. It's available from within Raspberry Pi Imager. If the Imager fails to write the SD-Card successfully, you can download the ISO directly from Raspberry Pi and flash the SD-Card using Balena Etcher instead.
- Insert the SD-Card into the Pi. If your Pi uses Ethernet, connect the LAN cable.
- Boot the Pi and let it do its thing. The Pi will prompt you to create a user account and connect to Wi-Fi unless you pre-configured settings using RPi Imager. Once that's done, you should be left at a prompt.
- Run
raspi-config
and enable automatic login. Also configure your Pi’s hostname, network, language, or other settings you need. If configuring Wi-Fi withraspi-config
fails, you can configure Wi-Fi withnmtui
instead. - Update the Pi.
sudo apt update && sudo apt upgrade
. If you're on a Zero 2W, go have a coffee. The Pi may appear to freeze at times, but be patient. - Install VLC, which will also install X11 and other dependencies so the Pi can display the video:
sudo apt install vlc
.
- Add the release PGP keys:
sudo mkdir -p /etc/apt/keyrings sudo curl -L -o /etc/apt/keyrings/syncthing-archive-keyring.gpg https://syncthing.net/release-key.gpg
- Add the "stable" channel to your APT sources. Yes, that whole thing is one command:
echo "deb [signed-by=/etc/apt/keyrings/syncthing-archive-keyring.gpg] https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list
- Update and install Syncthing:
sudo apt update
andsudo apt install syncthing
- Configure the Syncthing service, replacing "username" with the name of the Pi user that you set up in Step 2:
sudo systemctl enable syncthing@username.service
and thensudo systemctl start syncthing@username.service
Syncthing requires you to configure the local host via a locally generated web page, but since we have no web browser installed on the Pi, we configure Syncthing to allow us to access it from another computer on the LAN.
- Navigate to
/home/username/.local/state/syncthing
. Editconfig.xml
using your favorite text editor. - Change the IP address to
0.0.0.0
to enable remote access to the GUI. - Save and close, then
sudo systemctl restart syncthing@username.service
, remembering to replace "username" with the name of the user you created in Step 2. - Get your Pi's IP address. You can use
ip addr
orifconfig
to display it.
- View the Pi’s Syncthing web page from your main computer (or any other computer on the LAN) using a browser with the IP address you noted in Step 4 above:
<Pi-ip-address>:8384
- Go to Settings and give yourself the same username and password as on your main computer.
- Click on the Add Remote Device button. Your Pi's Device ID should already be present in the window. Click on the ID to select it, type in your Pi's name below, then click Save.
- After a moment, you will see a notification on the Pi's configuration page that your main computer wants to connect. Choose Add Device, then click Save.
- On your main computer, copy the video you want to share to the Pi into the shared folder. It should begin syncing momentarily.
On the Pi, use VLC to play the video to confirm operation. Navigate to the shared folder location and run the command to launch VLC: vlc filename.m4v
If you're using Wi-Fi at the remote location, you'll have to bring a keyboard for the Pi so you can reconfigure the network settings at the remote location. Use raspi-config
to reconfigure the Wi-fi and reboot.
- Edit the Pi’s
.bashrc
file and add the command to autoplay the movie at boot to the end of the file:cvlc /home/username/sharedfoldername/filename.m4v --quiet --loop --no-video-title
. Thecvlc
command removes the playback controls. To mute the audio, add--noaudio
to the command. - Reboot the Pi. The video should play automatically.
Multiple file video playback is possible using a playlist in VLC instead of the file name in the command to start VLC. I have not tested this, however, so YMMV. See the VLC command-line wiki for more information.
VLC allows for playback on multiple displays is possible, but is outside the scope of this guide. See the VLC command-line wiki for more information.
To update the video on the Pi, just overwrite the video file on the host computer’s shared folder. Syncthing will push the updated file to the Pi, and VLC will play the update file on the next loop.
When syncing multiple Pi’s be sure to give each one a unique name when setting it up. You use the exact same configuration procedure as above for each Pi. To save time when setting up multiple Pi’s you can clone the SD card right after installing VLC, so the only steps required would be to install and configure Syncthing on each Pi you want to use.