The best thing I know is ffmpeg or related libav. Please see:
http://en.wikipedia.org/wiki/FFmpeg[
^],
http://en.wikipedia.org/wiki/Libavcodec[
^],
http://ffmpeg.org/[
^],
http://libav.org/[
^].
You can see how it works and implement it in C#, but it would be huge amount of work, even if you want to implement the required minimum.
A trivial solution will be: to obtain or build executable from source code and then execute it as a child process via
System.Diagnostics.Process.Start
:
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx[
^].
Also, you can obtain and build the libraries and link them using P/Invoke.
If you need to learn P/Invoke, start from here:
http://en.wikipedia.org/wiki/P/Invoke[
^],
http://msdn.microsoft.com/en-us/library/Aa712982[
^].
This CodeProject can also be useful:
Essential P/Invoke[
^].
One alternative to P/Invoke is to use C++/CLI mixed-mode (managed+unmanaged) project. This project could build a DLL required by the global hooks, but it can contain some managed wrapper CLI code, so, from the standpoint of your .NET application, you can use it as a regular .NET assembly, that is, reference it. Please see:
http://en.wikipedia.org/wiki/C%2B%2B/CLI[
^],
http://www.ecma-international.org/publications/standards/Ecma-372.htm[
^],
http://msdn.microsoft.com/en-us/library/xey702bw.aspx[
^],
http://msdn.microsoft.com/en-us/library/3bstk3k5[
^].
If you want to re-distribute the libraries in compiled form, there is a legal problem: due to patent issues or something, they are not re-distributed on pre-compiled form.
—SA