Class Wrapper for Video Compression Manager (VCM)


The video compression manager (VCM) provides access to the interface used by installable compressors to handle real-time data. Typically applications use installable compressors to perform compressing and decompressing video data. The simplest solution for decompressing is using a DrawDib API, which is wraps all necessary functionality and provide a simple way for visualization of compressed images. The same approach has been used in MCIWnd for displaying an AVI files. All in all, looks like there is no reason to deal with low-level VCM API in most cases excepting:
  1. Processing a real-time video data from capture card with h/w codec
  2. Compressing/decompressing AVI file and writing results to the disk
  3. Compressing and decompressing single video image.
    No comments about (1) and (2): this is the most usual way for utilizing VCM service. CVidc class presented below is intended for compressing and decompressing single video image, although it can be easy modified for any other purpose. I had a special reason for developing this class: in fact video codecs has an extremely high rate of decompression, no one from existing image compressors can compare with video codecs. At the same time, all of them are quite slow for compression. Thereby when you need to store many compressed images and provide the fastest reading, using the video codec seems to be the best solution.

Class implementation.

CVidc class includes several methods from the list VCM services for compressing and decompressing single video image. Class does not support drawing (ICDrawXXX) and sequence compressing (ICSeqCompressFrameXXX).

Class usage.

  1. Create CVidc class object
  2. Call OpenCompressor() method to initialize compressing, or suitable kind of OpenDecompressor() for decompressing.
  3. Setup your callback function using SetProgressCallback() method if you need a progress notification.
  4. Call Compress() or Decompress(). If you need to decompress single image from sequence
    you can probably use DecompressEx(), which accepts special flags( see SDK for more info).
  5. Close codec using Close() method.

Class also provides a few services for querying format, enumerating installed codecs, obtaining information from codec and so on. See Vidc.h for more info.

Remark about capturing compressed video data.

I can predict some questions about using of CVidc for capturing together with AviCap wrapper presented earlier.
I did not test this combination. You can try to use DecompressEx() method with proper conversion of VHDR_KEYFRAME (dwFlags in VIDEOHDR) into ICDECOMPRESS_NOTKEYFRAME (dwFlags argument for DecompressEx()).


Download source - 4 Kb
Download demo project - 35 Kb


  • pwyRm Pfy UYck

    Posted by POxBinPElK on 04/12/2013 09:44pm

    tramadol 50mg buy tramadol online usa - tramadol 100mg get you high

  • how to use one copression manually?

    Posted by Legacy on 01/22/2004 12:00am

    Originally posted by: Jamal


    how to use one compressor without choosing them from a standard dialog box for compressors showed by call to "AVISaveOptions". I want fixe my compressor from code and generate my compressed frame for creating my AVI file, i dont now if have to use streams or not! a sample code will resolve probleme(some links if any).

    thanks for help!

  • ASF&wmv

    Posted by Legacy on 03/09/2003 12:00am

    Originally posted by: reem

    can u teel me how to deal with asf,wmv videos and convert between them

  • How to use the H.263 Algorithm

    Posted by Legacy on 02/13/2003 12:00am

    Originally posted by: Ahmed Sobhi

    i m developing a video Conference application for my graduation project,, so i captured video stream from the Web Cam,,but the image frames are in format RGB24,,,but the H.263 doesnt support this formats ,,it support QCIF,CIF,4CIF,16CIF so the solution is to convert the RGB to QCIF?????????? and if so whats the algortihm for this???????

  • avi file to mpeg file

    Posted by Legacy on 11/11/2002 12:00am

    Originally posted by: vibhavari

    how to convert .avi file to mpeg compressed file with line in sound card in vc++?

  • avi file

    Posted by Legacy on 05/09/2002 12:00am

    Originally posted by: srinu

    how to write a compressed frame back to avi file

  • compression

    Posted by Legacy on 04/20/2002 12:00am

    Originally posted by: psc

    how to initialize compressor before capturing avi files manually

  • Thanks for this

    Posted by Legacy on 02/20/2002 12:00am

    Originally posted by: Steven Warwick

    Great stuff, I was looking for how to impliment this for awhile now, just couldnt find a good example anywhere.

  • Thanks, Where can I found the document of VCM driver(how to write a driver)?(NULL)

    Posted by Legacy on 12/12/2001 12:00am

    Originally posted by: Rao


  • thank!!! thank!!! thank!!! thank!!!

    Posted by Legacy on 12/07/2001 12:00am

    Originally posted by: jam Lee

    i don't speak english......
    but, i must talking about my pleasure

    thank you !!

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Finance leaders have been talking about expanding the value-added role of their teams for a long time. The debate is no longer whether the finance and accounting function needs to become a more strategic partner to the rest of the business but rather how to get there. Technology innovation has caught up to this ambition, and what was once aspiration can be a reality – and the choice is now yours. Read this research report to learn how to make the most of information tools to enable innovation and growth.

  • The mobile market is white hot. Building a well-crafted product development plan that addresses market research, strategy, design, and development will provide the greatest chance for success. Each phase of an app's lifecycle is critical to the its overall success and feeds into the next step of the process of product development for the app. This white paper examines the five key phases of mobile app creation, one by one, to understand how they work together to help create a successful mobile app.

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date