Skip to content

Commit

Permalink
rpi camera: update font and link it to IBM repository
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 committed Aug 11, 2024
1 parent c8f1fa9 commit bce09c8
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
/coverage*.txt
/apidocs/*.html
/internal/servers/hls/hls.min.js
/internal/protocols/rpicamera/exe/text_font.h
/internal/protocols/rpicamera/exe/text_font.*
/internal/protocols/rpicamera/exe/exe
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
/coverage*.txt
/apidocs/*.html
/internal/servers/hls/hls.min.js
/internal/protocols/rpicamera/exe/text_font.h
/internal/protocols/rpicamera/exe/text_font.*
/internal/protocols/rpicamera/exe/exe
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ The resulting stream will be available in path `/cam`.
_MediaMTX_ natively supports the Raspberry Pi Camera, enabling high-quality and low-latency video streaming from the camera to any user, for any purpose. There are a couple of requirements:
1. The server must run on a Raspberry Pi, with Raspberry Pi OS bullseye or newer as operative system. Both 32 bit and 64 bit operative systems are supported.
1. The server must run on a Raspberry Pi, with Raspberry Pi OS Bullseye as operative system. Both 32 bit and 64 bit architectures are supported.
2. Make sure that the legacy camera stack is disabled. Type `sudo raspi-config`, then go to `Interfacing options`, `enable/disable legacy camera support`, choose `no`. Reboot the system.
Expand Down
8 changes: 8 additions & 0 deletions internal/protocols/rpicamera/exe/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ OBJS = \

all: exe

TEXT_FONT_URL = https://github.com/IBM/plex/raw/v6.4.2/IBM-Plex-Mono/fonts/complete/ttf/IBMPlexMono-Medium.ttf
TEXT_FONT_SHA256 = 0bede3debdea8488bbb927f8f0650d915073209734a67fe8cd5a3320b572511c

text_font.ttf:
wget -O text_font.tmp $(TEXT_FONT_URL)
H=$$(sha256sum text_font.tmp | awk '{ print $$1 }'); [ "$$H" = "$(TEXT_FONT_SHA256)" ] || { echo "hash mismatch; got $$H, expected $(TEXT_FONT_SHA256)"; exit 1; }
mv text_font.tmp $@

text_font.h: text_font.ttf
xxd --include $< > text_font.h

Expand Down
Binary file removed internal/protocols/rpicamera/exe/text_font.ttf
Binary file not shown.
4 changes: 2 additions & 2 deletions scripts/binaries.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ BINARY_NAME = mediamtx
define DOCKERFILE_BINARIES
FROM $(RPI32_IMAGE) AS rpicamera32
RUN ["cross-build-start"]
RUN apt update && apt install -y --no-install-recommends g++ pkg-config make libcamera-dev libfreetype-dev xxd
RUN apt update && apt install -y --no-install-recommends g++ pkg-config make libcamera-dev libfreetype-dev xxd wget
WORKDIR /s/internal/protocols/rpicamera/exe
COPY internal/protocols/rpicamera/exe .
RUN make -j$$(nproc)

FROM $(RPI64_IMAGE) AS rpicamera64
RUN ["cross-build-start"]
RUN apt update && apt install -y --no-install-recommends g++ pkg-config make libcamera-dev libfreetype-dev xxd
RUN apt update && apt install -y --no-install-recommends g++ pkg-config make libcamera-dev libfreetype-dev xxd wget
WORKDIR /s/internal/protocols/rpicamera/exe
COPY internal/protocols/rpicamera/exe .
RUN make -j$$(nproc)
Expand Down

0 comments on commit bce09c8

Please sign in to comment.