Skip to content

Instantly share code, notes, and snippets.

@chazcheadle
Created August 19, 2016 16:29
Show Gist options
  • Select an option

  • Save chazcheadle/fa6e137592d510e21ef482de692afde7 to your computer and use it in GitHub Desktop.

Select an option

Save chazcheadle/fa6e137592d510e21ef482de692afde7 to your computer and use it in GitHub Desktop.
mjpg_streamer: Out put http and file to custom directory
#!/bin/sh
# Check for image directory and create it if it doesn't exist.
s=${0##*/}
image_dir="/tmp/${s%.*}"
if [ ! -d $image_dir ]
then
mkdir $image_dir
echo "Created $image_dir.";
fi
# Remove any old image files.
rm -rf $image_dir/*
mjpg_streamer -i "/usr/local/lib/mjpg-streamer/input_uvc.so -f 10 -r 960x540 -l off" \
--output "/usr/local/lib/mjpg-streamer/output_http.so -w /var/www2 -p 8091" \
--output "/usr/local/lib/mjpg-streamer/output_file.so -f $image_dir -d 3000 -s 1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment