Ruslan-B / FFmpeg.AutoGen

FFmpeg auto generated unsafe bindings for C#/.NET and Core (Linux, MacOS and Mono).
GNU Lesser General Public License v3.0
1.37k stars 323 forks source link

Recommendations for container deployment #276

Closed CN-HM closed 1 year ago

CN-HM commented 1 year ago

Note: for support questions, please use stackoverflow or special repository on [github.com](in special repository github.com). This repository's issues are reserved for feature requests and bug reports.

1、在dockerfile中复制文件到Debian容器中

FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base ........... (省略多余代码) COPY your_path/FFmpeg/lib/ /usr/lib/x86_64-linux-gnu // 此步骤可以省略,复制之后可以使用 ffmpeg -v 命令查看版本 COPY your_path/FFmpeg/usr_bin/ /usr/bin ........... (省略多余代码)

2、准备ffmpeg编译后的lib

编译后的文件可以从该仓库下载:https://github.com/BtbN/FFmpeg-Builds/releases 选择对应的版本下载即可

3、在项目中注册ffmpeg

if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) { if (!Directory.Exists(LinuxDefaultDirectory)) {
Console.WriteLine($"{LinuxDefaultDirectory} not found! Register FFmpeg failed!");
}
DynamicallyLoadedBindings.LibrariesPath = LinuxDefaultDirectory; }

Ruslan-B commented 1 year ago

Please translate to English. Otherwise I'll delete it. But have a feeling it is random question of common misuse. Disrespectful.

CN-HM commented 1 year ago

Ok, I've translated it into English, and your sample code doesn't include code used in the Linux environment, so as a beginner you need to rummage around for information, that's all for the convenience of beginners.

Ruslan-B commented 1 year ago

Not understand - I clearly mentioned you provide native binaries - you can assemble GPL version as you wish. Just specify path to it. How complex it could be? To install just a single command on Debian. How it connected to repo - hard to imagine. Not for beginners as interop in C# requires some advanced knowledge. Works on linux and OS X and windows - but you have to know how to handle infrastructure. A bit beyond goals of this repo. It mostly works, only on very specific situation it will fail.

My expectation - you supposed to know where and how you install native binaries.