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

Static link ffmpeg #140

Open
thewh1teagle opened this issue Jan 10, 2024 · 3 comments
Open

Static link ffmpeg #140

thewh1teagle opened this issue Jan 10, 2024 · 3 comments

Comments

@thewh1teagle
Copy link

How can I statically link ffmpeg into executable when compiling in windows inside msys2 ucrt64?
(windows-gnu rustc)

@ldm0
Copy link
Member

ldm0 commented Jan 10, 2024

You can check this: https://github.com/CCExtractor/rusty_ffmpeg?tab=readme-ov-file#fine-grained-usage.
In short, set FFMPEG_PKG_CONFIG_PATH if you have pkg-config files; set FFMPEG_LIBS_DIR + FFMPEG_INCLUDE_DIR vise versa.

@thewh1teagle
Copy link
Author

@ldm0
I'm not sure where I can find ready to use statically linked ffmpeg libraries,
and if I should compile it (maybe it will take long time to compile...)
Did you tried it in msys2?

@ldm0
Copy link
Member

ldm0 commented Jan 11, 2024

@ldm0 I'm not sure where I can find ready to use statically linked ffmpeg libraries and if I should compile it.

It's not recommended to use prebuilt statically linked FFmpeg libraries due to the verbosity of build options and license issues(usage of different build options result in libraries with different open source licenses). You should compile it locally and tweak the build options according to your project requirements.

(maybe it will take long time to compile...)

People only need to compile FFmpeg once as long as they don't change FFmpeg source code & version. BTW, FFmpeg compilation won't take that long time if you have disable the artifacts you don't want.

Did you tried it in msys2?

Nope. I compile FFmpeg for Windows with MinGW. But it should work fine as rsmpeg only needs to link the final static libraries.

Here are some references you may need to compile FFmpeg with MSYS2

  1. https://trac.ffmpeg.org/wiki/CompilationGuide/MinGW#Option2:MSYS2
  2. https://gist.github.com/crossle/43e356468d160902f03ffd25d6a045ba

Feel free to file an issue here if you encounter any problem.

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