Class Wrapper for Video Compression Manager (VCM)

Introduction

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()).

Downloads

Download source - 4 Kb
Download demo project - 35 Kb


Comments

  • pwyRm Pfy UYck

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

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

    Reply
  • how to use one copression manually?

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

    Originally posted by: Jamal

    hi,

    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!

    Reply
  • 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

    Reply
  • 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???????

    Reply
  • 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++?
    

    Reply
  • 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

    Reply
  • compression

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

    Originally posted by: psc

    how to initialize compressor before capturing avi files manually

    Reply
  • 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.

    Reply
  • 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

    .

    Reply
  • 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 !!

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

Top White Papers and Webcasts

  • Live Event Date: October 29, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Are you interested in building a cognitive application using the power of IBM Watson? Need a platform that provides speed and ease for rapidly deploying this application? Join Chris Madison, Watson Solution Architect, as he walks through the process of building a Watson powered application on IBM Bluemix. Chris will talk about the new Watson Services just released on IBM bluemix, but more importantly he will do a step by step cognitive …

  • Email is the most common communication vehicle used by organizations of all shapes and sizes. Among the billions of email messages sent every day are sensitive information, critical requests, and other essential business data. IT staff bear the burden of ensuring the confidentiality, integrity, and availability of the information contained within the communication. This white paper explores the email security landscape, an assessment of the threats organizations face,  and the building blocks of an effective …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds