Difference between revisions of "Making a video installation with Raspberry Pi"

From Interaction Station Wiki
Jump to navigation Jump to search
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Prepare the SD card==
+
=Prepare the SD card=
  
''This procedure works for Raspberry PI 3 and Zero.''
+
''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
  
Download the image  
+
*Syncing multiple video channels via Ethernet is possible with the models with Ethernet  (Raspberry Pi 1, 2, 3 & 4)
http://interactionstation.wdka.hro.nl/downloads/video_multi_channel_sync.img
+
*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 =
 +
 
 +
Download the image:
 +
http://interactionstation.wdka.hro.nl/downloads/video_multi_channel_sync_pi_4_2020.img
  
 
Download etcher
 
Download etcher
Line 11: Line 21:
 
Use Etcher to flash the SD card with the image
 
Use Etcher to flash the SD card with the image
  
== Configure raspberry pi for videolooping ==
 
  
connect raspberry pi to a screen and keyboard + mouse
+
= Configure the Raspberry Pi for playing 1 video on a loop =
then plug in the power.  
+
 
 +
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.
 +
 
  
When Raspberry starts up press esc, ctrl+d or ctrl+c to escape the looping video.
+
Insert the SD card that you just flashed in the Pi.
  
To get into graphic interface type “startx” and hit Enter
+
Plug in the power adapter.
  
insert a USB stick with your video
+
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”
 
Go to “File Manager”
Line 30: Line 49:
 
Go back to the folder video-sync-loop and edit video-sync.config
 
Go back to the folder video-sync-loop and edit video-sync.config
  
adjust the configuration so that it says
+
adjust the configuration so that it says:
playback_mode=loop
+
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)
  
Name the video in
+
= Other options in the config file =
Video_filename=yourvideoname
 
  
save the file
+
To edit the config file, in the terminal:
 +
  cd /home/pi/video-sync-loop/
 +
  nano video-sync config
  
restart the Pi and your video should automatically start looping
+
= Selecting the Audio output =
  
== configure raspberry pi for syncing ==
+
By default the sound will come out of the Audio jack of the Pi (you need to connect an amplified speaker to it).
setup wifi
+
In case you'd like to have the audio played via HDMI you need to change the line:
host …
+
audio_out=headphone_jack
master
+
to:
slaves
+
audio_out=hdmi
  
==Notes on Pi 4==
+
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.
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.
 

Revision as of 11:51, 30 June 2020

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

Download the image: http://interactionstation.wdka.hro.nl/downloads/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 1 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.