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 Decrease Video Size

How To Decrease Video Size

Scheduled Pinned Locked Moved C / C++ / MFC
jsonhelptutorialquestion
5 Posts 3 Posters 8 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
    AmbiguousName
    wrote on last edited by
    #1

    Hello. I have been, somehow :), able to capture video from my USB camera using media foundation api. But the problem is that for a duration of about 10 seconds, the video size is 70-72 mb. I don't have to tell you that, that is a lot of video size for this duration. I have tried lowering Frame Rate and AVG BitRate of the video stream but in vain. What should I change to get this size to minimum? Thanks for any pointers.

    This world is going to explode due to international politics, SOON.

    S S 2 Replies Last reply
    0
    • A AmbiguousName

      Hello. I have been, somehow :), able to capture video from my USB camera using media foundation api. But the problem is that for a duration of about 10 seconds, the video size is 70-72 mb. I don't have to tell you that, that is a lot of video size for this duration. I have tried lowering Frame Rate and AVG BitRate of the video stream but in vain. What should I change to get this size to minimum? Thanks for any pointers.

      This world is going to explode due to international politics, SOON.

      S Offline
      S Offline
      SoMad
      wrote on last edited by
      #2

      It is little hard to tell you exactly what your best course of action is, because you have left out some key information, such as image resolution, video format and frame rate. However, your numbers are typical if you are storing uncompressed video with the following settings: Resolution: 352x288 Video format: AVI, Raw video (RGB or YUV) at 24 bits per pixel Frame rate: 25 FPS. [Resolution and Frame rate based on PAL being the TV standard used in Pakistan] If the above values seem correct to you, you need to compress the video in order to make the video size smaller. There are obviously many video formats, such as MJPEG, MPEG2, MPEG4, H.264 and so on. You would need to determine the best fit for your project. Your USB camera might be able to deliver compressed video in different formats, but if it does not, you will have to do the compression on your computer as the raw video frames are being received from the camera. If I am dead wrong and you are actually storing high resolution images, then we need to come at this from another angle. Soren Madsen

      "When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty

      A 1 Reply Last reply
      0
      • S SoMad

        It is little hard to tell you exactly what your best course of action is, because you have left out some key information, such as image resolution, video format and frame rate. However, your numbers are typical if you are storing uncompressed video with the following settings: Resolution: 352x288 Video format: AVI, Raw video (RGB or YUV) at 24 bits per pixel Frame rate: 25 FPS. [Resolution and Frame rate based on PAL being the TV standard used in Pakistan] If the above values seem correct to you, you need to compress the video in order to make the video size smaller. There are obviously many video formats, such as MJPEG, MPEG2, MPEG4, H.264 and so on. You would need to determine the best fit for your project. Your USB camera might be able to deliver compressed video in different formats, but if it does not, you will have to do the compression on your computer as the raw video frames are being received from the camera. If I am dead wrong and you are actually storing high resolution images, then we need to come at this from another angle. Soren Madsen

        "When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty

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

        Camera is giving me the video with following attributes. Resolution = 640 x 480; Frame Rate = 30 fps; Color Scheme = RGB32 Encoding Format = WMV; Since I am storing video data as .wmv, does't it mean that video being stored is compressed (or encoded) ?

        This world is going to explode due to international politics, SOON.

        S 1 Reply Last reply
        0
        • A AmbiguousName

          Hello. I have been, somehow :), able to capture video from my USB camera using media foundation api. But the problem is that for a duration of about 10 seconds, the video size is 70-72 mb. I don't have to tell you that, that is a lot of video size for this duration. I have tried lowering Frame Rate and AVG BitRate of the video stream but in vain. What should I change to get this size to minimum? Thanks for any pointers.

          This world is going to explode due to international politics, SOON.

          S Offline
          S Offline
          Software_Developer
          wrote on last edited by
          #4

          Encode it as an MP4 File. MP4 video files are up to four times smaller than mpeg videos. Tutorial: Encoding an MP4 File : http://msdn.microsoft.com/en-us/library/windows/desktop/ff819476(v=vs.85).aspx[^] Media Foundation Programming Guide : http://msdn.microsoft.com/en-us/library/windows/desktop/ms697062(v=vs.85).aspx[^] video capture sample : http://code.msdn.microsoft.com/windowsdesktop/Media-Foundation-Capture-78504c83[^]

          1 Reply Last reply
          0
          • A AmbiguousName

            Camera is giving me the video with following attributes. Resolution = 640 x 480; Frame Rate = 30 fps; Color Scheme = RGB32 Encoding Format = WMV; Since I am storing video data as .wmv, does't it mean that video being stored is compressed (or encoded) ?

            This world is going to explode due to international politics, SOON.

            S Offline
            S Offline
            SoMad
            wrote on last edited by
            #5

            AmbiguousName wrote:

            Since I am storing video data as .wmv, does't it mean that video being stored is compressed (or encoded) ?

            Yes, your video is compressed, but not by much. If you do the calculation to see how large a 10 second uncompressed video file would be using your values, you get something like this: 640 * 480 * (32/8) * 30 * 10 = 368,640,000 = 352 MB This shows that the raw video is about 5 times larger than your compressed video. That is not an impressive compression ratio at all, so you should consider switching to H.264 as suggested by SuperCoder2014. Soren Madsen

            "When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty

            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