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

.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 15 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 Sun Apr 28, 2024 9:29 am, edited 5 times in total.
User avatar
Nash
 
 
Posts: 17468
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: 26
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!
User avatar
Enjay
 
 
Posts: 26697
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

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

Post by Enjay »

I've just been trying this and the problem is that the video loses a lot of visual quality when going from MP4 to IVF.

Are there any ffmpeg parameters that are able to improve on this? I've tried the BAT file, and the command line on the Wiki page but both produce a significant drop in quality.

The video I'm working with isn't particularly big. It's 1280x720, 33 seconds long and 3.78MB as an MP4. The IVF is 920KB and the ogg is 482KB, so the total size of the files is smaller but the drop in quality is such that I don't want to use them. :(
User avatar
Jakie
Posts: 26
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: .BAT files for converting videos to .IVF for cutscenes (and a crappy old guide)

Post by Jakie »

Enjay wrote: Thu Jan 16, 2025 10:48 am I've just been trying this and the problem is that the video loses a lot of visual quality when going from MP4 to IVF.

Are there any ffmpeg parameters that are able to improve on this? I've tried the BAT file, and the command line on the Wiki page but both produce a significant drop in quality.

The video I'm working with isn't particularly big. It's 1280x720, 33 seconds long and 3.78MB as an MP4. The IVF is 920KB and the ogg is 482KB, so the total size of the files is smaller but the drop in quality is such that I don't want to use them. :(
Currently away from my computer but I found this on the EDuke32 wiki and I think it might work better than mine because I don't think I assign any parameters if you use the .BAT.
ffmpeg -i <input> -an -vcodec libvpx -crf 8 -b:v 2M <output>.ivf

Also I found that you can try to use -qscale 0 but I don't think that works on .IVFs. If not, then oof.
User avatar
Enjay
 
 
Posts: 26697
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

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

Post by Enjay »

Thanks, that does give a much better quality version.

The file produced is noticeably bigger than the MP4 it converted from (5.87MB from a 3.78MP4 - without the sound!) However, the size is not much of an issue in this case. (The video works fine in game too. :) )

FWiW
I tried -qscale 0 and got:

Please use -q:a or -q:v, -qscale is ambiguous

I tried them both but there was no noticeable difference.

Return to “Tutorials”