Register an account now to get access to all board features. After you've registered and logged in, you'll be able to create topics, post replies, send and receive private messages, disable the viewing of ads and more!

Well this has been possible for quite some time now but not documented very well and can be a pain in the ass for some users to get their head around, so I thought I would be a nice guy again and make another "help me" thread on how to do it.

Step 1:
Go to this link: http://video.online-...convert-to-webm (Good idea to book mark this page)
Use the Youtube video link in the "Or enter URL of the file you want to convert to WEBM:"
Leave all the other options for now and click "Convert File"
Save the file to your desktop when prompted.Important part: You should have a file called "Nuke_Symbol_Explosion_Intro_from_Duke_Nukem_3D_XBL.webm" saved on your desktop, rename the extension of it (the webm part) to "mkv"

Step 2:
Download MKVToolNix windows installer.
When prompted, also download the "MKVExtractGUI-2" option when the "MKVToolNix" has finished installing, this will make your life a lot more easier.http://sourceforge.n....8.zip/download (In case you didn't download it from the installer)

Step 3:
Place the "MKVExtractGUI2.exe" from the "MKVExtractGUI-VERSIONNUMBER.zip" into the install directory of "MKVToolNix"
Default location is C:/Program Files/MKVToolNix/
Right click "MKVExtractGUI2.exe" and create a shortcut to it on your desktop for easy accessibility in future.

Step 4:
Run "MKVExtractGUI2.exe" from either the install folder or shortcut (if you made one)
Select "Nuke_Symbol_Explosion_Intro_from_Duke_Nukem_3D_XBL.mkv" as the input file on the desktop (or where ever you may have saved this file to from Step 1)
Set your output directory to the desktop or somewhere else handy.Important part: Click the check box for "Track 1" (this is the video stream of the video)
Click "Extract"
You can now close MKVExtractGUI2.exe

Step 5:
You should now have a file on your desktop called "Nuke_Symbol_Explosion_Intro_from_Duke_Nukem_3D_XBL_track1_und"
Rename this file to "LOGO.IVF"
Place this file into the directory of your Duke Nukem folder. (where eduke32.exe is located)

Now if you load up eduke32 you will now be presented with a new Nuke logo animation but there is no sound! (The logo animation may also play a bit horribly, this will be explained later)
We will work on the sound next.

Step 6:
Assuming that you have the HRP installed, open up the HRP zip/folder (depending on how you have it installed)
Open the "duke3d.def" file with any text editor and under the line
"include duke3d_hrp.def" place this line, "animsounds logo { 1 244 64 14 }"

So it should look like this:

include duke3d_hrp.def
animsounds logo { 1 244 64 14 }

If you do not have the HRP installed just make a new text file with "animsounds logo { 1 244 64 14 }" on the first line and save it as "duke3d.def" and save it in the same location as "eduke32.exe"

This will give you the FLY_BY and PIPEBOMB_EXPLODE sound as the original LOGO.ANM video has, it is quite possible to use the sound from the Youtube video but this requires to extract the sound from the video, convert the sound to a OGG, DEFfine it etc.

Things to note:

Videos can only replace the hard coded ANM (sorry we cant add new videos at this time it seems)

The syntax is as follows:
animsounds <anim> { frame1 sound1 frame2 sound2 ... }
<anim> has to be one of the tokens: cineov2, cineov3, RADLOGO, DUKETEAM,
logo, vol41a, vol42a, vol4e1, vol43a, vol4e2, or vol4e3, corresponding
to hard-coded Duke3D anims.
The frameN's (1-based frame numbers) have to be in ascending order (but not
necessarily strictly ascending, so that a frame may have more than one sound).
Example: for Duke3D's XBLA nuke logo animation (IVF extracted from nuke.webm),
the following definition overlays the video with a sound sequence similar
(identical save for timing) to the original nuke animation:
// frame 1: FLY_BY, frame 64: PIPEBOMB_EXPLODE
animsounds logo { 1 244 64 14 }

So what this says is that at frame 1 we will play sound number 244 which is defined as "FLY_BY" in DEFS.CON then at frame 64 we will play sound 14 which is defined as "PIPEBOMB_EXPLODE"

With this information you should be able to extract the audio from a video which you want to use, encode that as a .ogg define it in your DEFS and use the line.
animsounds logo { 1 MY_NEW_SOUND_NUMBER }

Step 2:
You will need WinRAR, 7-Zip or other program that can extract from 7z archives.
Extract the contents of ffmpeg to your Desktop or elsewhere.

Step 3:
Right click "ffmpeg.exe" which is inside the "bin" folder and create a shortcut to it. (Leave the shortcut in the same folder as ffmpeg.exe)

Step 4:
Place the video you wish to convert into the bin folder, same folder as your new shortcut and ffmpeg.exe should be located.

Step 5:
Right click your new shortcut and click properties.

Step 6:
In the target line you should see something along the lines like:
"E:\Users\The Commander\Desktop\ffmpeg-20120509-git-a548671-win32-static\bin\
ffmpeg.exe"

After the last semicolon we need to insert these commands.

-i <input> -an -vcodec libvpx -quality best <output>.ivf

<input> refers to the EXACT file name of the movie you placed in the same folder, e.g. MYMOVE.AVI
<output> refers to the name of the converted movie, e.g. LOGO (You do not need to specify an extension here)

I've only skimmed over it, but it seems like a lot of work for something as small as a short intro movie that plays maybe once every time you fire up eduke.

You can replace any ANM video with ANY video, this is something that would be quite useful for TC/MOD developers as one of the hardest things to replace was the ANM videos.
With this method, projects like AMC TC, WGR2 could have real intro videos etc.
I can trust you that this method is no where near as hard or complicated compared to replacing the original .ANM back in the day.
Example, back then you had to your was made up of a bunch of.PCX files, they all had to be in the correct palette of the video you were replacing, limited to 256 colours, and you had next to none controls over sound and play speeds etc.

Micky C, on 09 May 2012 - 03:47 AM, said:

Will videos ever be easier to work with?

I do not know how this could be any easier, all I have done here is shown the user how to convert a video to a format/handle that is not widely used by most common media players and how to define it in eduke.
How much simpler could you want it, DivX encoded AVI's or BINK videos? Sure if you have thousands of dollars to pay for licensing fees sure it's possible.

EDIT: As far as I know there is also no time limit, so in theory you could have a 5 minute intro video. (Or a movie)

So if your episode using any of them videos, then yes you can replace them.
I am afraid I do not know the names of which videos play when at this time, maybe Hendricks or someone else could help with this.

Edit: It is quite possible to set your episode up like episode 4 so that the original videos play (duke getting his mission and putting his glasses on) and replace them from there.

This is a very good tutorial in terms of the file setup, but the actual conversion process is as simple as FFmpeg and this command line:

ffmpeg -i <input> -an -vcodec libvpx -quality best <output>.ivf

You'll get much better results than with a web-converter, and it will work with just about every input video format that exists. Note that the "-an" specifically disables audio from being added to the output file.

Nice! Can someone remind me how I can add my own sounds again (with a unique number, not overriding other sounds)? Is that done by altering the CONs? I assume you can't just add your own number in a sounds.def file without first defining that number in DEFS.CON? Because that doesn't seem to be working for me. Keeps saying "invalid sound" in the log.

How can I set custom framerate and resolution when using ffmpeg? Documentation says about -r and -s parameters, but "-r 15" or "-s 1280x720" doesn't work.

Is this a question about ffmpeg usage or presumed incorrect displaying of ffmpeg-encoded videos in EDuke32? The frame rate in particular is calculated like in a VP8 code example: there's some strange fallback case to 30 fps, where I'm unsure what it's supposed to do.

Commando Nukem, on 08 July 2012 - 02:57 PM, said:

QUESTION: Would it be possible to implement functionality to allow IFV's to be used as a form of animated texture?

Theoretically yes, since what we do now is re-upload each frame of the video to one reserved GL texture. However, the interface with the game world would have to be worked out, and on the implementation side there's probably adding another fragment shader bit to Polymer.

s.b.Newsom, on 10 July 2012 - 10:48 AM, said:

Any idea of when we might see an updating on making new Animations instead of replacing hardcoded ones? Also, can these be triggered at will through the con?

Well, features are hacked into EDuke32 on a when-it's-needed basis (at least sometimes). Would you need animations in between a running game, or only on arbitrary map change boundaries?

QUESTION: Would it be possible to implement functionality to allow IFV's to be used as a form of animated texture?

Helixhorned, on 10 July 2012 - 11:28 AM, said:

Theoretically yes, since what we do now is re-upload each frame of the video to one reserved GL texture. However, the interface with the game world would have to be worked out, and on the implementation side there's probably adding another fragment shader bit to Polymer.

Animated PNG? I could imagine this might be easier to implement though less powerful.

Where did Cody make his own? The one in the YouTube video at the top is the one from the XBLA port; he linked to my high-quality FFmpeg conversion of it in his post. You may use it unrestricted by me because 3D Realms made it. However, 1) ideally it would be in the mainline HRP, since we already replaced Parkar's logo renders with the XBLA menu images, and 2) it would be best if we made our own, both for copyright and because the new nuke logo has at least one noticeable problem: the explosion looks fake, instead of it dissipating like the original, it's simply a texture that rotates and shrinks in size, and it looks bad.

LeoD, on 10 July 2012 - 02:23 PM, said:

Animated PNG? I could imagine this might be easier to implement though less powerful.

If we are also going forward with a frame-by-frame option it would be best to go with ProAsm's idea, simply a sequence of images in a zip file. However, since VP8 format is already in, adding a different format is not a shortcut to success.

Well, features are hacked into EDuke32 on a when-it's-needed basis (at least sometimes). Would you need animations in between a running game, or only on arbitrary map change boundaries?

In map, individual instances. I want to be able to trigger as many individual clips/animations in specific instances in any part of a given map, trigger either by a trigger or interaction (all controlled through con).

Where did Cody make his own? The one in the YouTube video at the top is the one from the XBLA port; he linked to my high-quality FFmpeg conversion of it in his post. You may use it unrestricted by me because 3D Realms made it. However, 1) ideally it would be in the mainline HRP, since we already replaced Parkar's logo renders with the XBLA menu images, and 2) it would be best if we made our own, both for copyright and because the new nuke logo has at least one noticeable problem: the explosion looks fake, instead of it dissipating like the original, it's simply a texture that rotates and shrinks in size, and it looks bad.

I admit I just FlashGot the vid from Post#1 and was too lazy to read the rest of the thread too thoroughly...
Your FFmpeg command line proposal yields pretty bad/lowres results because FFmpeg has an interesting interpretation of -quality best.
Other than CON, DEF or MHK files, the IVF clip can not be put into an autoloaded zip file or a -jDIR. This should be changed before starting to replace the animations.

@Cody: about those "slow" vids, could you see if the newest revision makes them any better? I was quite astonished when my 3-year old PC performed much better than my brother's one which he recently upgraded (I think it's the memory modules). The current revision will also print out some statistics after playing a video, so we can compare them for a given one, for example, Hendricks' old rip of the Nuke logo animation from XBLA. I'm especially interested in cases where the decoding can't keep up with the actual frame rate.

Just a quick note on converting a video to WebM:
If you don't want to use an online converter or you have a video on your hard drive already which you want to convert, you also can use the Free WebM Video Converter by DVDvideosoft. It comes along with Freestudio (I'm currently using version 5.6.1).
Just have a look at www.dvdvideosoft.com

Animated PNG? I could imagine this might be easier to implement though less powerful.

To a point that would be awesome... BUT, I was thinking more along the lines of created full motion clips to replace the three framers in the original game. I don't think an animated PNG could do the interloping needed for that.