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
|
@ -6,8 +6,8 @@ RUN apt-get -y update && \
|
||||||
apt-get -y install --no-install-recommends \
|
apt-get -y install --no-install-recommends \
|
||||||
git vim parted \
|
git vim parted \
|
||||||
quilt coreutils qemu-user-static debootstrap zerofree zip dosfstools \
|
quilt coreutils qemu-user-static debootstrap zerofree zip dosfstools \
|
||||||
bsdtar libcap2-bin rsync grep udev xz-utils curl xxd file kmod bc\
|
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/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY . /pi-gen/
|
COPY . /pi-gen/
|
||||||
|
|
5
TODO.md
5
TODO.md
|
@ -3,13 +3,14 @@
|
||||||
## First time/Octo-Config
|
## First time/Octo-Config
|
||||||
- Add network configuration (replace nmtui)
|
- Add network configuration (replace nmtui)
|
||||||
- Add hostname configuration (replace nmtui)
|
- Add hostname configuration (replace nmtui)
|
||||||
|
- Better service configuration (deeper menu)
|
||||||
|
- System check
|
||||||
|
|
||||||
## Misc
|
## Misc
|
||||||
- More security
|
- More security
|
||||||
|
- Wiki
|
||||||
|
|
||||||
## Things to consider
|
## Things to consider
|
||||||
- Wayland using labwc/waybox
|
- Wayland using labwc/waybox
|
||||||
- Python 3
|
- Python 3
|
||||||
- Detect if frontend did not load correctly (probably not easy)
|
- 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_KEYMAP="${KEYBOARD_KEYMAP:-us}"
|
||||||
export KEYBOARD_LAYOUT="${KEYBOARD_LAYOUT:-English (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)"}
|
export GIT_HASH=${GIT_HASH:-"$(git rev-parse HEAD)"}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
upstream "mjpg-streamer" {
|
upstream "mjpg-streamer" {
|
||||||
server 127.0.0.1:8080;
|
server 127.0.0.1:9000;
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
|
|
|
@ -3,23 +3,9 @@
|
||||||
install -m 644 files/mjpg-streamer.service ${ROOTFS_DIR}/etc/systemd/system/mjpg-streamer.service
|
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
|
install -m 755 files/start-mjpg ${ROOTFS_DIR}/usr/local/bin/start-mjpg
|
||||||
|
|
||||||
on_chroot << EOF
|
if [[ ! -f ${ROOTFS_DIR}/usr/local/bin/mjpeg-server ]]; then
|
||||||
# If mjpg is already installed, skip this (for debugging)
|
# Do some semi janky cross compilation since Golang won't let me set GOBIN when cross compiling
|
||||||
if ! which mjpg_streamer; then
|
GOPATH=/tmp/go GOARCH=arm64 go get github.com/blueimp/mjpeg-server
|
||||||
cd /tmp
|
cp /tmp/go/bin/linux_arm64/mjpeg-server ${ROOTFS_DIR}/usr/local/bin/mjpeg-server
|
||||||
# Making sure that this directory doesn't exist
|
rm -rf /tmp/go
|
||||||
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
|
|
||||||
fi
|
fi
|
||||||
EOF
|
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
#!/bin/bash
|
#!/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
|
[[ "$DEVICE_MENU" == "" ]] && return 0
|
||||||
|
|
||||||
# Write selected value to startup script
|
# 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