How to use video inside GZDoom!

Handy guides on how to do things, written by users for users.

Moderators: GZDoom Developers, Raze Developers

Forum rules
Please don't start threads here asking for help. This forum is not for requesting guides, only for posting them. If you need help, the Editing forum is for you.
User avatar
giwake
Posts: 24
Joined: Sat Feb 09, 2019 6:44 am

How to use video inside GZDoom!

Post by giwake »

Have you ever played too much Island Peril and wanted some terrible FMV cutscenes in your mod? Well this is the guide for you!
This guide covers adding video to your game using the ANM format, which is mostly used in the Build Engine.

This is the end result: https://www.dropbox.com/sh/vyrt7338u6rs ... uSsDa?dl=0

This requires the following:
  • A video file of any kind.
    A tool capable of converting videos to image sequences. (I used Rad Video Tools. I recommend a video editor.)
    A tool capable of extracting audio from videos. (Audacity is capable of this.)
    A program that can batch convert images to paletted .pcx files. (I used Photoshop.)
    Anim2PCX (which can be found here: https://dukeworld.com/2001-current/rtcm ... s-editart/)
STEP 1: Converting your video

To begin, take the video and split it into an image sequence.
You should to name your files in this format:

Code: Select all

NAME0001
Anim2PCX won't work if it's not named like this for some reason. Feel free to replace NAME with any other 4 letter word though. I used DOGB. I forgot why.

Next, choose a palette to use for your video. When using ANM, you can only use 1 palette for a video, but the palette can be any palette. I used the DN3D palette.
Now, using a program that is capable of batch converting images to paletted .pcx files... do that.

Finally, using Anim2PCX, join the frames together with this command:

Code: Select all

anim2pcx j [NAME]
If all went well, you should have a .ANM file! If you want sound to go along with your video, continue on to step 2! Otherwise, move on to step 3.

STEP 2: Audio

This step is pretty simple, but may be more complicated depending on the video format you're using. For this tutorial, it will be an ideal situation with absolutely no problems whatsoever.
Simply drag and drop your video file into Audacity, which will automatically extract the audio. Then export the audio to any of these formats: OGG, FLAC, MP3, OPUS, or WAV.
Lastly, name the audio file similarly to the video file. So in my case, I would name it DOGB.OGG. But my video's audio wasn't interesting nor good, so I left it out.

That's the hard stuff out of the way! Now on to...

STEP 3: Adding the video to your mod

Place the video inside your .pk3 file. WADs are incapable of handling video due to MapInfo requiring path and extension information, so we're using a .pk3.
Create, or open, a MapInfo lump. Here's the cool part:
You can play a video in the following places inside your mod:
  • At the beginning or end of a map.
    At the beginning or end, or when the player dies in a cluster.
    Before the title screen.
    Before starting an episode.
For this example, I made it so that my video would play after a level. So, in my MapInfo, I added the following code:

Code: Select all

Outro {video = "DOGB.ANM" FPS = 3}
Video is the video file (and the directory it is in), and FPS is the framerate the video is played back at, although it's a bit confusing as higher values actually make it play back slower. Not sure myself :V

Finally, load up your mod and give it a test!
If all has gone well, your video should play at the point it is supposed to.

A quick note before this tutorial ends:
GZDoom is compatible with other video formats, like IVF, SMK and MVE, however I was unable to convert my videos to those formats successfully. It is likely that these other formats are a lot better, file-size-wise, than an ANM file.

Thanks for reading! I hope to see some mods with High Quality Full Motion Video Cutscenes in them!

Return to “Tutorials”