Skip to content

Commit 65c8da1

Browse files
committed
Fix error message
1 parent 3aa6c65 commit 65c8da1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/torchcodec/_core/SingleStreamDecoder.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,11 +1181,13 @@ void SingleStreamDecoder::convertAudioAVFrameToFrameOutputOnCPU(
11811181
int sourceNumChannels = getNumChannels(streamInfo.codecContext);
11821182
TORCH_CHECK(
11831183
sourceNumChannels == getNumChannels(srcAVFrame),
1184-
"The Frame has ",
1184+
"The frame has ",
11851185
getNumChannels(srcAVFrame),
11861186
" channels, expected ",
11871187
sourceNumChannels,
1188-
".");
1188+
". If you are hitting this, it may be because you are using "
1189+
"a buggy FFmpeg version. FFmpeg4 is known to fail here in some "
1190+
"valid scenarios. Try to upgrade FFmpeg?");
11891191
int desiredNumChannels =
11901192
streamInfo.audioStreamOptions.numChannels.value_or(sourceNumChannels);
11911193

test/test_decoders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1292,7 +1292,7 @@ def test_s16_ffmpeg4_bug(self):
12921292
assert decoder.metadata.sample_format == asset.sample_format
12931293

12941294
cm = (
1295-
pytest.raises(RuntimeError, match="Invalid argument")
1295+
pytest.raises(RuntimeError, match="The frame has 0 channels, expected 1.")
12961296
if get_ffmpeg_major_version() == 4
12971297
else contextlib.nullcontext()
12981298
)

0 commit comments

Comments
 (0)