diff options
author | Guy Sheffer <guysoft@gmail.com> | 2022-07-15 13:57:58 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-15 13:57:58 +0300 |
commit | 3c859be9fd0d09c896ddb609f337c46044835007 (patch) | |
tree | 844ec4c694b2e05bd0555820073d68c283c761e4 | |
parent | 7d57995e41fa2f1bb5e637cb7431578c69650397 (diff) |
Revert "HLS V4L2 M2M encoder"revert-784-feature/hls-v4l2m2m
-rw-r--r-- | src/modules/octopi/filesystem/root/etc/systemd/system/ffmpeg_hls.service | 6 | ||||
-rwxr-xr-x | src/modules/octopi/start_chroot_script | 41 |
2 files changed, 12 insertions, 35 deletions
diff --git a/src/modules/octopi/filesystem/root/etc/systemd/system/ffmpeg_hls.service b/src/modules/octopi/filesystem/root/etc/systemd/system/ffmpeg_hls.service index 3a1f463..2b15d8d 100644 --- a/src/modules/octopi/filesystem/root/etc/systemd/system/ffmpeg_hls.service +++ b/src/modules/octopi/filesystem/root/etc/systemd/system/ffmpeg_hls.service @@ -18,7 +18,7 @@ ExecStartPre=/bin/chown -R webcam:webcam /run/webcam ExecStartPre=/bin/chmod -R 0755 /run/webcam ExecStart=/usr/bin/sudo -u webcam \ - /opt/ffmpeg-hls/ffmpeg \ + /usr/bin/ffmpeg \ \ -framerate 30 -video_size 640x480 \ -i /dev/video0 \ @@ -28,7 +28,7 @@ ExecStart=/usr/bin/sudo -u webcam \ -f image2 -r 1 -update 1 -atomic_writing 1 \ /run/webcam/jpeg/frame.jpg \ \ - -c:v h264_v4l2m2m -level:v 4.0 \ + -c:v h264_omx -profile:v high \ -b:v 1264k -flags +cgop \ -g 30 -keyint_min 30 \ \ @@ -40,7 +40,7 @@ ExecStart=/usr/bin/sudo -u webcam \ \ -vf scale=-1:240 \ \ - -c:v h264_v4l2m2m -level:v 4.0 \ + -c:v h264_omx -profile:v high \ -b:v 240k -flags +cgop \ -g 30 -keyint_min 30 \ \ diff --git a/src/modules/octopi/start_chroot_script b/src/modules/octopi/start_chroot_script index 91e08e9..7c3b03f 100755 --- a/src/modules/octopi/start_chroot_script +++ b/src/modules/octopi/start_chroot_script @@ -11,7 +11,7 @@ export LC_ALL=C source /common.sh -if [ -n "$OCTOPI_APTMIRROR" ]; +if [ -n "$OCTOPI_APTMIRROR" ]; then echo "Switching apt mirror in /etc/apt/sources.list to $OCTOPI_APTMIRROR" cp /etc/apt/sources.list /etc/apt/sources.list.backup @@ -19,8 +19,6 @@ then fi WEBCAM_USER=webcam -FFMPEG_HLS_COMMIT=c6fdbe26ef30fff817581e5ed6e078d96111248a -FFMPEG_HLS_DIR=/opt/ffmpeg-hls ### Script #### @@ -68,7 +66,7 @@ pushd /home/"${BASE_USER}" apt-get -y --force-yes install libjpeg8-dev fi fi - + apt-get -y --force-yes --no-install-recommends install imagemagick ffmpeg libv4l-dev wget $OCTOPI_MJPGSTREAMER_ARCHIVE -O mjpg-streamer.zip @@ -122,32 +120,11 @@ EOT # FFMPEG HLS if [ "$OCTOPI_INCLUDE_FFMPEG_HLS" == "yes" ] then - apt-get install -y --force-yes --no-install-recommends nginx - - FFMPEG_BUILD_DIR=$(mktemp -d) - pushd ${FFMPEG_BUILD_DIR} - FFMPEG_ARCHIVE=ffmpeg.tar.gz - wget https://api.github.com/repos/FFmpeg/FFmpeg/tarball/${FFMPEG_COMMIT} -O ${FFMPEG_ARCHIVE} - tar xvzf ${FFMPEG_ARCHIVE} - cd FFmpeg* - ./configure \ - --disable-doc \ - --disable-htmlpages \ - --disable-manpages \ - --disable-podpages \ - --disable-txtpages \ - --disable-ffplay \ - --disable-ffprobe - make -j$(nproc) - mkdir -p ${FFMPEG_HLS_DIR} - cp ffmpeg ${FFMPEG_HLS_DIR} - popd - rm -r ${FFMPEG_BUILD_DIR} - + apt-get install -y --force-yes --no-install-recommends ffmpeg nginx useradd ${WEBCAM_USER} usermod -aG video ${WEBCAM_USER} fi - + #CuraEngine if [ "$OCTOPI_INCLUDE_CURAENGINE" == "yes" ] then @@ -174,7 +151,7 @@ EOT # fetch current yq build and install to /usr/local/bin wget -O yq $OCTOPI_YQ_DOWNLOAD && chmod +x yq && mv yq /usr/local/bin - + popd #Make sure user pi / ${BASE_USER} has access to serial ports @@ -220,13 +197,13 @@ do done for ip in $(hostname -I); -do +do echo " http://$ip" done echo echo "https is also available, with a self-signed certificate." -echo +echo echo "------------------------------------------------------------" echo EOT @@ -299,7 +276,7 @@ systemctl_if_exists enable streamer_select.service if [ "$OCTOPI_INCLUDE_MJPGSTREAMER" == "yes" ] then systemctl_if_exists enable webcamd.service -### use legacy camera stack on bullseye for now +### use legacy camera stack on bullseye for now if grep "camera_auto_detect=1" /boot/config.txt then sed -i "s/camera_auto_detect=1/camera_auto_detect=0/g" /boot/config.txt @@ -327,7 +304,7 @@ apt-get -y install avrdude apt-get clean apt-get autoremove -y -if [ -n "$OCTOPI_APTMIRROR" ]; +if [ -n "$OCTOPI_APTMIRROR" ]; then echo "Reverting /etc/apt/sources.list" mv /etc/apt/sources.list.backup /etc/apt/sources.list |