4

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

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

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.

maxfridbe
  • 5,872
  • 10
  • 58
  • 80
  • 1
    If you do end up going the wrap FFMpeg route this question / answer might be useful to you: Solid FFmpeg wrapper for C#/.NET - http://stackoverflow.com/questions/2163036/solid-ffmpeg-wrapper-for-c-net – robowahoo Nov 21 '11 at 18:26

1 Answers1

6

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.

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 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.

knocte
  • 16,941
  • 11
  • 79
  • 125
  • Are you saying than Banshee still uses Gstreamer Sharp now?? I'm porting a windows client app over to mono on linux and i'm looking for a solution to play short audio files. GStreamer Sharp will do it? – Roberto Bonini Feb 13 '12 at 13:54
  • Yes, Banshee uses GStreamerSharp on Windows, and will soon be defaulting to GStreamerSharp on Linux too. – knocte Mar 08 '12 at 01:16