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. Reading Compressed AVI Video file

Reading Compressed AVI Video file

Scheduled Pinned Locked Moved C / C++ / MFC
json
11 Posts 3 Posters 12 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
    ashwath1979
    wrote on last edited by
    #1

    Hi All, I want to extract frames from a compressed AVI video file. I have used WIN32 Apis such as "AVIStreamGetFrameOpen" to extract frames from a uncompressed AVI video file.But for a compressed AVI video file the API "AVIStreamGetFrameOpen" returns NULL.Are there APIs to extract frames from a compressed AVI as well as uncompressed AVI file. Please let me know. Thanking in advance, ashwath.

    _ 1 Reply Last reply
    0
    • A ashwath1979

      Hi All, I want to extract frames from a compressed AVI video file. I have used WIN32 Apis such as "AVIStreamGetFrameOpen" to extract frames from a uncompressed AVI video file.But for a compressed AVI video file the API "AVIStreamGetFrameOpen" returns NULL.Are there APIs to extract frames from a compressed AVI as well as uncompressed AVI file. Please let me know. Thanking in advance, ashwath.

      _ Offline
      _ Offline
      _Flaviu
      wrote on last edited by
      #2

      Maybe this[^] will help you ...

      A 1 Reply Last reply
      0
      • _ _Flaviu

        Maybe this[^] will help you ...

        A Offline
        A Offline
        ashwath1979
        wrote on last edited by
        #3

        HI, I saw the link but it is not helping me.I have to first decompress the compressed AVI file and then extract individual frames from that decompressed AVI file. Could you please help me in this. Thanking in advance, Ashwath.

        S 1 Reply Last reply
        0
        • A ashwath1979

          HI, I saw the link but it is not helping me.I have to first decompress the compressed AVI file and then extract individual frames from that decompressed AVI file. Could you please help me in this. Thanking in advance, Ashwath.

          S Offline
          S Offline
          Shaheed Legion
          wrote on last edited by
          #4

          Hi, Ashwath. If you are allowed to use ffmpeg in your project then the solution code becomes trivial. Else you will need to check the documentation for the ICDecompress function. You are using the win32 apis to load your avi file, they are very slow and require you to use COM interfaces to decompress your files - these rely on installed codecs on your machine. Using ffmpeg gives you a solution which comes with its codecs built right into the library. Hope this helps.

          For awesome websites or just to chat check out my blog for more info. . .

          A 1 Reply Last reply
          0
          • S Shaheed Legion

            Hi, Ashwath. If you are allowed to use ffmpeg in your project then the solution code becomes trivial. Else you will need to check the documentation for the ICDecompress function. You are using the win32 apis to load your avi file, they are very slow and require you to use COM interfaces to decompress your files - these rely on installed codecs on your machine. Using ffmpeg gives you a solution which comes with its codecs built right into the library. Hope this helps.

            For awesome websites or just to chat check out my blog for more info. . .

            A Offline
            A Offline
            ashwath1979
            wrote on last edited by
            #5

            Hi , Thanks for your reply. My aim is to decompress the AVI file and extract each frames pixel values into an array for futher processing. Is it possible with FFMPEG or using IDecompress function? Please do let me know. Thanks, ashwath.

            S 1 Reply Last reply
            0
            • A ashwath1979

              Hi , Thanks for your reply. My aim is to decompress the AVI file and extract each frames pixel values into an array for futher processing. Is it possible with FFMPEG or using IDecompress function? Please do let me know. Thanks, ashwath.

              S Offline
              S Offline
              Shaheed Legion
              wrote on last edited by
              #6

              Hi, it is possible to do this using both methods:, but it is easier using ffmpeg. I would recommend you Google ffmpeg and check their examples, you could accomplish your task in about 60 lines of code. Happy coding

              For awesome websites or just to chat check out my blog for more info. . .

              A 2 Replies Last reply
              0
              • S Shaheed Legion

                Hi, it is possible to do this using both methods:, but it is easier using ffmpeg. I would recommend you Google ffmpeg and check their examples, you could accomplish your task in about 60 lines of code. Happy coding

                For awesome websites or just to chat check out my blog for more info. . .

                A Offline
                A Offline
                ashwath1979
                wrote on last edited by
                #7

                Thanks a lot for your reply.

                1 Reply Last reply
                0
                • S Shaheed Legion

                  Hi, it is possible to do this using both methods:, but it is easier using ffmpeg. I would recommend you Google ffmpeg and check their examples, you could accomplish your task in about 60 lines of code. Happy coding

                  For awesome websites or just to chat check out my blog for more info. . .

                  A Offline
                  A Offline
                  ashwath1979
                  wrote on last edited by
                  #8

                  Hi , Thanks for ur suggestion.I have two AVI files.One is compressed and the other is uncompressed.I want to extract the frames from both the AVI files.Will the FFMPEG library work for both compressed and uncompressed AVI files? Please suggest me on this. Thanking you in advance, Ashwath.

                  S 1 Reply Last reply
                  0
                  • A ashwath1979

                    Hi , Thanks for ur suggestion.I have two AVI files.One is compressed and the other is uncompressed.I want to extract the frames from both the AVI files.Will the FFMPEG library work for both compressed and uncompressed AVI files? Please suggest me on this. Thanking you in advance, Ashwath.

                    S Offline
                    S Offline
                    Shaheed Legion
                    wrote on last edited by
                    #9

                    Hi Ashwath, the FFMPEG library will work for both files. As a side note, the library comes with pre built executables which you could use to immediately extract the frames you need, there are tons of articles online about how to do this - just download the library an programs from here and check their online documentation for the parameters you need to extract the frames.

                    For awesome websites or just to chat check out my blog for more info. . .

                    A 1 Reply Last reply
                    0
                    • S Shaheed Legion

                      Hi Ashwath, the FFMPEG library will work for both files. As a side note, the library comes with pre built executables which you could use to immediately extract the frames you need, there are tons of articles online about how to do this - just download the library an programs from here and check their online documentation for the parameters you need to extract the frames.

                      For awesome websites or just to chat check out my blog for more info. . .

                      A Offline
                      A Offline
                      ashwath1979
                      wrote on last edited by
                      #10

                      Hi , Actually what i am doing is that i have created a MFC dialog based GUI.And i want to extract the frame buffer from the compressed AVI file by decompressing it first and then copying the buffer values to unsigned char array and display on a picture control as a bitmap image.And i want to extract all the files in the compressed AVI file in this way and display one by one on the picture control on the MFC GUI. Is it possible to do the above. Please guide me on this. Thanking in advance, ashwath.

                      S 1 Reply Last reply
                      0
                      • A ashwath1979

                        Hi , Actually what i am doing is that i have created a MFC dialog based GUI.And i want to extract the frame buffer from the compressed AVI file by decompressing it first and then copying the buffer values to unsigned char array and display on a picture control as a bitmap image.And i want to extract all the files in the compressed AVI file in this way and display one by one on the picture control on the MFC GUI. Is it possible to do the above. Please guide me on this. Thanking in advance, ashwath.

                        S Offline
                        S Offline
                        Shaheed Legion
                        wrote on last edited by
                        #11

                        You can get an image from the avi stream using ffmpeg, into an av_picture structure, then use the libswscale functions to scale and convert the image into different resolutions or formats, and finally draw the buffer to a control on your mfc gui. You should really Google for code samples.

                        For awesome websites or just to chat check out my blog for more info. . .

                        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