BmpToAvi

DirectShow source filter
Download

BmpToAvi Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Freeware
  • Publisher Name:
  • Chris Korda
  • Operating Systems:
  • Windows All
  • File Size:
  • 61 KB

BmpToAvi Tags


BmpToAvi Description

Some applications need to create an AVI file from a series of bitmaps, one frame at time. The VfW (Video for Windows) AviFile API provides a method for doing this, but it can't create files larger than 2 GB, which makes it useless for uncompressed video. The only way to avoid the 2 GB limit is by writing a DirectShow source filter, which is a royal pain, but the good news is, you don't have to do it! You can just download this project instead. BmpToAviTest The BmpToAviTest application will test the BmpToAvi DirectShow source filter. To build BmpToAviTest, you must have the DirectX 8.1 (or higher) header files in your include path. In particular, you need DShow.h and the headers that it includes. Typically the path you want is x:fooDXFDXSDKinclude, where x:foo is the folder you unzipped the SDK into. To run BmpToAviTest, you must have previously registered the BmpToAvi filter, otherwise you will get the error, "Can't create BmpToAvi filter, Class not registered". Use the batch file reg.bat to register the filter, and use unreg.bat to unregister it. Note that the application's installer normally takes care of registering and unregistering COM objects. The application displays a dialog which allows you to select a compressor and configure it. The compression dialog is backwardly compatible with the dialog displayed by AVISaveOptions in the legacy VfW interface, though it offers a superset of the VfW dialog's capabilities. The application's main loop is the Test function in BmpToAviTest.cpp. This function generates a test video with attributes as specified by the Parms structure (Width, Height, BitCount, and FrameRate), as well as FrameCount and Path. The function creates a bitmap, using CreateFrame, repeatedly writes a moving test pattern to it, using DrawFrame, and add each frame to the output video by passing the bitmap handle to CAviToBmp::AddFrame. Note that the example only creates a single bitmap and then reuses it. This is more efficient than creating and destroying a bitmap for each frame. The video attributes can be changed by editing the values in main. To test the application's ability to generate videos larger than 2 GB, simply change the frame count to a sufficiently large number, and select "Uncompressed" in the compression dialog. At the default settings (640 x 480, 16 bit, 25 FPS), the application generates 614KB per frame, so a frame count of 4000 (160 seconds) would be adequate.


BmpToAvi Related Software