HT Games
Home  >> Video Games

Playing AVI Video in Game Maker 7 Pro: Workarounds for a 2007 Engine

Game Maker 7 Pro (released 2007) has no native AVI playback. Its video support ended at animated GIFs and (via extension) FLV/SWF. Modern codecs (H.264, HEVC, VP9) are unsupported. Here are practical workarounds.

1. Convert to Supported Formats

  • Animated GIF: Simple, no audio, limited to 256 colors, large file size. Use for short UI loops.
  • Image Sequences (PNG/JPG/BMP): Export AVI → numbered frames (FFmpeg: ffmpeg -i input.avi frame_%04d.png). Load via sprite_add() or background_add() at runtime, or pre-import as sprite strips.
  • FLV/SWF (Legacy): If you have Flash integration extension, convert to FLV (H.263/VP6). Obsolete but works in GM7.

2. External DLL (Advanced / Windows Only)

Use a C++ DLL wrapping DirectShow / Media Foundation to render video to a texture. Requires:

  • GM7 extension development knowledge (GEX).
  • Distributing VC++ runtimes.
  • Handling sync, seeking, cleanup manually.

Not recommended for new projects—maintenance burden is high.

3. Upgrade (Strongly Recommended)

GameMaker Studio 2 / GameMaker 2023+ includes video_play(), video_sprite, supporting MP4, WebM, OGG, MOV with hardware acceleration. Import project → refactor → done.

Minimal Image Sequence Example (GML)

// Create Event
global.frame = 1;
global.maxFrames = 120; // adjust
global.baseName = "frame_";
global.spr = -1;

// Step Event
if (global.frame <= global.maxFrames) {
    var fname = global.baseName + string_format(global.frame, 4, '0') + ".png";
    if (file_exists(fname)) {
        if (global.spr == -1) {
            global.spr = sprite_add(fname, 0, false, false, 0, 0);
        } else {
            sprite_replace(global.spr, fname, 0, false, false, 0, 0);
        }
        global.frame++;
    }
}
// Draw Event
if (global.spr != -1) {
    draw_sprite(global.spr, 0, x, y);
}

Assumes frames named frame_0001.png... Convert AVI first. Adjust naming/logic for your pipeline.


https://www.htfbw.com © HT Games