Skip to content

Make image decoders available when FFmpeg is missing#1544

Merged
NicolasHug merged 8 commits into
meta-pytorch:mainfrom
NicolasHug:ffmpeg_optional
Jul 24, 2026
Merged

Make image decoders available when FFmpeg is missing#1544
NicolasHug merged 8 commits into
meta-pytorch:mainfrom
NicolasHug:ffmpeg_optional

Conversation

@NicolasHug

@NicolasHug NicolasHug commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

All the image decoders we recently added do not depend on FFmpeg. So we shouldn't make FFmpeg a hard dependency anymore. In main, import torchcodec would error if the FFmpeg libraries aren't found. Now, we should only error when FFmpeg functionality is explicitly required (video decoding, etc.).

Not handled here: WavDecoder, which doesn't rely on FFmpeg for decoding, but actually still links to FFmpeg's AVIO somehow. We could probably work that out but that's not critical.


This is a large diff but most of it is just moving all the ffmpeg-dependent ops from ops.py into a new _ffmpeg_ops.py file. The rest are tests and plumbing.

@pytorch-bot

pytorch-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/meta-pytorch/torchcodec/1544

Note: Links to docs will display an error until the docs builds have been completed.

⏳ No Failures, 14 Pending

As of commit c57a324 with merge base f561b0e (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 23, 2026
@NicolasHug
NicolasHug merged commit 93195e5 into meta-pytorch:main Jul 24, 2026
68 of 70 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant