跨平台的C#媒体API媒体、平台、API

2023-09-04 11:37:25 作者:一夜浮华

我试图定义一个单声道VideoFile / .NET对象,这样我可以叫

I'm trying to define a VideoFile in mono/.net object such that I can call

var file = new VideoFile(filepath);
file.VideoDuration 

有一个库(OS或商业),这将跨平台的单声道/ .NET,可以提供诸如VideoDuration工作。唯一的,虽然我已经对这个目前是包装ffmpeg.exe并宣读了控制台输出流。

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.

事实上,我们实际使用它在女妖项目,媒体播放器写在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).

顺便说一句,GStreamer是架构的方式,codeCS的插件,所以你让他们(即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.

 
精彩推荐
图片推荐