@@ -93,21 +93,36 @@ run_spyglass() {
9393 bind_adress=" 0.0.0.0"
9494 fi
9595
96+ if [[ " ${USE_SW_JPG_ENCODING:- false} " == " true" ]]; then
97+ use_sw_jpg_encoding=" --use_sw_jpg_encoding"
98+ else
99+ use_sw_jpg_encoding=" "
100+ fi
101+
102+ if [[ " ${DISABLE_WEBRTC:- false} " == " true" ]]; then
103+ disable_webrtc=" --disable_webrtc"
104+ else
105+ disable_webrtc=" "
106+ fi
107+
96108 " ${PY_BIN} " " $( dirname " ${BASE_SPY_PATH} " ) /run.py" \
97109 --camera_num " ${CAMERA_NUM:- 0} " \
98110 --bindaddress " ${bind_adress} " \
99111 --port " ${HTTP_PORT:- 8080} " \
100112 --resolution " ${RESOLUTION:- 640x480} " \
101113 --fps " ${FPS:- 15} " \
102- --stream_url " ${STREAM_URL:- \/ stream} " \
103- --snapshot_url " ${SNAPSHOT_URL:- \/ snapshot} " \
114+ --stream_url " ${STREAM_URL:-/ stream} " \
115+ --snapshot_url " ${SNAPSHOT_URL:-/ snapshot} " \
116+ ${use_sw_jpg_encoding} \
117+ --webrtc_url " ${WEBRTC_URL:-/ webrtc} " \
118+ ${disable_webrtc} \
104119 --autofocus " ${AUTO_FOCUS:- continuous} " \
105120 --lensposition " ${FOCAL_DIST:- 0.0} " \
106121 --autofocusspeed " ${AF_SPEED:- normal} " \
107122 --orientation_exif " ${ORIENTATION_EXIF:- h} " \
108123 --tuning_filter " ${TUNING_FILTER:- } " \
109124 --tuning_filter_dir " ${TUNING_FILTER_DIR:- } " \
110- --controls-string " ${CONTROLS:- 0=0} " & # 0=0 to prevent error on empty string
125+ --controls-string " ${CONTROLS:- 0=0} " # 0=0 to prevent error on empty string
111126}
112127
113128# ### MAIN
@@ -140,13 +155,7 @@ check_py_version
140155get_config
141156run_spyglass
142157
143- # ## Wait for termination request
144- pid=$!
145-
146- onSigTerm () {
147- kill -TERM " $pid " 2> /dev/null
148- }
149- trap onSigTerm SIGTERM
150-
151- wait " $pid "
152-
158+ # ## Loop to keep running
159+ while true ; do
160+ sleep 1
161+ done
0 commit comments