views:

2864

answers:

3

How to encode video on the fly and send it trough the network from C#?

Can't find a suitable library. I need to encode in WMV and don't mind if the actual encoding is made in C++ as long as the library has a .NET assembly available.

Thanks

+2  A: 

I'm aware of ffmpeg, but it is native C code only. If you're ok with interoperability this may be your ticket.

Edit: It turns out someone already wrapped this in a .NET assembly. It's called FFlib.NET.

spoulson
A: 

Depending on what you are encoding (size, framerate, hardware, etc) real-time encoding may not even be possible. Video encoding is VERY CPU intensive.

Andrew Burns
A: 

I use the Windows Media Format SDK, although I admit I use it directly in C++ native code. I believe it can be called from managed code.

This is now included as part of the Windows SDK here:

http://msdn.microsoft.com/en-us/windows/bb190307.aspx

(or you can download it separately - see the list in the left-hand panel)

Be warned, it is a fair bit to get your head around. However, there are sample code resources which should assist.

Mike Pollitt