Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpi camera: update font and link it to IBM repository #3647

Merged
merged 1 commit into from
Aug 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading