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. how to extract a single bitmap from .avi file?

how to extract a single bitmap from .avi file?

Scheduled Pinned Locked Moved C / C++ / MFC
graphicstutorialquestion
8 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.
  • A Offline
    A Offline
    andreas schaerer
    wrote on last edited by
    #1

    hy, i didnt found out, how i can do this. none of the classes i know, can load a .avi movie and then get a certain frame as a bitmap, does anybody has an idea, how i could do this? thanx a lot!

    T 1 Reply Last reply
    0
    • A andreas schaerer

      hy, i didnt found out, how i can do this. none of the classes i know, can load a .avi movie and then get a certain frame as a bitmap, does anybody has an idea, how i could do this? thanx a lot!

      T Offline
      T Offline
      Ted Ferenc
      wrote on last edited by
      #2

      Look in the MSDN for "AVIview: Read/Write APIs in AVIfile" for the example prog AviView. I actually use AviView as a tool to look at individaul frames within an AVI file.


      "There is no monument dedicated to the memory of a committee." - Lester J. Pourciau

      A 1 Reply Last reply
      0
      • T Ted Ferenc

        Look in the MSDN for "AVIview: Read/Write APIs in AVIfile" for the example prog AviView. I actually use AviView as a tool to look at individaul frames within an AVI file.


        "There is no monument dedicated to the memory of a committee." - Lester J. Pourciau

        A Offline
        A Offline
        andreas schaerer
        wrote on last edited by
        #3

        hy, sorry, but i didnt found anything with this search string(not on the net and also not in the MSDN)! and i also didnt found the sample prog AviView. could you give me more details or an exact link? thanx

        T 1 Reply Last reply
        0
        • A andreas schaerer

          hy, sorry, but i didnt found anything with this search string(not on the net and also not in the MSDN)! and i also didnt found the sample prog AviView. could you give me more details or an exact link? thanx

          T Offline
          T Offline
          Ted Ferenc
          wrote on last edited by
          #4

          Well it is on my MSDN! Honest:-O I found this link http://www.banasoft.net/Links.htm[^] Or I can email to you it is c. 58 KB zipped including the exe file, I would suggest I email as the link could be wrong, let me know.


          "There is no monument dedicated to the memory of a committee." - Lester J. Pourciau

          A 1 Reply Last reply
          0
          • T Ted Ferenc

            Well it is on my MSDN! Honest:-O I found this link http://www.banasoft.net/Links.htm[^] Or I can email to you it is c. 58 KB zipped including the exe file, I would suggest I email as the link could be wrong, let me know.


            "There is no monument dedicated to the memory of a committee." - Lester J. Pourciau

            A Offline
            A Offline
            andreas schaerer
            wrote on last edited by
            #5

            hy, thanx a lot, i could download it. the code seems quite complicated, could you maby tell me shortly, how i can grabb a picture from an avi? for instance load an avi, and get the 4th bitmap of the movie and store it in a CBitmap object. thanx a lot!

            T 1 Reply Last reply
            0
            • A andreas schaerer

              hy, thanx a lot, i could download it. the code seems quite complicated, could you maby tell me shortly, how i can grabb a picture from an avi? for instance load an avi, and get the 4th bitmap of the movie and store it in a CBitmap object. thanx a lot!

              T Offline
              T Offline
              Ted Ferenc
              wrote on last edited by
              #6

              in aviview.c have a look at lpbi = AVIStreamGetFrame(gapgf[giFirstVideo], 0); DrawDibBegin(ghdd[giFirstVideo], NULL,lpbi->biWidth, . . . All drawing to the screen is done via the DrawDib functions, so add your code here to save the data to disk. I would not say this code is very easy to follow but the concepts are straight forward, it will take a while for you to figure it out though! Of course the new way to do this is to use DirectX but that is a different storey, the concept is the same just read the AVI frame by frame or jump to the frame you want then read/save it.


              "There is no monument dedicated to the memory of a committee." - Lester J. Pourciau

              A 1 Reply Last reply
              0
              • T Ted Ferenc

                in aviview.c have a look at lpbi = AVIStreamGetFrame(gapgf[giFirstVideo], 0); DrawDibBegin(ghdd[giFirstVideo], NULL,lpbi->biWidth, . . . All drawing to the screen is done via the DrawDib functions, so add your code here to save the data to disk. I would not say this code is very easy to follow but the concepts are straight forward, it will take a while for you to figure it out though! Of course the new way to do this is to use DirectX but that is a different storey, the concept is the same just read the AVI frame by frame or jump to the frame you want then read/save it.


                "There is no monument dedicated to the memory of a committee." - Lester J. Pourciau

                A Offline
                A Offline
                andreas schaerer
                wrote on last edited by
                #7

                hy, the samplecode worked, and it could do what i wanted, but i am sure there is a easier way, isnt it? arent there any MFC classes, or tricks, to do this easyer? thanx andreas

                T 1 Reply Last reply
                0
                • A andreas schaerer

                  hy, the samplecode worked, and it could do what i wanted, but i am sure there is a easier way, isnt it? arent there any MFC classes, or tricks, to do this easyer? thanx andreas

                  T Offline
                  T Offline
                  Ted Ferenc
                  wrote on last edited by
                  #8

                  There are a few wrapper classes on CP, but I did not like any of them! But that is my personal opinion! so search CP for AVI, I came up with these. I never said the API was easy to follow! After a few months you will realise it is straight forward, it took me ages to figure it out, and I could not really explain to anyone now how it works it is just so badly documented. http://www.codeproject.com/useritems/aviutil_.asp[^] http://www.codeproject.com/audio/avigenerator.asp[^]


                  "There is no monument dedicated to the memory of a committee." - Lester J. Pourciau

                  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