#1152057 torchcodec: autopkgtest fails with FFmpeg 9: FLAC test_against_cli packet comparison

Package:
src:torchcodec
Source:
src:torchcodec
Submitter:
Sebastien Bacher
Date:
2026-10-25 20:23:02 UTC
Severity:
normal
Tags:
#1152057#5
Date:
2026-10-25 20:19:37 UTC
From:
To:
Hi,

The autopkgtest of torchcodec 0.14.0-1.1 fails with FFmpeg 9 on all
architectures, which is what keeps it out of testing:
https://qa.debian.org/excuses.php?package=torchcodec

We see the same in Ubuntu, e.g.
https://autopkgtest.ubuntu.com/results/autopkgtest-tenacious/tenacious/amd64/t/torchcodec/20261024_050041_b5a96@/log.gz

All 96 failures are the flac variants of
TestAudioEncoder::test_against_cli and TestEncoder::test_audio_against_cli
(mp3 and wav pass), and they all fail in validate_frames_properties():

  assert len(frames_actual) == len(frames_expected)
  AssertionError: assert 56 == 64

The decoded samples, pts, duration and sample rate assertions that come
before that check all pass. It's a test issue, not a bug in the encoder:
from FFmpeg 9 the ffmpeg CLI encodes FLAC with a block size equal to the
number of samples of the first frame fed to the encoder, while torchcodec
uses the encoder's default block size for the sample rate. Both files are
valid and decode to the same samples, only the packet layout differs.

Upstream fixed the test in 0.16.0

The attached patch backports it to 0.14.0. In 0.14 the check exists in two
tests (they were merged upstream later), so the same condition is applied
to both. It applies on top of the current series.

Thanks,
Sebastien Bacher