有人知道 FFMPEG 的一组 C# 绑定吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/271003/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Anyone know of a set of C# bindings for FFMPEG?
提问by MikeJ
Does anyone know of a set of bindings for C# to drive the FFMpeg library directly ? I could shell to ffmpeg.exe directly but I found it hard to sync/control as a separate process. any help would be appreciated.
有谁知道 C# 的一组绑定可以直接驱动 FFMpeg 库?我可以直接 shell 到 ffmpeg.exe,但我发现作为一个单独的进程很难同步/控制。任何帮助,将不胜感激。
采纳答案by blacktau
Tao.ffmpeg: http://www.taoframework.com/project/ffmpegit compiles and has a binary dist which is more than can be said for ffmpeg-sharp at this point. It is, however, not particularly easy to use.
Tao.ffmpeg:http://www.taoframework.com/project/ffmpeg 它编译并有一个二进制文件,在这一点上,对于 ffmpeg-sharp 来说可以说的更多。然而,它并不是特别容易使用。
回答by CMS
I've seen this library:
我见过这个库:
ffmpeg-sharpa wrapper library over the FFmpeg multimedia suite that provides easy to use wrappers for use in C#.
ffmpeg-sharpFFmpeg 多媒体套件上的包装器库,提供易于使用的包装器以在 C# 中使用。
回答by Greg Beech
It's actually pretty easy to control as a separate process. If you redirect StandardOut and StandardError then you can subscribe to the Process.OnData* events and receive the command line output. It's then trivial enough to parse the status line using a regex and work out things like % complete and so on.
作为一个单独的过程,它实际上很容易控制。如果您重定向 StandardOut 和 StandardError,那么您可以订阅 Process.OnData* 事件并接收命令行输出。然后使用正则表达式解析状态行并计算完成百分比等内容就足够了。
The hardest thing is working out what command line to pass to get decent quality! I'd recommend this pageand this pageif you're using H.264/AAC+.