2

I seem to be having trouble getting this to work, I'm trying to run mjpg-streamer when the Raspberry boots, but it doesn't using the script below. I have mjpg-streamer installed in: /home/pi/mjpg-streamer/mjpg-streamer

I appreciate any help provided! Thank you.

Code:

#!/bin/sh

STREAMER=/home/pi/mjpg-streamer/mjpg-streamer/mjpg_streamer
DEVICE=/dev/video0
RESOLUTION=320x240
FRAMERATE=25
HTTP_PORT=8080

$STREAMER -i "./input_uvc.so -n -d $DEVICE -r $RESOLUTION -f $FRAMERATE" -o "./output_http.so -n -p $HTTP_PORT"
  • does this script work when run manually? how did you make this script to run at boot time? – lenik May 17 '13 at 2:49
2

I fixed it after trial and error:

#!/bin/sh

STREAMER=/home/pi/mjpg-streamer/mjpg-streamer/mjpg_streamer
DEVICE=/dev/video0
RESOLUTION=320x240
FRAMERATE=25
HTTP_PORT=8080

$STREAMER -i "/home/pi/mjpg-streamer/mjpg-streamer/input_uvc.so -n -d $DEVICE -r 
$RESOLUTION -f $FRAMERATE" -o "/home/pi/mjpg-streamer/mjpg-streamer/output_http.so -n -p 
$HTTP_PORT"
  • does this script work with the raspberry camera module? – Piotr Kula May 17 '13 at 7:33
  • @troop231: How you actually make it so start from boot ? Can you specify what command you've used ? – el.severo Jun 20 '13 at 22:48
0

you most definitely should replace ./input_uvc.so in your script with the full-path links, because most probably it's not going to be started from your home directory or whatever place you think it might be started from.

0

What I've used and it works for me is:

#!/bin/sh
#
# created by : meinside@gmail.com
#
# last update: 2014.01.24.
#

################
# customize these:

# mjpg_streamer's install location
MJPG_STREAMER_INSTALL="/home/pi/builds/mjpg-streamer"

# mjpg_streamer excutable's location
MJPG_STREAMER="$MJPG_STREAMER_INSTALL/mjpg_streamer"

# streaming port
MJPG_STREAMER_PORT="8080"

# htmls and related files' location
MJPG_STREAMER_WWW="$MJPG_STREAMER_INSTALL/www"

# video device
DEVICE_IN="/dev/video0"

# video settings
RESOLUTION="640x480"
FPS=24

# authentication
USERNAME="pi"
PASSWORD="raspberry"
if [ ! -z $USERNAME ] && [ ! -z $PASSWORD ]; then
    AUTH="-c $USERNAME:$PASSWORD"
else
    AUTH=""
fi

# LED blink
LED="off"   # on/off/blink/auto (may not work on rpi camera modules)

# plugin
PLUGIN_IN="$MJPG_STREAMER_INSTALL/input_uvc.so -d $DEVICE_IN -r $RESOLUTION -f $FPS -l $LED"
PLUGIN_OUT="$MJPG_STREAMER_INSTALL/output_http.so -p $MJPG_STREAMER_PORT -w $MJPG_STREAMER_WWW $AUTH"



################
# run mjpg_streamer
$MJPG_STREAMER -i "$PLUGIN_IN" -o "$PLUGIN_OUT"
################

Follow along these steps in order to make it work

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.