-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from reinzor/feat/stretch_mmalvideosink
Raspbian Stretch with GST-MMAL Videosink
- Loading branch information
Showing
10 changed files
with
105 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,86 +14,47 @@ Video wall with multiple tiles that enables synchronized video playback, mirrore | |
|
||
## Installation | ||
|
||
### Raspberry PI installation | ||
### Raspberry PI | ||
|
||
#### Installation prerequisites | ||
|
||
- Raspbian Jessie | ||
- Raspbian Stretch Lite | ||
- Raspberry Pi 3 / Raspberry Pi Zero (other Pi's not tested) | ||
- Videowall repository is your current working directory | ||
|
||
#### Installation dependencies | ||
#### Installation | ||
|
||
Install debian requirements: | ||
Installs the videowall and enables a client service on startup. | ||
|
||
``` | ||
sudo apt-get -y install x-window-system \ | ||
gstreamer1.0-tools \ | ||
gstreamer1.0-plugins-good \ | ||
gstreamer1.0-plugins-bad \ | ||
gstreamer1.0-plugins-ugly \ | ||
gstreamer1.0-omx \ # rpi | ||
gstreamer1.0-libav \ # pc | ||
gir1.2-gst-plugins-base-1.0 \ | ||
python-gst-1.0 \ | ||
pulseaudio \ | ||
python-colorlog | ||
./install_raspberry_pi_stretch_lite_autostart.bash | ||
``` | ||
|
||
Make sure `gstreamer is working properly` by downloading and playing an x264 encoded sample video: | ||
### Ubuntu x86 | ||
|
||
``` | ||
wget https://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_30mb.mp4 -O $HOME/Videos/big_buck_bunny_720p_30mb.mp4 | ||
gst-launch-1.0 filesrc location=$HOME/Videos/big_buck_bunny_720p_30mb.mp4 ! qtdemux ! h264parse ! omxh264dec ! videoconvert ! queue ! ximagesink # rpi | ||
gst-launch-1.0 filesrc location=$HOME/Videos/big_buck_bunny_720p_30mb.mp4 ! decodebin ! videoconvert ! queue ! ximagesink # pc | ||
``` | ||
|
||
Install pip requirements: | ||
|
||
``` | ||
pip install --user -r requirements.txt | ||
``` | ||
|
||
#### Set-up videowall | ||
|
||
Enable the x-server on startup: | ||
|
||
``` | ||
sudo cp systemd/startx/override.conf /etc/systemd/system/[email protected]/ | ||
sudo systemctl daemon-reload | ||
sudo systemctl restart [email protected] | ||
``` | ||
|
||
If everything went well, the x server should now be running and you should see a black screen with a small green font: `pi@raspberrypi`. | ||
|
||
Add the following to `/etc/X11/xinit/xinitrc` after the first line to disable screen blanking: | ||
``` | ||
xset s off # don't activate screensaver | ||
xset -dpms # disable DPMS (Energy Star) features. | ||
xset s noblank # don't blank the video device | ||
``` | ||
#### Installation prerequisites | ||
|
||
Set boot config RPI so we can use more GPU memory (not sure whether this has any effect): | ||
``` | ||
echo "gpu_mem = 386MB" | sudo tee -a /boot/config.txt | ||
``` | ||
- Ubuntu x86 16.04 LTS (other versions not tested) | ||
- Videowall repository is your current working directory | ||
|
||
We should also net forget to set the `$DISPLAY` environment variable in order to connect with the `x-server` properly: | ||
#### Installation | ||
|
||
``` | ||
export DISPLAY=:0 | ||
./install_ubuntu_x86.bash | ||
``` | ||
|
||
## Quick start | ||
|
||
### Server | ||
|
||
scripts/server | ||
|
||
### Client | ||
|
||
scripts/client | ||
|
||
This is automaticall started on a raspberry pi after installation. Can be manually started on an ubuntu x86 environment. | ||
|
||
## References | ||
|
||
- [Cinder GST Sync Player](https://github.com/patrickFuerst/Cinder-GstVideoSyncPlayer) | ||
|
@@ -109,3 +70,5 @@ export DISPLAY=:0 | |
- [dbus omxplayer](https://github.com/popcornmix/omxplayer) | ||
- [GPU memory 90 degrees omxplayer](https://github.com/popcornmix/omxplayer/issues/467) | ||
- [Remote dbus control](https://stackoverflow.com/questions/10158684/connecting-to-dbus-over-tcp/13275973#13275973) | ||
- [GST OMX](https://github.com/GStreamer/gst-omx) | ||
- [GST MMAL](https://github.com/youviewtv/gst-mmal) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 "======" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Install system dependencies | ||
sudo apt-get -y update | ||
sudo apt-get -y install git \ | ||
gstreamer1.0-plugins-base-apps \ | ||
gstreamer1.0-plugins-good \ | ||
gstreamer1.0-plugins-bad \ | ||
python-pip | ||
|
||
# Install python dependencies | ||
sudo -H pip install -r requirements.txt | ||
|
||
# Create videos folder and download sample video | ||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" | ||
wget https://github.com/reinzor/videowall/releases/download/0/big_buck_bunny_720p_30mb.mp4 -O $SCRIPT_DIR/videos/videos/big_buck_bunny_720p_30mb.mp4 | ||
|
||
# Setup paths in bashrc | ||
echo "source $SCRIPT_DIR/setup.bash" >> ~/.bashrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
export PYTHONPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"/src | ||
export DISPLAY=:0 | ||
export GST_DEBUG=1 | ||
|
||
export GST_PLUGIN_PATH=/usr/local/lib/gstreamer-1.0:/usr/lib/arm-linux-gnueabihf/gstreamer-1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* |