Skip to content

Conversation

@bcw222
Copy link

@bcw222 bcw222 commented Jan 10, 2026

Maybe sometimes FFmpeg's DLLs is not in PATH so we need to add them manually.

@meta-cla
Copy link

meta-cla bot commented Jan 10, 2026

Hi @bcw222!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@meta-cla
Copy link

meta-cla bot commented Jan 10, 2026

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jan 10, 2026
@Dan-Flores
Copy link
Contributor

Thanks for the PR @bcw222!

Let's try to implement a more general solution. Perhaps we could expose a global variable that we pass to os.add_dll_directory if defined. That way, chocolatey users can still pass in the directory of the actual FFmpeg executable, without hardcoding any paths in.

Would that work for your workflow?

@bcw222
Copy link
Author

bcw222 commented Jan 14, 2026

Hmm, that sounds good, but it would result in a feature that should work out-of-the-box (on devices with the required FFmpeg already installed) still requiring additional manual steps.

In a narrow sense, my fix already avoids hardcoding paths as much as possible by reading the ChocolateyInstall environment variable. Broadly speaking, due to Chocolatey's peculiarities, we inevitably have to hardcode certain things.

Using an environment variable is certainly a good idea, but this pull request is just a quick fix I made after encountering the issue while using torchcodec. I have not looked closely into the project's environment variable naming conventions, so I did not add that feature to avoid inconsistencies in the code style.

I would be happy to refine this further if I have the time, or if someone else is willing to help.

@Dan-Flores
Copy link
Contributor

Got it, I understand your concern that an environment variable would require an extra manual step. From our perspective, there are too many package managers to implement specific solutions for each. Our thinking is that an environment variable will provide a general solution that helps simplify your use case and others.

Roughly, the implementation would be:

  • First check for TORCHCODEC_FFMPEG_DIR environment variable
  • If not set, fallback to the existing shutil logic
  • Call add_dll_directory() if an FFmpeg directory is found

Would you be interested in contributing this change?

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.

2 participants