-
Notifications
You must be signed in to change notification settings - Fork 26
/
install_raspberry_pi_stretch_lite_autostart.bash
executable file
·54 lines (45 loc) · 2.18 KB
/
install_raspberry_pi_stretch_lite_autostart.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
# Install system dependencies
sudo apt-get -y update
sudo apt-get -y install git \
libgstreamer-plugins-base1.0-dev \
gstreamer1.0-plugins-base-apps \
gstreamer1.0-tools \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad \
python-pip
# Install python dependencies
sudo -H pip install -r requirements.txt
# Build & Install Gstreamer MMAL
git clone https://github.com/reinzor/gst-mmal /tmp/gst-mmal
cd /tmp/gst-mmal
LDFLAGS='-L/opt/vc/lib' CPPFLAGS='-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux' ./autogen.sh --disable-gtk-doc
make
sudo make install
# Build & Install Gstreamer OMX
git clone https://github.com/reinzor/gst-omx /tmp/gst-omx
cd /tmp/gst-omx
git checkout 1.10.4
LDFLAGS='-L/opt/vc/lib' CFLAGS='-I/opt/vc/include -I/opt/vc/include/IL -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/IL' CPPFLAGS='-I/opt/vc/include -I/opt/vc/include/IL -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/IL' ./autogen.sh --disable-gtk-doc --with-omx-target=rpi
make
sudo make install
# Create videos folder and download sample video
wget https://github.com/reinzor/videowall/releases/download/0/big_buck_bunny_720p_30mb.mp4 -O $SCRIPT_DIR/videos/big_buck_bunny_720p_30mb.mp4
# Setup paths in bashrc
echo "source $SCRIPT_DIR/setup.bash" >> ~/.bashrc
# Copy additional raspberry pi system files
sudo rm /etc/network/mac
sudo cp -r $SCRIPT_DIR/cfg/rpi/* /
# Enable startup run and disable dhcpcd
sudo systemctl daemon-reload
sudo systemctl enable videowall
sudo systemctl disable dhcpcd
# Show installation done message
echo "======="
echo ""
echo "Installation complete, please source your ~/.bashrc and type the following command:"
echo ""
echo " gst-launch-1.0 -v filesrc location=$SCRIPT_DIR/videos/big_buck_bunny_720p_30mb.mp4 ! qtdemux ! h264parse ! omxh264dec ! videocrop bottom=10 ! mmalvideosink"
echo ""
echo "======"