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

Support Windows Platform #8

Open
YazeedAlKhalaf opened this issue Mar 6, 2021 · 15 comments
Open

Support Windows Platform #8

YazeedAlKhalaf opened this issue Mar 6, 2021 · 15 comments
Labels
enhancement New feature or request library Affects the library scripts Affect build scripts windows Affects Windows platform

Comments

@YazeedAlKhalaf
Copy link

No description provided.

@redbrain
Copy link

+1, would be great if support for all desktop platforms existed

@seamory
Copy link

seamory commented Apr 18, 2022

+1, that will be great to using ffmpeg.

@remcova
Copy link

remcova commented May 18, 2022

UPDATE: I've looked into the web implementation first for CHROME extensions. The option I came across was using ffmpeg in WASM. Unfortunately, Manifest V3.0 brings a lot of issues. With Manifest V2.0 you can get it working but it will stop working in January 2023 in Chrome, so this won't be worth the effort to implement.

To port it to Manifest V3, the code will need to be placed in a worker which doesn't have access to the DOM (document). Also, it can't be published on Chrome Store due to Manifest V2.

I haven't found an alternative yet to create an implementation for the web, it looks like this will be a pain in the ass

@Sandst4
Copy link

Sandst4 commented Feb 26, 2023

Any chance there is an update for Windows support? For a new project I'm working on the Windows support is really appreciated. Thanks!

@git-boya
Copy link

git-boya commented Mar 1, 2023

Hope to support Windows
thanks

@nukes
Copy link

nukes commented Nov 11, 2023

+1 for windows support

@PaulineMoovency
Copy link

Is there any news about this?

@stephane-archer
Copy link

Any news? It feels like it will never come...

@mgenware
Copy link

FWIW, you can always embed pre-compiled ffmpeg / ffprobe binaries and run them directly in a windows app. Unlike Apple's app store, Microsoft (at least now) doens't force you to statically link all app components. We have published Microsoft store apps working just fine with embedded (ffmpeg, imagemagick, cwebp...) binaries.

@stephane-archer
Copy link

@mgenware that would mean two code path, one for FFmpeg Kit and one for the embedded version right?
this would work but I wish FFmpeg was including this by default.
To run the embedded executable, do you copy it in a temporary folder then use Process.run ?

@mgenware
Copy link

@stephane-archer Right, windows has a seperate code path. No need to copy EXEs to a temp folder in our case. We are using flutter. Put all pre-built executables into a folder like (bin) and copy it to flutter windows build folder. The msix packaging tool automatically bundles them into a msix package.

To run a specific executable, e.g. bin/ffmpeg.exe:

// Do it only on windows.
assert(Platform.isWindows);

var args = ['a', 'b', 'c'];
// Get current process directory.
var processDir = p.dirname(Platform.resolvedExecutable);
// Get external executable path.
final exe = p.join(processDir, 'bin', 'ffmpeg.exe');

debugPrint('[Run process] $exe ${args.join(' ')}');
final res = await Process.run(exe, args);
if (res.exitCode != 0) {
  throw Exception('Code: ${res.exitCode}\n stdout: ${res.stdout}\n stderr: ${res.stderr}}');
}
// Return process output.
return res.stdout.toString();

Lastly, if you are submitting your app to Microsoft store, do test those pre-built EXEs on new windows 10 and 11 (not a dev machine already have many runtime DLLs installed). If it runs into any missing DLLs issues (e.g. vcomp140.dll), grab one and put it in bin folder as well.

@kaciula
Copy link

kaciula commented Dec 11, 2024

@mgenware I've included ffmpeg and ffprobe binaries in the assets folder of the app and I can successfully call these when running on Windows directly from Visual Studio Code.

However, when running the generated .exe file directly from within the file system, it crashes when calling ffmpeg. This also happens when running the app from Microsoft Store. The only error information I get is from Windows Event Viewer:

Faulting module name: KERNELBASE.dll, version: 10.0.19041.5131, time stamp: 0x011921da
Exception code: 0xc0000602
Fault offset: 0x0000000000133942
Faulting process id: 0x28ec
Faulting application start time: 0x01db4bcc53c188be

If this is a case of missing dlls, how do I know which dlls to include in the same folder as the executable? Or maybe it can't find the binaries? I copied the binaries right alongside the app executable but it did not solve the issue.

Any suggestion on how I can track down the cause of the crash and how to fix it? How can I get a proper stacktrace or error message?

@mgenware
Copy link

@kaciula

If this is a case of missing dlls, how do I know which dlls to include in the same folder as the executable? Or maybe it can't find the binaries? I copied the binaries right alongside the app executable but it did not solve the issue.

ffmpeg binaries usually run fine on windows. In my case, it's actually ImageMagick that failed on some windows 10 systems, the missing DLL info should be included in process stdout / stderr. Once I bundled the missing DLLs alongside ImageMagick exe. It should run fine.

Not sure if this helps. Here's the DLLs I bundled (mostly for ImageMagick)

  • msvcp140.dll
  • vcomp140.dll
  • vcruntime140.dll
  • vcruntime140_1.dll

Any chance you got some useful process stdout / stderr output before it crashes?

@kaciula
Copy link

kaciula commented Dec 12, 2024

@mgenware I already have these dlls in folder with the executable.

I've tried running the executable and catching stdout and stderr but I don't get anything useful. I tried different ffmpeg/ffprobe binaries and ffprobe now no longer fails. But ffmpeg still crashes the app.

Can you please share the exact ffmpeg and ffprobe binaries that you have successfully used in the apps?

@mgenware
Copy link

@kaciula I'm using ffprobe binaries from here. Never tried ffmpeg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request library Affects the library scripts Affect build scripts windows Affects Windows platform
Projects
Status: 🆕 New
Development

No branches or pull requests