How to make .IVF cutscenes in 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
Jakie
Posts: 22
Joined: Thu Oct 15, 2020 8:17 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: ATI/AMD (Modern GZDoom)

How to make .IVF cutscenes in GZDoom

Post by Jakie »

Hey there! Have you ever wanted to have a fancy telling of your epic story for your epic game? Have you wanted to show what happened to your main dude after the final boss? Well, you're in luck!

GZDoom V4.8.0 added the cutscene code from Raze (I think). So you can have a epic cutscene in your mod or game!

This thread goes over how to make cutscenes in GZDoom with a .IVF file. However, that is not the only video format GZDoom supports. You can find all of the supported formats here.

.IVF videos are handy since you can easily convert a MP4 to them with FFMPEG, so that's exactly what we're doing!

Step ZERO: Get FFMPEG and a video ready.

FFMPEG is a program that allows you to convert a video or audio to pretty much any format you wish. So we'll be using it today. You can get it here.

For the video, it can be anything in any format (MP4, MOV, etc).

Step one: Use FFMPEG to convert your video to a .IVF file.

By itself, FFMPEG does not have a GUI, so you'll be using a .bat file with commands.
Here's the command for converting a video to a .IVF file, copy and paste this to a .bat file in your FFMPEG folder. Then drop your video in the same folder and run the bat. Be sure to edit this command to suit your needs.

Code: Select all

ffmpeg -i <input> -an -vcodec libvpx -crf 8 -b:v 2M <output>.ivf
Step two: Grab the audio from your video.
GZDoom cannot play audio from a .IVF video, so you need to have a separate audio file along with the video. If you already made your video, you can do two things.

Again with FFMPEG, you can extract the audio from your video with this command:

Code: Select all


ffmpeg -i <input> -vn -codec:a libvorbis -b:a 128k <output.ogg>

(This command will generate your audio in a .OGG file, however that is not the only format you can extract with, see this website, also thanks Exl for telling me about this!)

Or you can simply Google "mp4 to wav" or something to quickly grab the audio from your video.

The sound format must be supported by GZDoom, you can find all of the supported sound formats here.

Step three: Do some coding!
You are almost there! Now, all there's left to do is to make it work in-game.

Boot up Slade and make a folder where you'll put your videos in (call it something like "movies"), then put your videos in there.

Next, you will need to define the sound you grabbed earlier in a SNDINFO, just like any other sound. (Although I heard that if you name the sound the same name as the video, it will work just fine. Haven't tested it though.)

Then, in a MAPINFO lump, find what thing you want the cutscene to play in.
Cutscenes can play in either:
For this example, this cutscene will play at the start of episode one.

Code: Select all

episode MAP01
{
name = "Stuff"
key = "S"
	Intro
	{
	Video = "movies/sorry.ivf" // The video, put where it is in the PK3!!!
	Sound = "sorry" // The sound name from our SNDINFO
	}
}
(Note, cutscenes are in their own block. Be sure to place down two brackets, one to end the cutscene block and one to end the definition.)

Here's a little example PK3 I made with a pretty cursed video I found. Feel free to edit it as you wish.
Download

And you're done! Have fun with your FMVs! :mrgreen:
Last edited by Jakie on Tue Sep 13, 2022 1:42 pm, edited 1 time in total.
User avatar
Nash
 
 
Posts: 17394
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: How to make .IVF cutscenes in GZDoom

Post by Nash »

Thanks for the guide. Very helpful.
User avatar
Exl
Posts: 22
Joined: Wed Jul 01, 2009 5:22 am

Re: How to make .IVF cutscenes in GZDoom

Post by Exl »

For extracting the audio as a separate file FFMPEG can also be used:

Code: Select all

ffmpeg  -i <input> -vn -codec:a libvorbis -b:a 128k <output.ogg>
That would output 128kbit/s OGG Vorbis audio. Use "libopus" instead of "libvorbis" for Opus audio, or "pcm_s16le" for regular uncompressed PCM audio.
User avatar
Jakie
Posts: 22
Joined: Thu Oct 15, 2020 8:17 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: How to make .IVF cutscenes in GZDoom

Post by Jakie »

Exl wrote: Fri Sep 09, 2022 10:05 am For extracting the audio as a separate file FFMPEG can also be used:

Code: Select all

ffmpeg  -i <input> -vn -codec:a libvorbis -b:a 128k <output.ogg>
That would output 128kbit/s OGG Vorbis audio. Use "libopus" instead of "libvorbis" for Opus audio, or "pcm_s16le" for regular uncompressed PCM audio.
Ahh, didn't know that. Thanks for the tip!

Return to “Tutorials”