Skip to content

Instantly share code, notes, and snippets.

@malefs
Forked from miguelmota/start_stream.sh
Created May 5, 2014 13:22
Show Gist options
  • Select an option

  • Save malefs/067164606d71638c03ba to your computer and use it in GitHub Desktop.

Select an option

Save malefs/067164606d71638c03ba to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ ! -d /tmp/stream ]
then
mkdir /tmp/stream/
fi
if pgrep raspistill > /dev/null
then
echo "raspistill already running"
else
raspistill -w 640 -h 480 -q 5 -o /tmp/stream/pic.jpg -tl 100 -t 9999999 -th 0:0:0 -n > /dev/null 2>&1&
echo "raspistill started"
fi
if pgrep mjpg_streamer > /dev/null
then
echo "mjpg_streamer already running"
else
LD_LIBRARY_PATH=/opt/mjpg-streamer/ /opt/mjpg-streamer/mjpg_streamer -i "input_file.so -f /tmp/stream -n pic.jpg" -o "output_http.so -p 9000 -w /opt/mjpg-streamer/www" > /dev/null 2>&1&
echo "mjpg_streamer started"
fi
#!/bin/bash
if pgrep raspistill
then
kill $(pgrep raspistill) > /dev/null 2>&1
echo "raspistill stopped"
else
echo "raspistill not running"
fi
if pgrep mjpg_streamer
then
kill $(pgrep mjpg_streamer) > /dev/null 2>&1
echo "mjpg_streamer stopped"
else
echo "mjpg_streamer not running"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment