VOGONS


First post, by stahlhart06

User metadata
Rank Newbie
Rank
Newbie

First post here for me, reaching out at the moment feeling both frustrated and aggravated. Has anyone here reading this ever compiled an id Tech 3 .RoQ video?

Over the years I have been going through my game libraries looking for older titles that are broken in one way or another and fixing them, and for the most part this has been successful, with the exception of two games that continue to defy any effort at correction. One is the subject of another discussion that I'm still collecting my thoughts on, but the current effort has been toward the first Call of Duty.

Unlike its expansion United Offensive, which uses Bink video and works just fine, the first chapter uses id's .RoQ format for the introductory company logos and the game's intro and outro. I guess that they must have worked fine on XP back when the game was first published, but under Windows 7/10/11 the Activision and Infinity Ward logos are buggy and unpredictable. Once in a while they all play correctly. A little more often the two company logos play, but the game intro is skipped, and the game goes directly to the main menu. Most of the time only the Activision logo plays, then there is a brief burst of audio from the end of the Infinity Ward logo, before the main menu appears.

Once in a great while, if you hit a key during the Activision logo at just the right moment, you will skip over the Infinity Ward logo and the game intro will play.

I figured out that if I create an autoexec.cfg file and put in the following command:

cinematic cod_intro.roq

... and disable the launching of intros in config.cfg with:

seta com r_introplayed "1"

...and launch the game from a shortcut that runs the autoexec.cfg, the intro plays perfectly.

So I think, okay, I'll concatenate the two logo files and re-encode all three into a single .RoQ and then call that file from the autoexec.cfg instead. But no go. There doesn't seem to be an editing or compiling tool on the planet that can properly encode a .RoQ that Call of Duty will play. Invariably I end up with the audio and video out of sync, with the audio lagging by about a half second, and the video crashes a split second into the Infinity Ward logo after stuttering through the Activision one, crashing into the main menu. At least it doesn't crash the game.

I've tried every command I could search for using ffmpeg, I've tried Quake Video Maker, without any success. The compiled videos look correct with an ffprobe command, I have the streams in the correct order in the container, the codecs and bit rates are correct, but they still don't work. And in a hex editor they don't look even remotely similar in terms of structure.

There apparently was at time a tool called Switchblade 4 for this, which had executables for creating the codebook and compiling the video, but a search for this comes up empty, apart from references to it in a few old forum threads.

I found a RoQ compiler on ModDB, and I'll probably give that a shot next, though it will require me to break up about a minute and a half of video into individual .TGA frames. I guess that I can start small and see if it will recreate the logos correctly, where I could substitute those in for the originals to validate the process before I take on the game intro.

Reaching out here to see if anyone has successfully done this with ffmpeg and knows how to keep the audio and video properly in sync -- or is this just an operating system incompatibility that's unfixable? I'm starting to wonder if ffmpeg simply isn't capable of supporting the .RoQ format correctly. One thing I found along the way is that ffmpeg won't copy an untouched video stream from input to output using -c copy. It just drops the video completely, and you only get audio in the output. This ended up forcing me to run -map commands in the last encoding step to ensure audio was stream #0 and video #1 in the final file, as they need to be in that order for Call of Duty to play them. ffmpeg also places video in #0 by default, but there doesn't appear to be a standard order for .RoQ as there is no consistency in id Tech 3 games. Return to Castle Wolfenstein videos are #0 video and #1 audio.

I also wonder if this is the reason Gray Matter appended a binkplay library/thread into the game executable for it to play .biks instead of .roqs. United Offensive launches perfectly in Windows 11.

Does anyone here have any experience with this? Thanks in advance ...

Reply 1 of 8, by BEEN_Nath_58

User metadata
Rank l33t
Rank
l33t

Are we talking about the Call of Duty 1 game from Infinity Ward about World War 2? To my memory the videos had always worked fine in Windows 11 as well. I might not have tested them well but maybe I could jump in soon?

Do you have a specific testing methodology?

previously known as Discrete_BOB_058

Reply 2 of 8, by stahlhart06

User metadata
Rank Newbie
Rank
Newbie
BEEN_Nath_58 wrote on Yesterday, 21:05:

Are we talking about the Call of Duty 1 game from Infinity Ward about World War 2? To my memory the videos had always worked fine in Windows 11 as well. I might not have tested them well but maybe I could jump in soon?

Do you have a specific testing methodology?

Hi -- thank you for responding... yes, this is the first IW CoD from 2003. I'm testing both a physical media installation as well as the Steam package. I have the United Offensive add-on installed for both, along with whichever patches installing it added. For the physical media installation, there are no-cd executables substituted for single player and multiplayer (just so that I don't have to keep an external DVD drive connected), but the symptoms are still the same for both it and the Steam binaries. I'm just launching the game normally.

If it makes a difference, graphics are Nvidia (a 980Ti, a 3080Ti, and a 4090) with fairly recent but not the absolute latest drivers. for the 980Ti I think they're the last ones that supports Maxwell on Windows 11. I don't have any Radeon cards here to test with unfortunately.

What I'm seeing is that the Activision logo always plays, with a slight delay in the audio, then from there it's unpredictable. Sometimes the Infinity Ward log will play, usually it won't. Once in a very great, great while all three (the two logos and the intro) will play, but it's rare. Most of the time it's the Activision logo, followed by a brief burst of audio from the end of the Infinity Ward logo, and then straight to the main menu.

United Offensive always launches fine, because the video content is Bink and not id RoQ.

Reply 3 of 8, by stahlhart06

User metadata
Rank Newbie
Rank
Newbie

One more thing I forgot to add: VLC will play the RoQ videos, but the progress slider behaves erratically, sort of like it's buffering file content prior to the start of play, and the audio lags considerably more, about a full second.

If I use ffmpeg to convert the RoQs to MP4 or AVI, they play perfectly and in sync. But the game executable is only capable of playing RoQs. And encoding them back from either MP4 or AVI always throws the sync off. Googling provides detailed AI responses on how to set up ffmpeg for the encoding (it even provided one for the game specifically), but every option I've tried gives the same results.

Reply 4 of 8, by leileilol

User metadata
Rank l33t++
Rank
l33t++
stahlhart06 wrote on Yesterday, 20:59:

There apparently was at time a tool called Switchblade 4 for this, which had executables for creating the codebook and compiling the video, but a search for this comes up empty, apart from references to it in a few old forum threads.

Fortunately I still have this. This is better than ffmpeg at it, but you'll still have to do a raw avi first (DirectShow codecs are not supported)

UO ain't the first idt3 to drop RoQs - Elite Force used binks!!! RoQ's quantization of colors probably hurt the image quality of space too much.

apsosig.png
long live PCem
FUCK "AI". It is a tool of fascism. We do not need it. We do not use it.

Reply 5 of 8, by stahlhart06

User metadata
Rank Newbie
Rank
Newbie
leileilol wrote on Yesterday, 23:29:
stahlhart06 wrote on Yesterday, 20:59:

There apparently was at time a tool called Switchblade 4 for this, which had executables for creating the codebook and compiling the video, but a search for this comes up empty, apart from references to it in a few old forum threads.

Fortunately I still have this. This is better than ffmpeg at it, but you'll still have to do a raw avi first (DirectShow codecs are not supported)

UO ain't the first idt3 to drop RoQs - Elite Force used binks!!! RoQ's quantization of colors probably hurt the image quality of space too much.

Oh, my goodness -- thank you so much!!! I really wanted to be able to give this application a shot. It was the only one I saw in my travels that specifically mentioned the codebook aspect of RoQ files. I think that I still have the uncompressed and concatenated AVI from earlier attempts, but it should not be an issue to create another one either. I will give it a shot and will report back...

Added Elite Force to my GOG library tonight -- did not know about that one...

Reply 6 of 8, by stahlhart06

User metadata
Rank Newbie
Rank
Newbie

Something else came to mind while I am working on creating the AVI and WAV streams for encoding: Call of Duty is expecting its RoQ files to have streams in the container ordered #0 audio and #1 video (mentioned in the OP). I'm not sure which order Switchblade will put the streams in; I guess I get to find out soon.

I know that ffmpeg has a -map command, where I could do something like

ffmpeg -i input_file.wav -i input_file.avi -map 0:a -map 1:v <some extra commands> output file.roq

...but every time I've tried this I've only gotten the audio stream in the output, for some reason the video stream keeps getting dropped. Do there need to be two -c copy commands alongside the two -map commands, something like

ffmpeg -i input_file.roq -map 0:a -map 1:v -c:v copy -c:a copy output_file.roq

I'm wondering if this was the mistake I was making earlier. I obviously don't want ffmpeg to process either stream as it will more than likely screw up the result.

Only thinking about this ahead of time in case the Switchblade encoding/muxing steps put video in the container as the first stream instead of audio.

Reply 7 of 8, by stahlhart06

User metadata
Rank Newbie
Rank
Newbie

SO close.

The three steps of the RoQ creation process went without a hitch. The good news is that Switchblade placed the streams in correct order, and Call of Duty played it fine, with no stuttering.

The not-so-good news is that the audio is still out of sync, at the beginning lagging by about a second. I haven't yet studied it closely enough to note whether the lag is constant or gradually getting further back as the video plays. But the video does not complete, there is some blocky corruption a few seconds short of its ending and it drops to the game's main menu. But this is the best that it has worked yet, which is extremely encouraging.

For reference, here is what it's supposed to look like:

https://www.youtube.com/watch?v=KRjoPgsL8fo

The problem occurs roughly at 1:29... right when the Call of Duty banner fades in is where the video crashes.

So my thoughts are: (a) I encoded at the wrong bit rate, and can try adjusting to see if it makes a difference, or (b) I can use VirtualDub to add a second of black video to the start of the AVI (and a second of silence at the end of the WAV?), or (c) try and see if ffmpeg's -itsoffet will correct it, if the amount of lag is determined to be constant all the way to the end.

But I was just elated that it worked at all. Thanks again for the application...

Reply 8 of 8, by stahlhart06

User metadata
Rank Newbie
Rank
Newbie

I got it working. The problem was that the original .RoQ files for the game were encoded at a resolution of 512x512. Capturing the uncompressed AVI and re-encoding to RoQ at a resolution of 512x256 and forcing 30fps fixed everything. The audio tends to lag the video more when it is viewed in VLC, but when played in the game from the pk3 archive the sync is much better, probably to the point that no one would notice any deviation.

Since the resulting file size is on the low side, I'm going to see if I can bump up the bit rate to improve quality but still keep everything working correctly. I just took the Switchblade default of 3000K for this initial test.