Skip to content

fix: convert .m4a and .aac input through ffmpeg - #78

Merged
thatsrue merged 3 commits into
mainfrom
fix/review-73
Oct 31, 2026
Merged

thatsrue merged 3 commits into
mainfrom
fix/review-73

Conversation

@thatsrue

@thatsrue thatsrue commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

What changed

convert_to_wav no longer opens its input with libsndfile before ffmpeg runs. It still reads the duration (for the ffmpeg timeout) from libsndfile when it can, and from ffprobe when it can't. That helper is now public as input_duration, and process_file uses it for the timing report's input probe too. AGENTS.md notes that ffprobe is needed next to ffmpeg.

Why

.m4a and .aac are in SUPPORTED_FORMATS and the batch accepts them, but libsndfile 1.2.2 has no AAC or MP4 decoder. The input probe raised inside convert_to_wav's try, so every such file failed as "Failed to convert" before ffmpeg, which decodes them fine, was ever called.

The same libsndfile read in process_file's input probe set input_audio_seconds to None for these files with no warning. Those tracks had no speed figure in the batch table, and <session>-metrics.json left their audio out of the session total.

Closes #73

How you checked it

  • New test_formats_libsndfile_cannot_read_convert_through_ffmpeg (.m4a and .aac, encoded by real ffmpeg): passes with the fix, both cases fail on dfdd18b with the AudioValidationError from the issue.

  • New test_input_seconds_recorded_for_formats_libsndfile_cannot_read (.m4a and .aac, through process_file): passes with the fix, both cases fail with the previous pipeline.py.

  • make lint, make typecheck: pass. make test-fast: 300 passed.

  • Slow (inference) tests not run: they feed WAV input, whose path through convert_to_wav is unchanged.

  • Confirmed locally that the installed libsndfile 1.2.2 lists no AAC or MP4 format.

  • CI fails at setup-python before any check runs: .python-version pins 3.14.3, which has no build for the Ubuntu 26.04 runner. It fails the same way on other branches; fix: pin Python at the minor, so new Ubuntu images work #72 fixes it.

  • A bug fix comes with a test that fails without it

  • Docs match how it works now

  • No secrets or private information

@thatsrue
thatsrue merged commit 2258f83 into main Oct 31, 2026
4 checks passed
@thatsrue
thatsrue deleted the fix/review-73 branch October 31, 2026 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

.m4a/.aac input always fails conversion

1 participant