Click here to Skip to main content
15,886,199 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 214.9K   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

 
QuestionIs this AVI 1.0 or 2.0? Pin
teroni18-Nov-13 17:34
teroni18-Nov-13 17:34 
AnswerRe: Is this AVI 1.0 or 2.0? Pin
toann4-Oct-18 11:04
toann4-Oct-18 11:04 
QuestionWorks Great! I modified for no MFC... Pin
John Slagel30-Oct-13 7:24
John Slagel30-Oct-13 7:24 
AnswerRe: Works Great! I modified for no MFC... Pin
Member 311299416-Sep-15 21:02
Member 311299416-Sep-15 21:02 
PraiseRe: Works Great! I modified for no MFC... Pin
Aaron Balint4-Apr-17 14:30
Aaron Balint4-Apr-17 14:30 
AnswerRe: Works Great! I modified for no MFC... Pin
Member 1313934818-Apr-18 9:59
Member 1313934818-Apr-18 9:59 
Generalhelp me Pin
sukumarvenkata18-May-08 19:21
sukumarvenkata18-May-08 19:21 
GeneralThanks! Pin
mmesser26-Jun-07 15:59
mmesser26-Jun-07 15:59 
QuestionLibraries Pin
Ocean_Blue7-Sep-06 14:30
Ocean_Blue7-Sep-06 14:30 
QuestionPlease show me how to create a whole AVI video from lots of BMP images?Thanks. Pin
02921-Aug-06 18:00
02921-Aug-06 18:00 
QuestionTop down dib Pin
pmisik21-Aug-06 2:42
pmisik21-Aug-06 2:42 
GeneralIf you want to write avi files many time ! Pin
zerong26-May-06 6:12
zerong26-May-06 6:12 
GeneralError link sample test application !!! Pin
solon1211-May-06 20:52
solon1211-May-06 20:52 
GeneralFeedback Pin
Vipin Aravind18-Feb-06 19:52
Vipin Aravind18-Feb-06 19:52 
Questionneed help Pin
krishnachn24-Oct-05 18:04
krishnachn24-Oct-05 18:04 
AnswerRe: need help Pin
Rod VanAmburgh25-Oct-05 16:32
Rod VanAmburgh25-Oct-05 16:32 
Generalvideo from tiff images series Pin
dagim12-Oct-05 5:04
dagim12-Oct-05 5:04 
GeneralI need to create an avi from bitmap in Vb.Net Pin
AbramoBarbaresi31-May-05 7:17
AbramoBarbaresi31-May-05 7:17 
GeneralRe: I need to create an avi from bitmap in Vb.Net Pin
Rod VanAmburgh2-Jun-05 17:18
Rod VanAmburgh2-Jun-05 17:18 
GeneralGive me the complete source code please Pin
Rasik200519-Mar-05 0:00
Rasik200519-Mar-05 0:00 
I am not able to understand how to use these functions which you had mentioned. So if possible please give me the complete source code for the same.

Thanking You
Rasik2005
GeneralRe: Give me the complete source code please Pin
Rod VanAmburgh19-Mar-05 13:24
Rod VanAmburgh19-Mar-05 13:24 
QuestionADD_FRAME_FROM_DIB_TO_AVI ? Pin
william_li15-Nov-04 19:49
william_li15-Nov-04 19:49 
QuestionADD_FRAME_FROM_ .. buffer? Pin
mound15-Jun-04 8:13
mound15-Jun-04 8:13 
AnswerRe: ADD_FRAME_FROM_ .. buffer? Pin
Rod VanAmburgh15-Jun-04 15:32
Rod VanAmburgh15-Jun-04 15:32 
GeneralRe: ADD_FRAME_FROM_ .. buffer? Pin
mound16-Jun-04 8:50
mound16-Jun-04 8:50 

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.