PDA

View Full Version : x264vfw.dll - using x264 in live streaming...


seahawk789
9th June 2009, 11:48
I heard that it is possible to use x264vfw.dll for encoding live video & that it contains an exportable function called "Configure" which can be used for configuring the encoder.

Is it possible to use this dll in C# applications?

Is this option feasible? Are there any sites where such tutorials about usage of dll in C# is available?
Please help me...

LoRd_MuldeR
9th June 2009, 21:40
Why would you want to access x264 through the VFW wrapper with all its limitations instead of calling the libx264.dll directly? :confused:

And yes, as far as I know it should be possible to call "native" DLL's (I think this is called "unmanaged code" in .NET jargon) from a C# application.
But I cannot tell you how to do that exactly, as I'm not using .Net actively...

[EDIT]

Have a look here:
http://www.devsource.com/c/a/Using-VS/Calling-Unmanaged-Code-from-Net/

seahawk789
10th June 2009, 05:27
thanx 4 the tip..

seahawk789
11th June 2009, 11:31
But when I tried to import libx264.dll to my C# Project I got an error stating that only a valid assembly or com object can be referenced. What application shall I use to make use of the functions in it?

LoRd_MuldeR
11th June 2009, 13:33
Of course it cannot be imported as a .NET assembly, because the libx264.dll contains "true" machine code, not .NET pseudo code that needs to run inside a VM (CLR).

Thoroughly read the article I linked to in my previous post. It explains how to call native DLL's (aka "unmanaged code") from within a .NET application...

Gokumon
11th June 2009, 18:10
But when I tried to import libx264.dll to my C# Project I got an error stating that only a valid assembly or com object can be referenced. What application shall I use to make use of the functions in it?

Because you're doing it wrong. You need to use dllimport to get access to the unmanaged dll. For example, if I wanted to access the method AVIFileExit from the avifil32.dll you would put this into your code:

[DllImport("avifil32.dll")]
static extern void AVIFileExit();