Making a video installation with Raspberry Pi

From Interaction Station Wiki
Jump to navigation Jump to search

Prepare the SD card

This tool has been tested on the following Raspberry PI models:

  • Raspberry Pi 1
  • Raspberry Pi 2
  • Raspberry Pi 3
  • Raspberry Pi 4
  • Raspberry Pi Zero W
  • Syncing multiple video channels via Ethernet is possible with the models with Ethernet (Raspberry Pi 1, 2, 3 & 4)
  • Syncing multiple video channels via WiFi is possible with the models with integrated WiFi (Raspberry Pi 3, 4 and Zero W)

Download and burn the image

Ask for the image at the Interaction Station's office. You will need a 32GB SD card: File name:video_multi_channel_sync_pi_4_2020.img

Download etcher https://www.balena.io/etcher/

Use Etcher to flash the SD card with the image


Configure the Raspberry Pi for playing a video on a loop

Connect the Pi to a screen, keyboard and mouse:

  • Notes on Raspberry Pi 4:
  • The Raspberry Pi 4 has two HDMI (micro HDMI) outputs. You will need to use "HDMI0", that is the left output next to the power connector.


Insert the SD card that you just flashed in the Pi.

Plug in the power adapter.

When you see a video playing press repeatedly the keys CRTL and C (at the same time) to escape the looping video.

To get into the graphic interface type:

startx

and hit the key Enter.

Insert a USB stick with your video (video coded: H264, the file name shouldn't contain spaces or non alphanumerical characters)

Go to “File Manager”

Search for your video in folder /media/root/PEN_FAT32

Copy your video and place it in /home/pi/video-sync-loop/videos

Go back to the folder video-sync-loop and edit video-sync.config

adjust the configuration so that it says:

playback_mode=loop

Name the video in:

Video_filename=yourvideoname.mp4

Save the file

Restart the Pi by typing:

sudo reboot now

And pressing the key 'Enter'. Your video should automatically start looping after rebooting

Configure multiple Raspberry Pis for playing multiple videos in sync

Notes:

  • You need as many Raspberry Pis as videos.
  • All Raspberry Pis should be the same model.
  • The video should be the same in all Pis.
  • The Pis will act as either conductor or follower.
  • There can only be one conductor. There might be one or multiple followers.

Conductor

Change the config file:

 cd /home/pi/video-sync-loop/
 nano video-sync config

Look for is_conductor and set it to true:

 is_conductor=true

Synchronising the Pi units via WiFi

Then type:

 nano /etc/network/interfaces.d/wlan0

Look for the line that starts with address, and set it to:

 address 172.24.1.1

Synchronising the Pi units via Ethernet

Type:

 sudo nano /etc/dhcpcd.conf  and type:

Look for the line that starts with static ip_address, and set it to:

static ip_address=192.168.1.1/24

Followers

Change the config file:

 cd /home/pi/video-sync-loop/
 nano video-sync config

Look for is_conductor and set it to false:

 is_conductor=false

Synchronising the Pi units via WiFi

Type:

 nano /etc/network/interfaces.d/wlan0

Look for the line that starts with address, and set it to:

 address 172.24.1.2

(Only if there is only one follower. Otherwise increment this number (172.24.1.3, 172.24.1.4, etc) for the other followers)

Synchronising the Pi units via Ethernet

Type:

sudo nano /etc/dhcpcd.conf  

Look for the line that starts with static ip_address, and set it to:

static ip_address=192.168.1.2/24

(Only if there is only one follower. Otherwise increment this number (172.24.1.3, 172.24.1.4, etc) for the other followers)

Other options in the config file

To edit the config file, in the terminal:

 cd /home/pi/video-sync-loop/
 nano video-sync config

Selecting the Audio output

By default the sound will come out of the Audio jack of the Pi (you need to connect an amplified speaker to it). In case you'd like to have the audio played via HDMI you need to change the line:

audio_out=headphone_jack

to: audio_out=hdmi

And save the file. If you use nano as an editor, you can save the changes by pressing the keys CTRL and X at the same time and pressing the key Enter to confirm.