Added Golang MJPG Streamer, updated TODO
Added Golang based MJPG streamer https://github.com/blueimp/mjpeg-server Still need to figure out HW acceleration Changed default timezone to UTC
This commit is contained in:
parent
ce2e05165c
commit
d9c15f9502
7 changed files with 14 additions and 27 deletions
|
@ -7,7 +7,7 @@ RUN apt-get -y update && \
|
|||
git vim parted \
|
||||
quilt coreutils qemu-user-static debootstrap zerofree zip dosfstools \
|
||||
bsdtar libcap2-bin rsync grep udev xz-utils curl xxd file kmod bc \
|
||||
binfmt-support ca-certificates \
|
||||
binfmt-support ca-certificates golang \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY . /pi-gen/
|
||||
|
|
5
TODO.md
5
TODO.md
|
@ -3,13 +3,14 @@
|
|||
## First time/Octo-Config
|
||||
- Add network configuration (replace nmtui)
|
||||
- Add hostname configuration (replace nmtui)
|
||||
- Better service configuration (deeper menu)
|
||||
- System check
|
||||
|
||||
## Misc
|
||||
- More security
|
||||
- Wiki
|
||||
|
||||
## Things to consider
|
||||
- Wayland using labwc/waybox
|
||||
- Python 3
|
||||
- Detect if frontend did not load correctly (probably not easy)
|
||||
- HTTP/Port 80 redirect
|
||||
- https://github.com/blueimp/mjpeg-server
|
||||
|
|
2
build.sh
2
build.sh
|
@ -177,7 +177,7 @@ export LOCALE_DEFAULT="${LOCALE_DEFAULT:-en_US.UTF-8}"
|
|||
export KEYBOARD_KEYMAP="${KEYBOARD_KEYMAP:-us}"
|
||||
export KEYBOARD_LAYOUT="${KEYBOARD_LAYOUT:-English (US)}"
|
||||
|
||||
export TIMEZONE_DEFAULT="${TIMEZONE_DEFAULT:-America/New_York}"
|
||||
export TIMEZONE_DEFAULT="${TIMEZONE_DEFAULT:-UTC}"
|
||||
|
||||
export GIT_HASH=${GIT_HASH:-"$(git rev-parse HEAD)"}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
}
|
||||
|
||||
upstream "mjpg-streamer" {
|
||||
server 127.0.0.1:8080;
|
||||
server 127.0.0.1:9000;
|
||||
}
|
||||
|
||||
server {
|
||||
|
|
|
@ -3,23 +3,9 @@
|
|||
install -m 644 files/mjpg-streamer.service ${ROOTFS_DIR}/etc/systemd/system/mjpg-streamer.service
|
||||
install -m 755 files/start-mjpg ${ROOTFS_DIR}/usr/local/bin/start-mjpg
|
||||
|
||||
on_chroot << EOF
|
||||
# If mjpg is already installed, skip this (for debugging)
|
||||
if ! which mjpg_streamer; then
|
||||
cd /tmp
|
||||
# Making sure that this directory doesn't exist
|
||||
rm -rf /tmp/mjpg-streamer
|
||||
git clone https://github.com/jacksonliam/mjpg-streamer/
|
||||
cd mjpg-streamer/mjpg-streamer-experimental/
|
||||
make
|
||||
make install
|
||||
cd /
|
||||
# Cleanup
|
||||
rm -rf /tmp/mjpg-streamer
|
||||
# Create needed folder
|
||||
mkdir -p /var/www/mjpg
|
||||
# Permissions
|
||||
chown octoprint:octoprint /var/www/mjpg
|
||||
if [[ ! -f ${ROOTFS_DIR}/usr/local/bin/mjpeg-server ]]; then
|
||||
# Do some semi janky cross compilation since Golang won't let me set GOBIN when cross compiling
|
||||
GOPATH=/tmp/go GOARCH=arm64 go get github.com/blueimp/mjpeg-server
|
||||
cp /tmp/go/bin/linux_arm64/mjpeg-server ${ROOTFS_DIR}/usr/local/bin/mjpeg-server
|
||||
rm -rf /tmp/go
|
||||
fi
|
||||
EOF
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#!/bin/bash
|
||||
/usr/local/bin/mjpg_streamer -i input_uvc.so -o "output_http.so --port 8080 -w /var/www/mjpg"
|
||||
/usr/local/bin/mjpeg-server -a 127.0.0.1:9000 -- ffmpeg -i /dev/video0 -f v4l2 -f mpjpeg -
|
||||
|
|
|
@ -137,5 +137,5 @@ video_config () {
|
|||
[[ "$DEVICE_MENU" == "" ]] && return 0
|
||||
|
||||
# Write selected value to startup script
|
||||
echo -e '#!/bin/bash'"\n/usr/local/bin/mjpg_streamer -i \"input_uvc.so -d $DEVICE_MENU\" -o \"output_http.so --port 8080\"" > /usr/local/bin/start-mjpg
|
||||
echo -e '#!/bin/bash'"\n/usr/local/bin/mjpeg-server -a 127.0.0.1:9000 -- ffmpeg -i $DEVICE_MENU -f v4l2 -f mpjpeg -" > /usr/local/bin/start-mjpg
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue