Created
April 8, 2023 19:32
-
-
Save ilio/8cc39b6599088a7ad8d791551ec91124 to your computer and use it in GitHub Desktop.
qnap QBoat Sunny web camera rtsp
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
FROM debian | |
RUN apt update && apt install -y tzdata; \ | |
apt clean; | |
# sshd | |
RUN mkdir /var/run/sshd; \ | |
apt install -y openssh-server; \ | |
sed -i 's/^#\(PermitRootLogin\) .*/\1 yes/' /etc/ssh/sshd_config; \ | |
sed -i 's/^\(UsePAM yes\)/# \1/' /etc/ssh/sshd_config; \ | |
apt clean; | |
RUN apt install -y build-essential libevent-dev libjpeg-dev libbsd-dev v4l-utils usbutils \ | |
hwinfo git sudo curl nano ffmpeg; | |
# RUN cd /root; \ | |
# git clone --depth=1 https://github.com/pikvm/ustreamer; \ | |
# cd ustreamer/; \ | |
# make; \ | |
RUN echo 'install mediamtx'; \ | |
cd /root; \ | |
curl -OJLv https://github.com/aler9/mediamtx/releases/download/v0.22.0/mediamtx_v0.22.0_linux_armv7.tar.gz; \ | |
ls -la; \ | |
mkdir mediamtx; \ | |
tar -C mediamtx -xf mediamtx_v0.22.0_linux_armv7.tar.gz; \ | |
{ \ | |
echo ' cam:'; \ | |
echo ' runOnInit: ffmpeg -f v4l2 -i /dev/video0 -pix_fmt yuv420p -b:v 600k -f rtsp rtsp://localhost:$RTSP_PORT/$RTSP_PATH'; \ | |
echo ' runOnInitRestart: yes'; \ | |
} >> mediamtx/mediamtx.yml; \ | |
sed -i 's/^api: no/api: yes/' mediamtx/mediamtx.yml; \ | |
sed -i 's/^apiAddress: 127.0.0.0:9997/apiAddress: :9997/' mediamtx/mediamtx.yml; | |
# entrypoint | |
RUN { \ | |
echo '#!/bin/bash -eu'; \ | |
echo 'ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime'; \ | |
echo 'echo "root:${ROOT_PASSWORD}" | chpasswd'; \ | |
echo 'v4l2-ctl --set-fmt-video width=1920,height=1080,pixelformat=MJPG'; \ | |
echo '/root/mediamtx/mediamtx /root/mediamtx/mediamtx.yml &'; \ | |
echo 'exec "$@"'; \ | |
} > /usr/local/bin/entry_point.sh; \ | |
chmod +x /usr/local/bin/entry_point.sh; | |
ENV TZ Asia/Jerusalem | |
ENV ROOT_PASSWORD root | |
EXPOSE 22 | |
EXPOSE 8080 | |
EXPOSE 8554 | |
EXPOSE 8000 | |
EXPOSE 8001 | |
EXPOSE 1935 | |
EXPOSE 8888 | |
EXPOSE 8889 | |
EXPOSE 9997 | |
ENTRYPOINT ["entry_point.sh"] | |
CMD ["/usr/sbin/sshd", "-D", "-e"] |
Author
ilio
commented
Aug 26, 2023
•
#!/bin/bash -eu
ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime
echo "root:${ROOT_PASSWORD}" | chpasswd
#/root/ustreamer/ustreamer -m MJPEG -r 1920x1080 -c HW --host=0.0.0.0 &
python3 /root/klipper/klippy/klippy.py /root/printer_data/printer.cfg -l /root/printer_data/klippy.log -a /tmp/klippy_uds &
/root/moonraker-env/bin/python /root/moonraker/moonraker/moonraker.py -d /root/printer_data -c /root/klipper_config/moonraker.conf -l /root/klipper_logs/moonraker.log -v -g &
exec "$@"
python3 /root/klipper/klippy/klippy.py /root/printer_data/config/printer.cfg -l /root/printer_data/logs/klippy.log -I /root/printer_data/comms/klippy.serial -a /root/printer_data/comms/klippy.sock
/root/moonraker-env/bin/python /root/moonraker/moonraker/moonraker.py -d /root/printer_data -c /root/printer_data/config/moonraker.conf -l /root/printer_data/logs/moonraker.log -v -g &
apt install iproute2
ip
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment