Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magick.NET not finding FFMPEG.EXE in Azure Function, but it's in same bin folder #1226

Closed
kirk-marple opened this issue Aug 3, 2022 · 1 comment
Milestone

Comments

@kirk-marple
Copy link

Magick.NET version

Magick.NET-Q8-AnyCPU, 12.0.0

Environment (Operating system, version and so on)

Win 11, .NET 6, C#

Description

When trying to fix this issue, I needed to get FFMPEG in the path.

But I'm running in an Azure Function, and I can see I've copied ffmpeg.exe into the same folder as Magick*.dll: D:\home\site\wwwroot\bin

I don't think I can add anything to the system %PATH% on an Azure Function, so is there any other way to specify where Magick.NET should find FFMPEG?

Steps to Reproduce

Try and convert APNG to GIF, like described in the issue above.

But get error:

Failed to load image collection from file [D:\local\Temp\24c8e28b-0362-4d27-807c-2d9fa8d3a014\file.apng].
FailedToExecuteCommand `"ffmpeg.exe" -nostdin -loglevel error -i "D:/local/Temp/magick-RcYhMoSD-uSrZ53WLPy_aXeIEF8xEYhZ" -an -f rawvideo -y -pix_fmt rgba -vcodec webp "D:/local/Temp/magick-LEWgxnRf5-gwllazKD6eIbsJlYAEUyEm"' (The system cannot find the file specified.
) @ error/delegate.c/ExternalDelegateCommand/516

@dlemstra
Copy link
Owner

dlemstra commented Aug 7, 2022

I ran some test in an azure function and it does look like you will need to add the the folder that contains the ffmpeg.exe binary to your path. In the next version of Magick.NET I will add two new methods to the MagickNET class that can be used to get or set an environment variable. You will be able to this then:

var path = MagickNET.GetEnvironmentVariable("Path");
MagickNET.SetEnvironmentVariable("Path", @$"{path};C:\home\site\wwwroot");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants