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"
asked May 17, 2013 at 1:49
1
  • does this script work when run manually? how did you make this script to run at boot time? Commented May 17, 2013 at 2:49

4 Answers 4

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"
answered May 17, 2013 at 3:29
2
  • does this script work with the raspberry camera module? Commented May 17, 2013 at 7:33
  • @troop231: How you actually make it so start from boot ? Can you specify what command you've used ? Commented Jun 20, 2013 at 22:48
1

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

#!/bin/sh
#
# created by : [email protected]
#
# 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

answered Jun 15, 2014 at 22:35
1

I solved it by adding this to rc.local

enter image description here

answered Apr 18, 2022 at 7:52
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.

answered May 17, 2013 at 2:51

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.