跨平台C#Media API [英] Cross Platform C# Media API
问题描述
我正在尝试在mono / .net对象中定义一个VideoFile,以便我可以调用
I'm trying to define a VideoFile in mono/.net object such that I can call
var file = new VideoFile(filepath);
file.VideoDuration
是否有可以跨平台工作的库(os或商业) mono / .net可以提供诸如VideoDuration之类的信息。只有当我这样做的时候才会包装ffmpeg.exe并读取控制台out-stream。
Is there a library (os or commercial) which will work across platforms mono/.net which can provide information such as VideoDuration. The only though I have had on this currently is to wrap ffmpeg.exe and read the console out-stream.
推荐答案
GStreamer 是一个很好的选择,它是一个跨平台的多媒体框架。还有一些绑定可以满足您的需求:通过.NET API访问您需要的信息(视频文件的长度): GStreamerSharp 。
GStreamer is good option, it's a cross platform multimedia framework. And there are bindings that would meet your needs: access the information you require (length of a video file) via a .NET API: GStreamerSharp.
的确,我们实际上使用它在 Banshee Project ,一个用C#编写的媒体播放器(这是Ubuntu中捆绑的默认音乐播放器)。
Indeed, we actually use it in the Banshee Project, a media player written in C# (which is the default music player bundled in Ubuntu).
BTW,GStreamer的设计方式是编解码器是插件,所以你有一个抽象的内部(即ffmpeg)其他插件可以满足,取决于你的许可/格式需求。
BTW, GStreamer is architected in a way that codecs are plugins, so you have an abstraction between the internals of them (i.e. ffmpeg) which other plugins could fulfill depending on your licensing/format needs.
这篇关于跨平台C#Media API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!