set HDMI EDID before starting ustreamer (#179)

* build docker image

* Push each image to an user github registry.
It can be used during development for testing.

* set HDMI EDID before starting ustreamer

* Update README.md
This commit is contained in:
tomaszduda23 2022-10-18 19:11:29 +02:00 committed by GitHub
parent 17f54a7977
commit 36c9ff22b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 26 additions and 10 deletions

View File

@ -7,3 +7,4 @@
!python/**
!janus/**
!man/**
!pkg/docker/entry.sh

View File

@ -2,7 +2,7 @@ name: Build Alpine
on:
push:
branches: [master]
branches: [master, build_*]
tags: [v*]
pull_request:
branches: [master]
@ -59,8 +59,8 @@ jobs:
-
name: Test
run: |
echo version: $(docker run --rm -t ustreamer --version)
echo -e "features:\n$(docker run --rm -t ustreamer --features)"
echo version: $(docker run --rm -e NO_EDID=1 -t ustreamer --version)
echo -e "features:\n$(docker run --rm -e NO_EDID=1 -t ustreamer --features)"
-
name: Build multi arch
uses: docker/build-push-action@v3

View File

@ -100,16 +100,13 @@ cma=128M
```
Save changes and reboot.
## Launch
Set HDMI EDID (it is not saved between reboots):
```bash
$ wget https://raw.githubusercontent.com/pikvm/kvmd/master/configs/kvmd/tc358743-edid.hex
$ sudo v4l2-ctl --device=/dev//dev/video0 --set-edid=file=tc358743-edid.hex --fix-edid-checksums --info-edid
```
Start container:
```bash
$ docker run --device /dev/video0:/dev/video0 -p 8080:8080 pikvm/ustreamer:latest
```
Then access the web interface at port 8080 (e.g. http://raspberrypi.local:8080).
## EDID
Container will set HDMI EDID before starging ustreamer. Use `-e NO_EDID=1` to not set EDID. Use `-e EDID_HEX=xx` to specify custom EDID data.
-----
# Raspberry Pi Camera Example

View File

@ -18,13 +18,17 @@ RUN apk add --no-cache \
libjpeg-turbo \
libevent \
libgpiod \
libbsd
libbsd \
v4l-utils
WORKDIR /ustreamer
COPY --from=build /build/ustreamer/src/ustreamer.bin ustreamer
RUN wget https://raw.githubusercontent.com/pikvm/kvmd/master/configs/kvmd/tc358743-edid.hex -O /edid.hex
COPY pkg/docker/entry.sh /
EXPOSE 8080
ENTRYPOINT ["./ustreamer", "--host=0.0.0.0"]
ENTRYPOINT ["/entry.sh"]
CMD ["--dv-timings", "--format", "UYVY"]
# vim: syntax=dockerfile

14
pkg/docker/entry.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/sh
set -e
[ -z "$NO_EDID" ] && {
[ -n "$EDID_HEX" ] && echo "$EDID_HEX" > /edid.hex
while true; do
v4l2-ctl --device=/dev/video0 --set-edid=file=/edid.hex --fix-edid-checksums --info-edid && break
echo 'Failed to set EDID. Reetrying...'
sleep 1
done
}
./ustreamer --host=0.0.0.0 $@