Skip to content

Instantly share code, notes, and snippets.

@henriqueutsch
Last active August 29, 2015 14:13
Show Gist options
  • Save henriqueutsch/b8dd875037442ca74f81 to your computer and use it in GitHub Desktop.
Save henriqueutsch/b8dd875037442ca74f81 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Instalação em uma única linha
# wget https://gist.githubusercontent.com/henriqueutsch/b8dd875037442ca74f81/raw/5e9bdbc149b4 0d2db8ed4d1d000f0f2a4583d547/install_raspcam.sh;chmod +x install_raspcam.sh;./install_raspcam.sh
# https://miguelmota.com/blog/raspberry-pi-camera-board-video-streaming/
# Enable Camera
# sudo raspi-config
# habilitar cam
# Update system
sudo apt-get update
# Install dependences and MJPEG
sudo apt-get install -y sockstat libjpeg8-dev imagemagick subversion cmake
# Make and change into directory.
sudo mkdir /opt/mjpg-streamer
cd /opt/mjpg-streamer/
# Download MJPG Streamer into the current directory.
sudo svn co https://svn.code.sf.net/p/mjpg-streamer/code/mjpg-streamer/ .
# Run make.
sudo make clean all
# Make a directory to store the temporary images.
sudo mkdir /tmp/stream/
# Make the directory writable.
sudo chmod a+rw /tmp/stream/
# Install raspicam dependence
sudo apt-get install -y libjpeg62-dev
# Download mjpg-streamer with raspicam plugin
git clone https://github.com/jacksonliam/mjpg-streamer.git ~/mjpg-streamer
# Change directory
cd ~/mjpg-streamer/mjpg-streamer-experimental
# Compile
sudo make clean all
# Replace old mjpg-streamer
sudo rm -rf /opt/mjpg-streamer
sudo mv ~/mjpg-streamer/mjpg-streamer-experimental /opt/mjpg-streamer
sudo rm -rf ~/mjpg-streamer
# Begin streaming
LD_LIBRARY_PATH=/opt/mjpg-streamer/ /opt/mjpg-streamer/mjpg_streamer -i "input_raspicam.so -fps 15 -q 50 -x 640 -y 480" -o "output_http.so -p 9000 -w /opt/mjpg-streamer/www -c pi:raspberry" &
# instala start_stream
cd
wget https://gist.githubusercontent.com/miguelmota/9201942/raw/8e1f3dc3d2785b92f338cc1494ca21d14f821964/start_stream.sh
# instala stop_stream
cd
wget https://gist.githubusercontent.com/miguelmota/9201942/raw/c9bbb2deef7ebea4703f05c36eceb27dde2680ab/stop_stream.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment