Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. FFMPEG(Libavcodec DLL)+VC++

FFMPEG(Libavcodec DLL)+VC++

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
13 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Hamid Taebi

    GetProcAddress for get the address of a function_**


    **_

    whitesky


    R Offline
    R Offline
    RahulOP
    wrote on last edited by
    #3

    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

    H 1 Reply Last reply
    0
    • R RahulOP

      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

      H Offline
      H Offline
      Hamid Taebi
      wrote on last edited by
      #4

      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


      R 1 Reply Last reply
      0
      • H Hamid Taebi

        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


        R Offline
        R Offline
        RahulOP
        wrote on last edited by
        #5

        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

        H 1 Reply Last reply
        0
        • R RahulOP

          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

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #6

          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


          R 1 Reply Last reply
          0
          • H Hamid Taebi

            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


            R Offline
            R Offline
            RahulOP
            wrote on last edited by
            #7

            Thank you for the code :) But i am looking for code specific to FFMPEG and the libavcodec dll. :sigh: Any takers??

            H 1 Reply Last reply
            0
            • R RahulOP

              Thank you for the code :) But i am looking for code specific to FFMPEG and the libavcodec dll. :sigh: Any takers??

              H Offline
              H Offline
              Hamid Taebi
              wrote on last edited by
              #8

              I write one example for you but i dont know whats your dll(exactly):)_**


              **_

              whitesky


              R 1 Reply Last reply
              0
              • H Hamid Taebi

                I write one example for you but i dont know whats your dll(exactly):)_**


                **_

                whitesky


                R Offline
                R Offline
                RahulOP
                wrote on last edited by
                #9

                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

                H 1 Reply Last reply
                0
                • R RahulOP

                  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

                  H Offline
                  H Offline
                  Hamid Taebi
                  wrote on last edited by
                  #10

                  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


                  R 1 Reply Last reply
                  0
                  • H Hamid Taebi

                    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


                    R Offline
                    R Offline
                    RahulOP
                    wrote on last edited by
                    #11

                    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.

                    H 1 Reply Last reply
                    0
                    • R RahulOP

                      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.

                      H Offline
                      H Offline
                      Hamid Taebi
                      wrote on last edited by
                      #12

                      ohh yes.ok wheres this dll file and also documets it_**


                      **_

                      whitesky


                      R 1 Reply Last reply
                      0
                      • H Hamid Taebi

                        ohh yes.ok wheres this dll file and also documets it_**


                        **_

                        whitesky


                        R Offline
                        R Offline
                        RahulOP
                        wrote on last edited by
                        #13

                        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 :-(

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups