.NET FFmpeg wrapper for video playback

19,593

Solution 1

Currently, there is no stable solution for this, so the best idea probably is to wait until someone completes it.

Solution 2

There is a great solution for binding FFmpeg into C#. Use the FFmpeg.Autogen from: https://github.com/Ruslan-B/FFmpeg.AutoGen. It also provides a good example when downloading the source (and it comes with precompied ffmpeg for 32 and 64 bits)!

Solution 3

From what I know, there's no clean way to utilize ffmpeg from C# via P/Invoke, hence all these wrappers are incomplete projects. What you can do is to create a process to ffplay.exe (download under shared builds) and pass command line arguments to it. Otherwise I suggest using WPF or Silverlight MediaElement, depending on your needs; it has a pretty decent support for majority of basic tasks like video and audio playback.

Solution 4

Have you looked at VLC Media Player yet? It is a full featured media player that uses the codecs from the FFmpeg project. You can make use of it's core functionality and there is a recently updated wrapper project on SourceForge and a tutorial on The Code Project if you want to create your own. I haven't used either of these personally, but they look fairly straight forward to use.

Solution 5

I don't think such a thing exists and frankly the ffmpeg API is still somewhat unstable, so even if there is something today that meets your needs there is a not insignificant chance that 2 years later it will no longer work/be kept up to date. Furthermore, marshaling data between managed and native code is relatively expensive. 99% of the time this doesn't matter, but in the case where you are dealing with media (especially uncompressed video frames) it can have a noticeable performance impact.

IMO the best way to deal with ffmpeg from C# is to write your interaction logic in C and to expose a higher level API that you can p/invoke to from C#. This would still be the case if there was a proper low level wrapper available.

Share:
19,593
SharpAffair
Author by

SharpAffair

Updated on June 09, 2022

Comments