.BAT files for converting videos to .IVF for cutscenes (and a crappy old guide)

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.
Post Reply
User avatar
Jakie
Posts: 25
Joined: Thu Oct 15, 2020 8:17 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: ATI/AMD (Modern GZDoom)
Contact:

.BAT files for converting videos to .IVF for cutscenes (and a crappy old guide)

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 (or any format) to them with FFMPEG, so that's exactly what we're doing!

Step Negative One: Don't follow this guide and just use the .bat files.

So yeah, this guide is...rough. Terrible grammar, poor wording for the steps, etc. Don't use this guide. Instead, use these .bat files I made a while back and sleep easy tonight, knowing you can tell your epic story with less headaches!

Download the .bat files here!



Note, you will still need FFMPEG in the same folder as the bats. Get it here.

The .bat file will hold your hand for most of it. Simply just type in the name of the original video, then type the output name, and boom! A .ivf cutscene ready for Slade! It supports any video format FFMPEG supports (Yes, even Bink videos). It will even remove the audio from your video to cut down its size.

There's also the convert_ogg.bat file, which will grab the audio from your video and save it as a .OGG file.

These will do exactly the same thing the OG guide teaches you but it will do it for you. So, if you don't want to play with .bat files or follow a at the time 14 Y/O's guide on cutscenes in GZDoom, just use the .bat files.

Still, if you want your life to be around 10% less fun for a few minutes, continue reading!


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 tor replace <input> and <output> to whatever you have/want.

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're almost there! Now, all there's left to do is to make it work in-game. Don't worry! This coding part is simple!

You don't have to use Slade as you can do this in a simple text editor and Explorer, but since you're on the ZDoom forums, I'll assume you have it loaded up right now.

Make a folder in your mod files and call it "movies" or something cool. This will be where you put your video, duh.

Next, you will need to define the sound you grabbed earlier in a SNDINFO lump, 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:
This example will make a cutscene play at the beginning of Episode One.

Code: Select all


episode MAP01 // Beginning of our episode block
{
name = "Stuff"
key = "S"

	Intro // Beginning of our cutscene block
	{
	Video = "movies/sorry.ivf" // The video, put EXACTLY where it is in your mod files. 
	Sound = "sorry" // The sound name from our SNDINFO
	} // End of our cutscene block
	
} // End of our episode block

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 Apr 16, 2024 4:08 pm, edited 3 times in total.
User avatar
Nash
 
 
Posts: 17439
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

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: 25
Joined: Thu Oct 15, 2020 8:17 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: ATI/AMD (Modern GZDoom)
Contact:

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!
Post Reply

Return to “Tutorials”