Main Page   Modules   Data Structures   Data Fields   Related Pages  

Making a movie

This section will guide you to create your datafile movie based on an avi file. The avi format is better to use, because it don't get loaded all into the memory, but the user can alter easily.

First, I recommend you to download Virtual Dub (, RAD Video Tools (, encoders DivX 5.xx and XviD (

Now, you can choose 2 modes to make your datafile movie:

Using jpg's

  1. First, convert your .avi to a sequence of jpg's with RAD video tools. Select your file and click Convert a file. Select the Output type... to JPEG files and click Convert

  2. For the audio now, open your avi in Virtual Dub.

  3. In Audio, choose Full processing mode

  4. In Audio again, choose Compression...

  5. Select the codec, No compression (PCM) or mp3, if you have

  6. In File, select Save WAV... and choose the name of file.

  7. If you will use mp3, convert the wav to mp3, using some tool.

  8. In any ASC II text editor (Notepad will be ok), write a file like this, switching the data for match the settings of your movie:

    fps = 9.990
    desc = Card Captor Sakura - Dance of the Clow
    XDIM = 352
    YDIM = 240 

    In Virtual Dub you can see the fps and dimensions of the frame in File /File Information...

    XDIM is the width, YDIM is the height and fps is frames per second. The desc is optional and not used really, but it's a small description of the movie.

    Save this file to movie.cfg, for example.

  9. Now, use the dat utility to create the datafile.

    If your movie posses more than 256 frames, change the line:

    #define MAX_FILES 256 


    #define MAX_FILES 65535 

    or to other value you want in dat.c, and recompile the Allegro to use the new dat utility.

  10. Finally, create the datafile:

    dat -a Movie.dat.jpg -t JPG
    dat -a Movie.dat audio.wav
    dat -a movie.cfg -t INFO 

    Change audio.wav to the name of the audio file, and movie.cfg to the file name of your config file saved.

Using tool avi2dat (recommended)

  1. First, if you don't have an avi file encoded with DivX or XviD, you can use Virtual Dub to re-encode the movie with one of these encoders. To do this, open the avi, in Video, choose Compression... and one of the supported codecs (XviD or DivX), configure the properties of the codec (quality) and OK.

  2. In Audio, select Full Processing , then select Compression, choose No compression or MP3 compression.

  3. Save the avi, File Save as AVI, select another name and Save.

  4. Now, open avi2dat.exe in MJpgAlleg tools directory, open the avi file, click in Save to datafile, select a name and save.

    Usually the avi2dat produces a bigger file than the grabber, so open the generated datafile with grabber, save and quit.

  5. Test with MJpgDemo and see if it's good enough.

Makefile targets | MJpgAlleg - Main Page

Generated on Mon Apr 7 00:19:25 2003 for MJpgAlleg by doxygen1.2.18