FFMPEG(Libavcodec DLL)+VC++
-
I am able to load(AfxLoadLibrary) the libavcodec dll in a VC7 Dialog based application. However I dont know how to call the functions within this DLL to encode/decode video. Has anybody done anything of this sort?
GetProcAddress for get the address of a function_**
**_
whitesky
-
GetProcAddress for get the address of a function_**
**_
whitesky
-
Ok, the def file says "avcodec_register_all @ 97 ; " so how would I use this with GetProcAddress? "GetProcAddress(hModule, avcodec_register_all);" ?? Some kinda code snippets would be really helpful Thanks anyway for replying
I can explain for you how to use but i think better that you see this link Step by Step: Calling C++ DLLs from VC++ and[^]_**
**_
whitesky
-
I can explain for you how to use but i think better that you see this link Step by Step: Calling C++ DLLs from VC++ and[^]_**
**_
whitesky
I have already had a look at that. But am unsure about the typedef thingy. Plus i am using the AfxLoadLibrary option. This is what I am trying and it builds and executes fine
HMODULE hmodule; hmodule = AfxLoadLibrary("libavcodec.dll"); if (!AfxLoadLibrary(_T("libavcodec.dll"))) // return 1; AfxMessageBox("failed to load"); typedef void * (__stdcall *avcodec_register_all)(); GetProcAddress(hmodule,"avcodec_register_all"); void * objptr= avcodec_register_all();
I know this will sound dumb but if I wanted to encode video, I will have to typedef every function that I call fm the DLL? -- modified at 4:45 Friday 2nd June, 2006 -
I have already had a look at that. But am unsure about the typedef thingy. Plus i am using the AfxLoadLibrary option. This is what I am trying and it builds and executes fine
HMODULE hmodule; hmodule = AfxLoadLibrary("libavcodec.dll"); if (!AfxLoadLibrary(_T("libavcodec.dll"))) // return 1; AfxMessageBox("failed to load"); typedef void * (__stdcall *avcodec_register_all)(); GetProcAddress(hmodule,"avcodec_register_all"); void * objptr= avcodec_register_all();
I know this will sound dumb but if I wanted to encode video, I will have to typedef every function that I call fm the DLL? -- modified at 4:45 Friday 2nd June, 2006i write a sample i hope that helpful to you
/* in dll file extern "C" BSTR FAR PASCAL EXPORT TestFunction(HWND hWnd,TCHAR lpt[50]) { AFX_MANAGE_STATE(AfxGetStaticModuleState()); BSTR Returnbstr; ... ... return Returnbstr; } */ //////////////Include file////////////////// typedef BSTR FAR (WINAPI *TESTFUNCTION)(HWND hWnd,TCHAR lpt[50]); TESTFUNCTION m_TestFunction; /////////////Cpp file/////////////////////////////// LibraryDll=LoadLibrary("Testdll.dll"); m_TestFunction=(TESTFUNCTION)GetProcAddress(LibraryDll,"TestFunction");//function in dll file m_TestFunction(pWnd->m_hWnd,NULL);
_**
**_
whitesky
-
i write a sample i hope that helpful to you
/* in dll file extern "C" BSTR FAR PASCAL EXPORT TestFunction(HWND hWnd,TCHAR lpt[50]) { AFX_MANAGE_STATE(AfxGetStaticModuleState()); BSTR Returnbstr; ... ... return Returnbstr; } */ //////////////Include file////////////////// typedef BSTR FAR (WINAPI *TESTFUNCTION)(HWND hWnd,TCHAR lpt[50]); TESTFUNCTION m_TestFunction; /////////////Cpp file/////////////////////////////// LibraryDll=LoadLibrary("Testdll.dll"); m_TestFunction=(TESTFUNCTION)GetProcAddress(LibraryDll,"TestFunction");//function in dll file m_TestFunction(pWnd->m_hWnd,NULL);
_**
**_
whitesky
-
Thank you for the code :) But i am looking for code specific to FFMPEG and the libavcodec dll. :sigh: Any takers??
I write one example for you but i dont know whats your dll(exactly):)_**
**_
whitesky
-
I write one example for you but i dont know whats your dll(exactly):)_**
**_
whitesky
You can learn more about FFMPEG from http://ffmpeg.mplayerhq.hu/[^] Basically its an Audio/Video encoding/decoding thingy (OpenSource).You get dlls when you build ffmpeg and I am trying to use these DLLs in my VC++ application.Unfortunately, since its OpenSource, there isnt much documentation available online. Thanks for all your help though :-D
-
You can learn more about FFMPEG from http://ffmpeg.mplayerhq.hu/[^] Basically its an Audio/Video encoding/decoding thingy (OpenSource).You get dlls when you build ffmpeg and I am trying to use these DLLs in my VC++ application.Unfortunately, since its OpenSource, there isnt much documentation available online. Thanks for all your help though :-D
Thanks for link :)but where your dll that has problem(exactly address) and if you need to decode and encode you can see codeproject examples_**
**_
whitesky
-
Thanks for link :)but where your dll that has problem(exactly address) and if you need to decode and encode you can see codeproject examples_**
**_
whitesky
-
My dll has no problem. its in trying to use the functions of the dll that I get stuck . I dont know how to do it :-( Sorry for not having made that clear sooner.
ohh yes.ok wheres this dll file and also documets it_**
**_
whitesky
-
ohh yes.ok wheres this dll file and also documets it_**
**_
whitesky
You can download FFMPEG from http://ffmpeg.mplayerhq.hu/download.html[^]. It can be built using MINGW and MinSys Instructions here http://soenkerohde.com/tutorials/ffmpeg/ Or you can directly download a pre-built version of FFMPEG that has the dlls and the exe ready. The dll also has a def file but that's hardly helped since it mentions what functions are there but not the paramters :-(