Click here to Skip to main content
15,903,033 members
Articles / Desktop Programming / MFC
Article

A simple interface to the Video for Windows API for creating AVI movies from individual images

Rate me:
Please Sign up or sign in to vote.
3.54/5 (18 votes)
19 May 2003 215.2K   4.3K   68   38
A simple interface to the Video for Windows API for creating AVI movies from individual images.

Introduction

This article describes a simple interface to the Video for Windows API for creating AVI movies from individual images. The idea for this code comes from a Microsoft sample that was very unfriendly to use. With that in mind, I created this code to easily create an AVI from individual images.

The steps are:

  1. include "aviUtil.h".
  2. Call START_AVI("foo.avi"); // you must include the .avi extention.
  3. Call ADD_FRAME_FROM_DIB_TO_AVI(yourDIB, "DIB", 30); // the dib is passed in as a HANDLE which can be obtained by loading the image with a Image library. (I used CxImage which is available on this site). Put this call in a while or for loop to add all the images you want to the AVI.
  4. Call STOP_AVI(); //this closes the avi and video.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
I enjoy working with C#, Java, Perl and C++

Comments and Discussions

 
GeneralCXIMAGE to AVI... Pin
sherrinmultimedia20-Oct-03 3:57
sherrinmultimedia20-Oct-03 3:57 
GeneralRe: CXIMAGE to AVI... Pin
Ted Ferenc20-Oct-03 4:18
Ted Ferenc20-Oct-03 4:18 
GeneralRe: CXIMAGE to AVI... Pin
sherrinmultimedia20-Oct-03 4:48
sherrinmultimedia20-Oct-03 4:48 
GeneralRe: CXIMAGE to AVI... Pin
vanamburghrod@wmconnect.com20-Oct-03 15:57
sussvanamburghrod@wmconnect.com20-Oct-03 15:57 
GeneralRe: CXIMAGE to AVI... Pin
sherrinmultimedia21-Oct-03 2:42
sherrinmultimedia21-Oct-03 2:42 
GeneralRe: CXIMAGE to AVI... Pin
sherrinmultimedia21-Oct-03 3:36
sherrinmultimedia21-Oct-03 3:36 
GeneralRe: CXIMAGE to AVI... Pin
RoyalVN6-Apr-05 21:45
RoyalVN6-Apr-05 21:45 
GeneralAudio Pin
srinivas vaithianathan27-May-03 6:24
srinivas vaithianathan27-May-03 6:24 
I did not go over the source code yet. Does this include support for audio and synchronization of audio?

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.