-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #250 from OctoPrint/revert-multiple-mjpeg
revert #245
- Loading branch information
Showing
1 changed file
with
5 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,15 @@ | ||
#!/usr/bin/with-contenv bash | ||
#!/usr/bin/with-contenv sh | ||
|
||
if [ -n "$MJPEG_STREAMER_INPUT" ]; then | ||
echo "Deprecation warning: the environment variable '\$MJPEG_STREAMER_INPUT' was renamed to '\$MJPG_STREAMER_INPUT'" | ||
|
||
MJPG_STREAMER_INPUT=$MJPEG_STREAMER_INPUT | ||
fi | ||
|
||
if ! expr "$MJPG_STREAMER_INPUT" : ".*\.so.*" >/dev/null; then | ||
if ! expr "$MJPG_STREAMER_INPUT" : ".*\.so.*" > /dev/null; then | ||
MJPG_STREAMER_INPUT="input_uvc.so $MJPG_STREAMER_INPUT" | ||
fi | ||
|
||
# Loop through all camera devices and start mjpg_streamer for each | ||
IFS=',' read -ra CAMERA_DEVS <<<"$CAMERA_DEV" | ||
COUNTER=0 | ||
for CAMERA in "${CAMERA_DEVS[@]}"; do | ||
# start from port 8080 and increment for each camera | ||
PORT=$((8080 + "$COUNTER")) | ||
((COUNTER++)) | ||
echo "Starting mjpg_streamer for camera device $CAMERA on port $PORT" | ||
|
||
# Start mjpg_streamer | ||
mjpg_streamer -b \ | ||
-i "/usr/local/lib/mjpg-streamer/${MJPG_STREAMER_INPUT} -d ${CAMERA}" \ | ||
-o "/usr/local/lib/mjpg-streamer/output_http.so -w /usr/local/share/mjpg-streamer/www -p ${PORT}" | ||
done | ||
exec mjpg_streamer \ | ||
-i "/usr/local/lib/mjpg-streamer/$MJPG_STREAMER_INPUT -d $CAMERA_DEV" \ | ||
-o "/usr/local/lib/mjpg-streamer/output_http.so -w /usr/local/share/mjpg-streamer/www -p 8080" |