Rebuild the FFmpeg AAR with --enable-libvorbis, and implement Ogg Vorbis on it: the shipped binary has no libvorbis #254
Closed
opened 2026-09-06 19:20:42 +00:00 by JMR-dev
·
1 comment
No Branch/Tag Specified
main
fix/102-picker-back-press-overshoot
fix/268-saf-picker-determinism
feat/ogg-vorbis-libvorbis
feat/expedited-conversion-work
fix/gate-cache-in-worktrees
chore/gate-runs-shellcheck
test/publish-delete-arm-real-provider
docs/e8-instrumented-coverage
docs/api37-carrier-count-drift
docs/e7-second-constraint
test/publish-to-a-real-saf-destination
fix/api37-report-match-line
fix/api37-task-snapshot-crash
test/join-failure-message-on-device
docs/e2e-read-findings-e7
test/cancelling-a-running-export
test/reattach-to-a-running-job
test/content-uri-reaches-ffmpeg
fix/launcher-wiring-waits-for-the-pick
fix/cancel-tests-need-a-slower-encode
test/cancelling-a-running-join
test/cancelling-a-running-session
test/notification-cancel-action
test/ffmpeg-progress-is-observed
test/fallback-asserts-the-path
test/flac-and-opus-assert-their-format
docs/e2e-read-findings
docs/wave4-coverage-numbers
fix/injectable-startup-sweep-scope
test/session-outcome-seam
test/launcher-callback-identity
test/theme-follows-system-dark
test/audio-drop-arm
fix/rotation-waits-for-recreation
fix/convert-guards-on-ready
test/retry-save-mime
test/hardware-progress-reaches-workmanager
test/ffprobe-mapping-seam
test/device-codec-enumeration-seam
test/unknown-container-row
test/null-message-fallbacks
test/cancel-reaches-workmanager
docs/coverage-wave3-recovery
test/concat-engine-seam
docs/coverage-wave3
test/mediaprobe-merge-seam
test/adaptive-shell-wiring
test/aac-audio-args
test/notification-progress-text
test/media3-muxer-guard
test/hardware-fallback-and-cancellation
test/unprobeable-join-clip
test/one-branch-outcomes
test/foreground-type-regimes
fix/bound-wedge-diagnostics
docs/coverage-wave2
test/screen-wiring
test/viewmodel-setters
test/join-state-mapping
test/conversion-state-mapping
test/dedupe-user-messages
fix/restore-stack-merges
test/refused-jobs
test/concatworker-failure-arms
test/container-capabilities-audio
test/readspec-enum-fallbacks
test/outputpublisher-seams
test/mediaprobe-track-seam
test/outputpublisher-partial-branches
test/fake-provider-scaffolding
docs/coverage-read-findings
chore/gitignore-kotlin
test/bound-the-hangs
docs/coverage-remeasure
ci/baseline-counter-precision
fix/invalid-suggestion-chip
ci/wedged-leg-report
fix/reattachment-overwrites-pick
test/theme-live-branches
fix/failed-save-retry
fix/empty-composition-crash
ci/advisory-failure-report
docs/seven-run-counts
test/release-permission-guard
ci/build-workflow-permissions
docs/api37-point-release
docs/benchmark-populate-path
fix/dead-assertion-probe-test
ci/actionlint
test/device-codecs-encode-consequence
fix/sdkmanager-pipefail
docs/readme-restart-claim
fix/saf-picker-root-discovery
fix/probe-dispatcher-seam
test/media3engine-mime-tables
test/mediaprobe-pure-helpers
fix/codec-vocabulary-drift
docs/robolectric-rationale-correction
docs/api37-advisory-counts
test/r38-8-saf-e2e
test/r38-7-join-states
test/r38-6-conversion-states
test/r38-5-state-seam
fix/jacoco-robolectric-coverage
docs/instrumented-tests-correction
test/r38-2-filecard
test/r38-4-advanced-picker
test/r38-3-pickers
tools/file-issue-script
tools/api-37-emulator
fix/review-app-gaps
docs/review-corrections
No results found.
Labels
Clear labels
above-cut
accessibility
backlog
bug
confirmed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
plausible
question
sev:high
sev:low
sev:medium
wontfix
Worked autonomously overnight: local, JVM-verifiable, no product decision
Barrier affecting people with disabilities
Held for manual review: product/UX call, CI/workflow, hardware, or unverifiable here
Something isn't working
Reviewer demonstrated the defect
Improvements or additions to documentation
This issue or pull request already exists
New feature or request
Good for newcomers
Extra attention is needed
This doesn't seem right
Reviewer could not fully demonstrate it; treat as unproven
Further information is requested
High severity
Low severity
Medium severity
This will not be worked on
No labels
bug
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: JMR-dev/LibreMediaConverter#254
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Found by the first-ever instrumented coverage measurement (2026-09-06). One of the 32 lines no
suite reaches:
Every other arm of that
whenis covered — MP3, FLAC, PCM, OPUS and theelseAAC default.Why it is unreached, and why that is a question rather than an answer
No
OutputFormatproducesAudioCodec.VORBIS.The user-selectable list is MP4_H264/H265,WEBM_VP9, MKV_H264/H265, REMUX_MP4/MKV, MP3, M4A_AAC, OPUS, FLAC, WAV, GIF and FRAMES_PNG; the
only Ogg entry is
OPUS("Opus", OutputSpec(Container.OGG, VideoCodec.NONE, AudioCodec.OPUS)).So on the direct path the arm is dead. But
ContainerCapabilitiesdisagrees, and that iswhat makes this worth a ticket rather than a note:
repairpicks a codec the target container can hold. If it can ever selectVORBIS— for aninput whose audio is already Vorbis, say, where a copy is refused and a re-encode is planned —
then this arm is live, user-reachable and completely untested, and the command it builds has
never been run through FFmpeg once.
ConversionRouter:62also listsVORBISinMEDIA3_MUXABLE_AUDIOfor MP4.The work
ContainerCapabilities.repairchooseVORBIS. Both setslist
OPUSfirst, so a first-match implementation never reaches it — read the code, do notassume the ordering is what decides.
FFmpegEngineTestcase that encodes Vorbis and asserts the containermagic, exactly as #228 did for FLAC (
fLaC) and Opus (OggS). Asserting a non-empty file iswhat #228 was filed to fix; do not repeat it.
else, and record which — this isthen F4-shaped, like the
COPY/NONE -> error(...)arms twenty lines above that aredeliberately exempt.
Acceptance criterion
If a test is written: point
AudioCodec.VORBISatlibopusand it must go red. If the arm isremoved instead: the answer to step 1 goes in
docs/coverage-read-findings.md, because the nextread will otherwise re-derive it.
Rescoped 2026-09-06: this is not an uncovered arm, it is a latent defect
The premise of this ticket was wrong in the app's favour and against the user's.
FFmpegCommandBuilder:188did not merely never execute — it could not have succeeded. It emitted-c:a libvorbis, and that encoder is not in the binary this app ships. The first user to pick Ogg Vorbis would have gotUnknown encoder 'libvorbis'.Measured, three independent ways
tools/ffmpeg/build-ffmpeg.shagrees: neitherCOMMON_LIBSnorEXTRA_LIBSnames it. The shipped AAR isffmpeg-kit-next-8.1.1.aar.This is #238's shape again — two individually-correct facts, a builder arm and a configure line, that no test ever put together. A coverage number cannot find it; only building the command and running it can.
Why the native
vorbisencoder is not an acceptable substituteFFmpeg does ship an in-tree encoder, and a first pass at this ticket used it. It works, and it is not good enough to put in a picker beside MP3, FLAC and Opus:
libvorbisvorbis-strict experimentalThe
AV_CODEC_CAP_EXPERIMENTALgate is the codebase saying do not ship this by accident. The stereo limit forces-ac 2, so a mono source is silently upmixed and a surround one downmixed — a user-visible compromise this app makes nowhere else. And the quality slider barely moves: roughly 2x its floor against libvorbis's 6x, so the user cannot ask it for a better file.New scope
--enable-libvorbis, perbin/README.md. Note what that costs: a cross-compile, a new ~35 MB blob permanently in git history, a new checksum, andbin/README.md's provenance and configure line updated in the same commit.-c:a libvorbis -q:a 5, no-strict experimental, no forced-ac 2, and mono preserved.OutputFormatentry, withVORBISadded toENCODABLE_AUDIOContainer.OGG's 4th positional field isaudioExtension, not a codec hint — it was hardcoded"opus", so every Ogg output was named.opusand a Vorbis file would have shipped asfoo.opus. RFC 7845 s9 asks for.opusonly on an Ogg carrying Opus alone. Fix is a per-codec extension map.OggSmagic — Vorbis and Opus are bothOggS, so a magic-only assertion is vacuous against the mutation below.Acceptance
Point
AudioCodec.VORBISatlibopusand the e2e test must go red. Verified by MIME (MIMETYPE_AUDIO_VORBISvs the mutant'saudio/opus), because the two are indistinguishable by container magic.And the encode must actually run on a device against the rebuilt AAR — that run is the whole point of this ticket, since the defect it found was invisible to everything short of executing the command.
Queue
Behind the work in flight (#252 and the shellcheck/actionlint gate work). The AAR rebuild is serialised deliberately: it is a long cross-compile and it changes a committed binary every other branch links against.
Two warnings for the rebuild, from the first pass
Do not guess the configure flag.
tools/ffmpeg/build-ffmpeg.shwarns that ffmpeg-kit's library names come from its ownget_library_name()and are not FFmpeg's: it passes--enable-lamefor libmp3lame and--enable-opusfor libopus. So the flag here may well be--enable-vorbis, not--enable-libvorbis. Read that function before starting a 40-minute cross-compile. libvorbis pulls libogg as a dependency; licensing is unaffected (BSD, and this build is already GPL-3.0).A wrong flag name fails silently. ffmpeg-kit does not error on an unrecognised
--enable-*, so a rebuild that quietly omitted libvorbis looks exactly like one that worked. Re-run thestringscheck and the e2e test before updatingbin/README.md's configure line and SHA-256 — not after. Those two are the only things that would catch it, which is the same lesson this ticket already carries.