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

Ability to install ffmpeg suite at runtime added with FFMpegDownloader #442

Open
wants to merge 26 commits into
base: main
Choose a base branch
from

Conversation

yuqian5
Copy link

@yuqian5 yuqian5 commented May 5, 2023

The ability to install desired binary at runtime offers convenience and flexibility to the devs. Xabe.FFmpeg have similar features.

While this current implementation only supports windows, MacOS and Linux support can be added in the future with relative ease.

Runtime Auto Installation

You can install a version of ffmpeg suite at runtime using FFMpegDownloader.DownloadFFMpegSuite();

Or you can download only the desired binary using FFMpegDownloader.DownloadFFMpeg(), FFMpegDownloader.DownloadFFProbe(), FFMpegDownloader.DownloadFFPlay().

OS Support
Windows YES
Mac OSX YES
Linux YES

@codecov-commenter
Copy link

codecov-commenter commented May 5, 2023

Codecov Report

Attention: 133 lines in your changes are missing coverage. Please review.

Comparison is base (f8407bc) 74.31% compared to head (22fa002) 71.60%.
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #442      +/-   ##
==========================================
- Coverage   74.31%   71.60%   -2.72%     
==========================================
  Files         113      116       +3     
  Lines        2854     3032     +178     
==========================================
+ Hits         2121     2171      +50     
- Misses        733      861     +128     
Files Coverage Δ
FFMpegCore/FFMpeg/FFMpegArguments.cs 83.56% <100.00%> (+2.91%) ⬆️
FFMpegCore/FFMpeg/FFMpegMultiOutputOptions.cs 84.61% <84.61%> (ø)
FFMpegCore/FFMpeg/Arguments/OutputTeeArgument.cs 71.87% <71.87%> (ø)
...MpegCore.Extensions.Downloader/FFMpegDownloader.cs 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@devedse
Copy link
Contributor

devedse commented May 5, 2023

I'm not the main developer of this tool, but what I didn't really like about the downloader in Xabe is that it downloads a really outdated version.

On the FFMpeg website the currently released version is 6.0, so it would be nice if that version could be downloaded through the downloader.

@yuqian5
Copy link
Author

yuqian5 commented May 5, 2023

@devedse That can be done pretty easily, it’s just adding an url and an enum. We just need a reliable and safe source.

One possible problem is that (from Readme) FFMpegCore is only tested with 3.x and 4.x of ffmpeg. Since we are running the unit tests with the latest version of ffmpeg, this should be okay. In that case, readme should probably be updated.

@rosenbjerg
Copy link
Owner

I would prefer to have such functionality for downloading binaries from a remote source in a separate FFMpegCore.* package, so that we can keep this package as focused as possible, and make it an explicit decision for the users of this library whether they want/need such functionality. Similar to how SkiaSharp and SDC Bitmap support was moved to separate packages.
Could you move the downloader to a new project in the solution?

@rosenbjerg
Copy link
Owner

This library is aimed at being cross-platform, so I think we should support more platforms than just Windows with this feature, before publishing

@yuqian5
Copy link
Author

yuqian5 commented Aug 24, 2023

@rosenbjerg I can move it to a different package and look into supporting macOS and Linux for download.

@yuqian5
Copy link
Author

yuqian5 commented Sep 6, 2023

@rosenbjerg I have made the changes that we talked about. I have tested this on macos arm/intel, ubuntu64 and window64 and everything work as intended. I don't have access to 32bit chips or armel, but because I included the ability to override os and architecture, there shouldn't be a problem.

Please take a look at FFMpegCore.Downloader.csproj, I'm just copied the others.

@yuqian5
Copy link
Author

yuqian5 commented Jan 5, 2024

@rosenbjerg ffbinaries is fixed and now include the latest stable release of ffmpeg. I've updated the downloader to include 5.1 and 6.1. CI for macos is still failing for unrelated issue. If you can take a look, that would be great.

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

Successfully merging this pull request may close these issues.

4 participants