Class Wrapper for Video Compression Manager (VCM)
Posted
by Vadim Gorbatenko
on November 7th, 2000
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:- Processing a real-time video data from capture card with h/w codec
- Compressing/decompressing AVI file and writing results to the disk
- Compressing and decompressing single video image.
No comments about (1) and (2): this is the most usual way for utilizing VCM service.CVidcclass 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.
- Create
CVidcclass object - Call
OpenCompressor()method to initialize compressing, or suitable kind ofOpenDecompressor()for decompressing. - Setup your callback function using
SetProgressCallback()method if you need a progress notification. - Call
Compress()orDecompress(). If you need to decompress single image from sequence
you can probably useDecompressEx(), which accepts special flags( see SDK for more info). - 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 ofCVidc
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 KbDownload demo project - 35 Kb

Comments
pwyRm Pfy UYck
Posted by POxBinPElK on 04/12/2013 09:44pmtramadol 50mg buy tramadol online usa - tramadol 100mg get you high
Replyhow to use one copression manually?
Posted by Legacy on 01/22/2004 12:00amOriginally 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!
ReplyASF&wmv
Posted by Legacy on 03/09/2003 12:00amOriginally posted by: reem
can u teel me how to deal with asf,wmv videos and convert between them
ReplyHow to use the H.263 Algorithm
Posted by Legacy on 02/13/2003 12:00amOriginally 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???????
Replyavi file to mpeg file
Posted by Legacy on 11/11/2002 12:00amOriginally posted by: vibhavari
Replyavi file
Posted by Legacy on 05/09/2002 12:00amOriginally posted by: srinu
how to write a compressed frame back to avi file
Replycompression
Posted by Legacy on 04/20/2002 12:00amOriginally posted by: psc
how to initialize compressor before capturing avi files manually
ReplyThanks for this
Posted by Legacy on 02/20/2002 12:00amOriginally posted by: Steven Warwick
Great stuff, I was looking for how to impliment this for awhile now, just couldnt find a good example anywhere.
ReplyThanks, Where can I found the document of VCM driver(how to write a driver)?(NULL)
Posted by Legacy on 12/12/2001 12:00amOriginally posted by: Rao
.
Replythank!!! thank!!! thank!!! thank!!!
Posted by Legacy on 12/07/2001 12:00amOriginally posted by: jam Lee
i don't speak english......
but, i must talking about my pleasure
thank you !!
Reply