@@ -11,14 +11,16 @@ export LC_ALL=C
11
11
12
12
source /common.sh
13
13
14
- if [ -n " $OCTOPI_APTMIRROR " ];
14
+ if [ -n " $OCTOPI_APTMIRROR " ];
15
15
then
16
16
echo " Switching apt mirror in /etc/apt/sources.list to $OCTOPI_APTMIRROR "
17
17
cp /etc/apt/sources.list /etc/apt/sources.list.backup
18
18
sed -i " s@http://raspbian.raspberrypi.org/raspbian/@$OCTOPI_APTMIRROR @g" /etc/apt/sources.list
19
19
fi
20
20
21
21
WEBCAM_USER=webcam
22
+ FFMPEG_HLS_COMMIT=c6fdbe26ef30fff817581e5ed6e078d96111248a
23
+ FFMPEG_HLS_DIR=/opt/ffmpeg-hls
22
24
23
25
# ## Script ####
24
26
@@ -66,7 +68,7 @@ pushd /home/"${BASE_USER}"
66
68
apt-get -y --force-yes install libjpeg8-dev
67
69
fi
68
70
fi
69
-
71
+
70
72
apt-get -y --force-yes --no-install-recommends install imagemagick ffmpeg libv4l-dev
71
73
72
74
wget $OCTOPI_MJPGSTREAMER_ARCHIVE -O mjpg-streamer.zip
@@ -120,11 +122,32 @@ EOT
120
122
# FFMPEG HLS
121
123
if [ " $OCTOPI_INCLUDE_FFMPEG_HLS " == " yes" ]
122
124
then
123
- apt-get install -y --force-yes --no-install-recommends ffmpeg nginx
125
+ apt-get install -y --force-yes --no-install-recommends nginx
126
+
127
+ FFMPEG_BUILD_DIR=$( mktemp -d)
128
+ pushd ${FFMPEG_BUILD_DIR}
129
+ FFMPEG_ARCHIVE=ffmpeg.tar.gz
130
+ wget https://api.github.com/repos/FFmpeg/FFmpeg/tarball/${FFMPEG_COMMIT} -O ${FFMPEG_ARCHIVE}
131
+ tar xvzf ${FFMPEG_ARCHIVE}
132
+ cd FFmpeg*
133
+ ./configure \
134
+ --disable-doc \
135
+ --disable-htmlpages \
136
+ --disable-manpages \
137
+ --disable-podpages \
138
+ --disable-txtpages \
139
+ --disable-ffplay \
140
+ --disable-ffprobe
141
+ make -j$( nproc)
142
+ mkdir -p ${FFMPEG_HLS_DIR}
143
+ cp ffmpeg ${FFMPEG_HLS_DIR}
144
+ popd
145
+ rm -r ${FFMPEG_BUILD_DIR}
146
+
124
147
useradd ${WEBCAM_USER}
125
148
usermod -aG video ${WEBCAM_USER}
126
149
fi
127
-
150
+
128
151
# CuraEngine
129
152
if [ " $OCTOPI_INCLUDE_CURAENGINE " == " yes" ]
130
153
then
151
174
152
175
# fetch current yq build and install to /usr/local/bin
153
176
wget -O yq $OCTOPI_YQ_DOWNLOAD && chmod +x yq && mv yq /usr/local/bin
154
-
177
+
155
178
popd
156
179
157
180
# Make sure user pi / ${BASE_USER} has access to serial ports
197
220
done
198
221
199
222
for ip in $(hostname -I);
200
- do
223
+ do
201
224
echo " http://$ip"
202
225
done
203
226
204
227
echo
205
228
echo "https is also available, with a self-signed certificate."
206
- echo
229
+ echo
207
230
echo "------------------------------------------------------------"
208
231
echo
209
232
EOT
@@ -276,7 +299,7 @@ systemctl_if_exists enable streamer_select.service
276
299
if [ " $OCTOPI_INCLUDE_MJPGSTREAMER " == " yes" ]
277
300
then
278
301
systemctl_if_exists enable webcamd.service
279
- # ## use legacy camera stack on bullseye for now
302
+ # ## use legacy camera stack on bullseye for now
280
303
if grep " camera_auto_detect=1" /boot/config.txt
281
304
then
282
305
sed -i " s/camera_auto_detect=1/camera_auto_detect=0/g" /boot/config.txt
@@ -304,7 +327,7 @@ apt-get -y install avrdude
304
327
apt-get clean
305
328
apt-get autoremove -y
306
329
307
- if [ -n " $OCTOPI_APTMIRROR " ];
330
+ if [ -n " $OCTOPI_APTMIRROR " ];
308
331
then
309
332
echo " Reverting /etc/apt/sources.list"
310
333
mv /etc/apt/sources.list.backup /etc/apt/sources.list
0 commit comments