mirror of
https://github.com/screentinker/screentinker.git
synced 2026-08-19 08:33:56 -06:00
TWO CHANGES, together because they touch the same packager hunks. 1. THE DRIVER. The BrightSign package used to be MANUFACTURED. scripts/build-server-zip.sh dropped better-sqlite3 from package.json and then installed db/sqlite-compat.js into node_modules under that name, so every require resolved to the façade. It worked — and it shipped a database layer that no test had ever executed. That is the same shape as the TELEMETRY_COLLECTOR TDZ crash that took production down while 1676 tests and four CI jobs were green: a build-time rewrite cannot be tested by the build that performs it. db/sqlite-driver.js now decides at runtime: the native driver when it loads, the node:sqlite façade otherwise. One artifact, one code path, and — the point — both branches reachable from a test. ST_SQLITE_DRIVER=node runs the entire suite the way a player runs it, and a new CI job does exactly that on Node 24 with --omit=optional so the fallback is reached the same way it is on hardware, not by an env var alone. better-sqlite3 becomes an optionalDependency, so a host with no compiler installs cleanly and falls back rather than failing. preflight-deps stops trying to rebuild a native module on a host that has no toolchain and a working built-in driver — on a player that was a five-minute node-gyp failure ending in a server that never started. Asking for the native driver BY NAME (ST_SQLITE_DRIVER=better-sqlite3) still fails loudly, because a production box that has lost its native module is broken and should say so rather than quietly running something else. ⚠️ NODE 24 IN PRACTICE. node:sqlite is unflagged only from 23.4; on the 22.x line it needs --experimental-sqlite and on 20.x it does not exist. So the code probes rather than comparing versions, the player package pins engines >=24, and the built-in cases skip on the Node 20 CI job rather than failing there. Verified on Node 24, both drivers, full suite: better-sqlite3 1762 pass / 0 fail node:sqlite 1762 pass / 0 fail and the built payload resolves node:sqlite with no better-sqlite3 present at all. 2. THE LICENCE. The ffprobe/ffmpeg binaries added in the previous commit are LGPL 2.1 and statically linked, so the licence text has to travel WITH them — a link on a website is not the copy the licence asks to accompany the work. The packager now copies COPYING.LGPLv2.1 and a build README into bin/, and refuses to build if the licence is missing. legal/third-party.html gains an LGPL section with the written offer required by section 6 for static linking, and the exact configure line. It also drops Sharp, which that page still listed although #263 removed it, and names what actually does the image work now (jimp, @jsquash/webp, @jsquash/avif). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014kfhrUPit5MCqxeTQyqr56
59 lines
2.8 KiB
Markdown
59 lines
2.8 KiB
Markdown
# Bundled media tools (ffprobe, ffmpeg)
|
|
|
|
`ffprobe.gz` and `ffmpeg.gz` are gzipped aarch64 binaries shipped in the **BrightSign player package
|
|
only**. `bs-server-boot.js` unpacks them into `/tmp/screentinker-bin` at boot — every writable volume
|
|
on a BrightSign player is mounted `noexec`, so a copy onto tmpfs is the only way to execute anything
|
|
— and puts that directory on `PATH` so the server's normal ffprobe/ffmpeg lookups find them.
|
|
|
|
## What they are
|
|
|
|
Unmodified **FFmpeg 7.1.1** (<https://ffmpeg.org/>), licensed **LGPL 2.1 or later**. See
|
|
`COPYING.LGPLv2.1` in this directory, which ships beside the binaries in the package.
|
|
|
|
Configured `--disable-gpl`, so **no GPL component is present**, including `libpostproc` (GPL-only).
|
|
This is deliberate: it keeps the shipped tree free of copyleft beyond the LGPL, which the licence
|
|
position for underwriting and procurement depends on.
|
|
|
|
## Rebuilding them
|
|
|
|
Cross-built on Ubuntu with `aarch64-linux-gnu-gcc`. ffprobe carries **no decoders** — duration and
|
|
stream geometry come from the container — which is why it is 1.8MB against ffmpeg's 4.9MB.
|
|
|
|
```sh
|
|
./configure \
|
|
--arch=aarch64 --target-os=linux --enable-cross-compile \
|
|
--cross-prefix=aarch64-linux-gnu- \
|
|
--disable-gpl --disable-nonfree --disable-autodetect \
|
|
--disable-shared --enable-static --enable-small \
|
|
--disable-doc --disable-network --disable-debug --disable-ffplay \
|
|
--extra-version="ScreenTinker" \
|
|
--disable-everything \
|
|
--enable-demuxer=mov,matroska,mp3,image2,wav,avi,flv,mpegts,ogg,aac \
|
|
--enable-muxer=image2,mjpeg \
|
|
--enable-decoder=h264,hevc,vp8,vp9,av1,mpeg4,mjpeg,aac,mp3,vorbis,opus,pcm_s16le \
|
|
--enable-encoder=mjpeg \
|
|
--enable-parser=h264,hevc,vp8,vp9,av1,mpeg4video,mjpeg,mpegaudio,aac \
|
|
--enable-filter=scale,transpose,hflip,vflip,format,null,copy,crop,setsar \
|
|
--enable-protocol=file --enable-swscale \
|
|
--extra-cflags="-Os -ffunction-sections -fdata-sections" \
|
|
--extra-ldflags="-static -Wl,--gc-sections"
|
|
make -j"$(nproc)" ffmpeg ffprobe
|
|
gzip -9 -c ffprobe > brightsign/media-tools/ffprobe.gz
|
|
gzip -9 -c ffmpeg > brightsign/media-tools/ffmpeg.gz
|
|
```
|
|
|
|
Test the result with `qemu-aarch64-static ./ffprobe -version` before putting it near a device.
|
|
|
|
## ⚠️ Do not substitute a distribution build
|
|
|
|
A stock Debian `ffprobe` linked against BrightSignOS's own libav stack starts, prints its banner, and
|
|
then **SIGSEGVs** on the first file it opens: their Yocto build is patched for hardware decode.
|
|
Debian's is also built `--enable-gpl`. These binaries deliberately link nothing of the platform's.
|
|
|
|
## LGPL section 6
|
|
|
|
These are statically linked, so the licence requires that we can supply the corresponding source and
|
|
the object files needed to relink against a modified library. The configure line above plus the
|
|
upstream 7.1.1 tarball reproduces them exactly; the written offer is published at
|
|
<https://screentinker.com/legal/third-party.html>.
|