Files
firmware/pkgs/3rdparty/ffmpeg/pkg.conf
Oleksandr ShyshatskyiandClaude Opus 5 58cfd00415 FlashForge's ffmpeg cannot render a rotated webcam, so we build our own
moonraker-timelapse emits -vf 'transpose=1', 'hflip,vflip' and friends
straight from the webcam's rotation and flip settings. The stock ffmpeg is
configured --disable-everything with a narrow enable list, and asking the
binary itself for -filters returns format, null, scale and trim -- so every
one of those renders fails on a printer whose camera is not upright.

So: ffmpeg 4.4.5 and x264, cross-built, static, one 1.8M binary at
$MODDIR/bin/ffmpeg. The enable list is FlashForge's plus the filters they
left out, since flash is scarce and nothing else is wanted.

There is no hardware encoder to use instead, and it is written down in
pkgs/3rdparty/ffmpeg/pkg.conf so nobody re-derives it: the X2600's device
tree declares jpege (a JPEG encoder), jpegd and felix, and felix is an H.264
DECODER -- the die has no H.264 encode block at all. Only felix has a driver
in the stock kernel; jpege and the rotate block have DT nodes and clock gates
and nothing bound to them. Software x264 is the only route to an H.264 mp4
here, which is why moonraker.conf tunes it with -preset ultrafast rather than
leaving the default.

x264 is named anvil-x264-dev outright, as anvil-zlib-dev is: every file in it
is a header or an archive, so a PKG_DEV_FILES split would leave an empty
anvil-x264 beside it that no printer would ever install.

bzip2 joins the build image because x264's only distributed form is a
.tar.bz2 and tar could not unpack it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TSmXJv47Wwq2J7FfgCgpCe
2026-08-30 15:47:25 +03:00

28 lines
1.2 KiB
Plaintext

# anvil-ffmpeg -- ffmpeg, ours, for the timelapse render.
#
# WHY NOT FLASHFORGE'S. Theirs is configured --disable-everything with a
# narrow enable list and NO hflip/vflip/transpose/rotate, so a webcam with a
# rotation or a flip set renders nothing at all -- measured by asking their
# binary for -filters. Ours enables those and nothing else new.
#
# THERE IS NO HARDWARE ENCODER TO USE INSTEAD, and it is worth writing down so
# nobody re-derives it: the X2600's device tree declares jpege (a JPEG
# encoder), jpegd and felix, and felix is an H.264 DECODER -- the die has no
# H.264 encode block. Of those only felix has a driver in the stock kernel.
# So x264 in software is the only way to an H.264 mp4 on this machine, and the
# render is tuned for speed instead (-preset ultrafast, in moonraker.conf).
PKG_NAME=anvil-ffmpeg
PKG_VERSION="$FFMPEG_VERSION"
PKG_RELEASE=1
PKG_SECTION=libs
PKG_EXCLUDE=".version"
# Nothing at runtime: --disable-shared means the libav* are linked into the one
# binary, and libx264 comes in as a static archive from anvil-x264-dev.
PKG_DEPENDS=""
PKG_BUILD_DEPENDS="x264"
PKG_DESCRIPTION="ffmpeg, built for the timelapse render: image2 in, libx264 out, and the rotate/flip filters FlashForge's own build leaves out."