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.
4 Answers
I've seen this library:
ffmpeg-sharp a wrapper library over the FFmpeg multimedia suite that provides easy to use wrappers for use in C#.

- 807,428
- 183
- 922
- 838
-
I had seen this but wasnt sure how good it was. thanks. – MikeJ Nov 07 '08 at 17:42
-
3I just checkout latest version of ffmpeg-sharp and it doesn't compile :-( – Jakub Šturc Apr 23 '09 at 13:53
-
The Interop part compiles & works fine. – Robert Fraser Jul 25 '09 at 04:29
-
1-1: None of this currently compiles. – casperOne Sep 13 '10 at 00:38
-
6So it's been quite a while (over 3 years) since I was last able to tackle the project and I know this question is very old, but I just wanted to post that I've made a major update to the library and that it now compiles and the examples work. Hopefully it will work well for your project or others that might see this. – Justin Cherniak Jan 06 '12 at 05:48
-
1@JustinCherniak Thanks, I hope you'll continue developing your wrapper. Few good alternatives out there – D.Rosado Feb 27 '12 at 15:38
-
Currently compiles but doesn't run http://stackoverflow.com/q/15625981/340760 – BrunoLM Mar 25 '13 at 22:45
-
1same issue, the sample player compiles but throws an exception as soon as I try to play a standard mp4 or anything else. – timonsku Jul 19 '13 at 21:54
-
Link broken now? – B''H Bi'ezras -- Boruch Hashem Oct 20 '20 at 06:52
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.
The hardest thing is working out what command line to pass to get decent quality! I'd recommend this page and this page if you're using H.264/AAC+.

- 133,383
- 43
- 204
- 250
-
Great tip, Greg. Links don't work, so maybe just Google "ffmpeg-x264-encoding-guide" (without the quotes). – Avi Dec 07 '11 at 11:55
-
Too bad there's no option to make it accept / output XML or JSON or something standardized (a few command line apps, like bzr for example, are doing this now, since it makes it easier to automate them). -- Also FFMPEG sometimes updates the same line repeatedly, or inserts newlines and repeats the info non-deterministically... might make it really hard to automate this way. – BrainSlugs83 Aug 04 '14 at 19:59
Tao.ffmpeg: http://www.taoframework.com/project/ffmpeg it 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.

- 169
- 1
- 4
-
This one actually works. Unfortunately the function signatures aren't set up for automatic marshalling; expect lots of `IntPtr` parameters. – Roman Starkov Oct 30 '11 at 22:24
-
-
Well, "gone" is not the right word... you can still retrieve all versions from the SF archive [link](http://sourceforge.net/projects/taoframework/files/The%20Tao%20Framework/) – MrCC Jul 08 '14 at 03:48