Fallout 2 utility avi2mve

QuantumApprentice

Look, Ma! Two Heads!
I've spent the last few weekends trying to get avi2mve from dobrovnik's archive (here) to work with an encode of my own arbitrary video.
Unfortunately I can't seem to easily find any direct information on the types of encoding that avi2mve will accept, but using it to convert one of the original .mve files to .avi gave me something to work with.
Unfortunately, no matter how close I make the settings for my new video match the settings for the original converted video, I can't get avi2mve to work with it (it does convert the original back).

For reference, here's the information I'm getting from ffmpeg (ffprobe) about the original converted video (derrick.mve):
Code:
Input #0, avi, from 'derrick.avi':
  Duration: 00:01:04.93, start: 0.000000, bitrate: 49818 kb/s
    Stream #0:0: Video: rawvideo, rgb555le, 640x320, 49157 kb/s, 14.99 fps, 14.99 tbr, 14.99 tbn, 14.99 tbc
    Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, 2 channels, s16, 705 kb/s

and here's the same for my new video that I'm trying to convert to mve.
Code:
Input #0, avi, from 'test.avi':
  Duration: 00:00:04.14, start: 0.000000, bitrate: 49846 kb/s
    Stream #0:0: Video: rawvideo, rgb555le, 640x320, 49924 kb/s, 14.99 fps, 14.99 tbr, 14.99 tbn, 14.99 tbc
    Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, 2 channels, s16, 705 kb/s

Here are the results when I use avi2mve to convert derrick.avi back to .mve
Code:
AVI2MVE beta (2004/09/19), (c) ABel[TeamX]
Input video stream info:
    first frame: 0   973 frames  (64.93 seconds)
    width: 640   height: 320
    framerate: 14.99 fps    picture format: DIB     bits per pixel: 16
Input audio stream info:
    first sample: 0   1431606 samples  (64.93 seconds)
    sample rate: 22050.00    suggested buf size: 5888    skew: 0
    format details: PCM, 22050 Hz, 16-bit, stereo
Audio decoding scheme:
    PCM, 22050 Hz, 16-bit, stereo -> MVE

Processing frames from 0 to 972
Pass 1. Color reduction.
50 100 150 200 250 300 350 400 450 500 550 600 650 700 750 800 850 900 950
Done. Palette saved to `derrick.pal'

Pass 2. Making MVE.
  bitrate limit: 307200 bytes per second
25 50 75 100 125 150 175 200 225 250 275 300 325 350 375 400 425 450 475 500 525 550 575 600 625 650 675 700 725 750 775 800 825 850 875 900 925 950
Done.

MVE file size: 18872408 bytes.
Avg. frame len: 14786.24 bytes (7.22% of original)
 290019 bytes/sec.
Compressor buffer size: 3264000
     peak buffer usage: 1010080
Pass 2 time: 57 seconds
Relative error: 5.76%

and here are the results when I try my video
Code:
AVI2MVE beta (2004/09/19), (c) ABel[TeamX]
Input video stream info:
    first frame: 0   62 frames  (4.14 seconds)
    width: 640   height: 320
    framerate: 14.99 fps    picture format: DIB     bits per pixel: 16
Error: Cannot open converter for this format. Try to re-compress your movie.

As you can see, all the settings match that I'm aware of, but for some reason avi2mve won't work with my video, and appears to halt after just reading the video section (which makes me think I'm still missing something there).

Can anybody help me with the settings here?
@hexer I noticed you managed to get your videos encoded, please if you have time would you help me with mine?
 
is your avi codecless and uncompressed avi video?
i gnenerally have such output:
AVI2MVE beta (2004/09/19), (c) ABel[TeamX]
Input video stream info:
first frame: 0 190 frames (12.68 seconds)
width: 640 height: 480
framerate: 14.99 fps picture format: DIB bits per pixel: 16
Soundtrack from `mplogo.avi'
Input audio stream info:
first sample: 0 279550 samples (12.68 seconds)
sample rate: 22050.00 suggested buf size: 5888 skew: 0
format details: PCM, 22050 Hz, 16-bit, stereo
Audio decoding scheme:
PCM, 22050 Hz, 16-bit, stereo -> MVE

Processing frames from 0 to 189
Pass 1. Color reduction.
50 100 150
Done. Palette saved to `mplogo.pal'

Pass 2. Making MVE.
Floyd-Steinberg dithering
50 100 150
Done.

MVE file size: 7823790 bytes.
Avg. frame len: 34445.74 bytes (11.21% of original)
617099 bytes/sec.
103 frames did not fit in limit of 44000 bytes and were split
Pass 2 time: 4 seconds

Yeah and that's it. BTW get some better video information software, as framerate ain't 14.99fps. This value is rouded-up from something else. I don't recall what exactly at the moment. anyway the shortest route to have a conversion ready video is to use:
VirtualDub2.
Duuhhh.jpg

VirtualDub2_import.jpg

VirtualDub2_color_scheme.jpg

VirtualDub2_framerate.jpg

VirtualDub2_video compression(none).jpg


as for audio if you're reconverting original fallout videos use durect stream copy they use custom 16 bit PCM i don't even know if any program has theese.

true color scheme is hard to be founs as I've said i use 5bit 5:5:5 but original fallout video are 18 bit 6:6:6 and unfortuneatly theese are nowhere to be found.

On some vidoes however color conversion produses quite ugly output.
 
Last edited:
Time for an in-depth technical breakdown of this conversation:
is your avi codecless and uncompressed avi video?
"codecless" doesn't mean anything. Even raw video uses a codec. I used ffmpeg's built-in "rawvideo" codec, which ffprobe identified as the same codec used by avi2mve when converting from mve to avi. VLC identifies it as "araw" instead of "rawvideo", but it also identifies my ffmpeg encoding as "araw" so I'm pretty sure it matches to some extent.
It's possible the specifications ffmpeg uses are not the same as what avi2mve uses, but the name is the same according to ffprobe, which can be seen in the stream information I included in the original post, as well as VLC's confirmation that it's probably the same codec.
I'll test out vlc's "araw" codec and see if it works better.

"uncompressed avi" does have some meaning, but without identifying the specific codec, pixel format, and file format used this doesn't help much. (I'm not sure why but file format doesn't refer to AVI. The .avi extension is referred to as a "container" by people on the forums.)

get some better video information software, as framerate ain't 14.99fps
You are correct here, just checked information from both VLC and Media Player Classic and both give me more precise numbers of 14.986212 fps(VLC) and 14.986 fps(MPC), both of which appear to be some "drop-frame" variant of a 15fps video...possibly 29.97 drop-frame with half the frames removed.
This is probably where my biggest mistake is, but I'm not yet sure exactly how to solve it correctly.
I'll do some testing tomorrow and post the results after.

as for audio if you're reconverting original fallout videos use durect stream copy they use custom 16 bit PCM i don't even know if any program has theese.
16bit PCM is still a standard in use, specifically in WAV files, is included in ffmpeg, and is supported by pretty much anything that can play a WAV file.
To see for yourself, try exporting a file in WAV format and look at the options available to you. I'm partial to Audacity, but any competent audio editing program should have this information available for you and allow you to change it to something else.

I'm trying to make a generic method of converting any video to something compatible with avi2mve until something better comes along, which means it has to be able to convert other audio formats to the correct input format for avi2mve. Stream copy is probably not going to work in cases where the video uses mp3 or aac audio codecs.
Either way, avi2mve error-ed out after looking at the video information, so I suspect that's where my issue is.

true color scheme is hard to be founs as I've said i use 5bit 5:5:5 but original fallout video are 18 bit 6:6:6 and unfortuneatly theese are nowhere to be found.
While this might be true, where do you get this information from?
I ran ffprobe on my derrick.mve video file strait from the master.dat and got this:
Code:
Input #0, ipmovie, from 'derrick.mve':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: interplayvideo, pal8, 640x320, 14.99 fps, 14.99 tbr, 1000k tbn, 1000k tbc
    Stream #0:1: Audio: interplay_dpcm, 22050 Hz, stereo, s16, 352 kb/s
I opened it up in VLC and all I could find for information was this:
upload_2021-5-28_23-5-27.png

and MPC gave me this:
Code:
Video: INPV 640x320 14.986fps [V: interplayvideo, pal8, 640x320]
Audio: 0x4e49 22050Hz stereo 352kbps [A: interplay_dpcm, 22050 Hz, stereo, 352 kb/s]
none of which matches 18 bit 6:6:6, and instead looks like it's just pal8.

Anyway, I'll keep working on this and try out VirtualDub2 to see what it spits out.
I'll also try out the 5bit 5:5:5 you're using (is XRGB1555 pixel format from the image the same)?
I was originally using rgb555le because that's what you mentioned in the previous conversation, and it also gave the correct DIB file format that avi2mve was looking for, but if it won't work then it won't work.
 
Last edited:
18bit 6:6:6 is the standard for .MVE videos. the color pallete might be different but it still *is* VGA video (remember that Fallout 1 was originallly a MS-DOS game and under DOS only VGA-video was the option back in the day so 18bit RGB a.k.a 6bits for red 6bits for green and 6 bits for blue hence the 6:6:6 compared to 24bit video 8:8:8 as in 8bit per each RGB channel. 18bit 6:6:6 clor scheme is ancient as fuck, and is the basis of digital video as a whole). I doubt it is present in any modern video converter anyways. However the 5 bit video color scheme i provided screenshots of is *somehow* accepted by avi2mve. although as I've said sometimes it produces very ugly video output. for example Fallout 1 overseer speech (especially the vault exit scene).
I highly doubt it is the color scheme that russian modders use, but it seemes compatible, well at least partially.
Ok I'm going to shut up now, as on the ocassion of saturday eve I got drunk xp. so sorry for any ocassional typos.
 
18bit 6:6:6 is the standard for .MVE videos. the color pallete might be different but it still *is* VGA video (remember that Fallout 1 was originallly a MS-DOS game and under DOS only VGA-video was the option back in the day so 18bit RGB a.k.a 6bits for red 6bits for green and 6 bits for blue hence the 6:6:6 compared to 24bit video 8:8:8 as in 8bit per each RGB channel. 18bit 6:6:6 clor scheme is ancient as fuck, and is the basis of digital video as a whole). I doubt it is present in any modern video converter anyways. However the 5 bit video color scheme i provided screenshots of is *somehow* accepted by avi2mve. although as I've said sometimes it produces very ugly video output. for example Fallout 1 overseer speech (especially the vault exit scene).
I highly doubt it is the color scheme that russian modders use, but it seemes compatible, well at least partially.
Ok I'm going to shut up now, as on the ocassion of saturday eve I got drunk xp. so sorry for any ocassional typos.

You may be right, .mve may use the full 18 bits to store it's color information, it just doesn't match the results I'm getting...doesn't immediately matter though, I'll get back to you on this whenever I actually figure out how to directly convert to .mve :P

but for now...I just got VirtualDub2 to produce a compatible video from my new test video, took me a while to figure out how to scale and crop (though the scaling option appears to kind of suck).
FFmpeg is giving me some weird trouble with exporting at resolution, seeing weird numbers in VLC, but once I figure that out I'll try and see how many different pixel formats are actually compatible.

Couldn't get audio working though.
Were you able to get audio out? Thanks for the help!
 
You may be right, .mve may use the full 18 bits to store it's color information, it just doesn't match the results I'm getting...doesn't immediately matter though, I'll get back to you on this whenever I actually figure out how to directly convert to .mve :P

but for now...I just got VirtualDub2 to produce a compatible video from my new test video, took me a while to figure out how to scale and crop (though the scaling option appears to kind of suck).
FFmpeg is giving me some weird trouble with exporting at resolution, seeing weird numbers in VLC, but once I figure that out I'll try and see how many different pixel formats are actually compatible.

Couldn't get audio working though.
Were you able to get audio out? Thanks for the help!

As for the audio.. it's not a standard Microsoft 16bit PCM. It's a interplay-custom-format too (meaning there are differences between microsoft's 16bit PCM and interplay's 16bit PCM). I don't know whether VirtualDub2 can process to convert to the correct audio format. I only fiddled with original videos by processing them through AI video enhancer and putting them back to .MVE. (most fallout1 videos are 320x240) so there's room for improovement, or so i thought. turns out low res was on puropse, because higher rez has narrower color pallete. Anyways i took the soundtrack from original files after converting them from .mve to .avi. avi2mve has the option to take sound from other source, plus VirtalDub2 can be set not to process the soundtrack. Alternatively you canadd the soundtrack before putting it into VirtualDub2 and simply order the program to keep original sound without processing it.
 
As for the audio.. it's not a standard Microsoft 16bit PCM. It's a interplay-custom-format
lol of course it is...but avi2mve should still be able to understand the microsoft version when I encode it from VirtualDub2.

avi2mve has the option to take sound from other source
That's cool, and is certainly one workaround (thanks for pointing it out!), but I'm hoping there's a way to skip this extra step.

Alternatively you canadd the soundtrack before putting it into VirtualDub2 and simply order the program to keep original sound without processing it.
This is what I've been using, a video with a soundtrack, plugged it into VirtualDub2, applied a scaling and crop filter, then adjusted the audio settings to "pcm_s16le, 22050 Hz, 2 channels, s16", which is the same as what avi2mve spits out.

Is there a setting I'm getting wrong when using either VD2 or avi2mve? Why doesn't it process the audio directly from the file VD2 creates?
 
i've already told you
MS PCM and Interplay PCM are two different things and I don't know if they are compatible or if avi2mve will acecept Microsoft PCM. one thing i know is that I've tried to process the audio in VD2 and later on avi2mve failed to munch through it. Hence why I've said you can either bypass thesound processing by leaving the soundtrrack as is (if it's the correct format) or simply order not to process the sound at all in VD2, and get the sound from other source. come on avi2mve commandline structure really ain't that complicated. especially when you have the spoiler in form of a .jpg file with all the commands listed. as for the way to convert to interplay DPCM i have no idea where to even start looking, I've plowed literally whole fckn internet and haven't found one.
 
MS PCM and Interplay PCM are two different things
yup, I know that, just like you said earlier, and that wasn't my question

I don't know if they are compatible or if avi2mve will acecept Microsoft PCM
That was my question, thanks for answering :)

come on avi2mve commandline structure really ain't that complicated. especially when you have the spoiler in form of a .jpg file with all the commands listed.
The command line structure isn't my problem, it's trying to figure out the exact format that makes a video and audio track compatible with avi2mve. Thanks for helping me get something successfully encoded with vdub2, but that's not the end of the line for me.

as for the way to convert to interplay DPCM i have no idea where to even start looking, I've plowed literally whole fckn internet and haven't found one.
Well, guess it's my turn to start looking :)
Thanks for all the helpful suggestions so far!
 
Yeah..
So I've looked over teamX site some time ago and found full set of "mve-tools" one of them beeing 16 bit applications that could, at least in theory, create higher resolution mve output (the ones in tga2mve folder a.k.a klingon academy development tools for the videos) [i assume it's jut a matter of properly setting the .cfg file and inputing higher res images plus installing 32 bit windows on a pre 2010 potato PC / mean machine for year 1994 16bit apps). I mean once win 11 comes out those old non-compilant PC components are gonna be dirt cheap right?


@Mr.Stalin or anybody who might know:
Does anybody know a way how to add sound to an already existing .mve file and possibly how to synchronise it with the video?
 
Yeah so i did convert a video with custom audio track in Abel's avi2mve, although none of the options yealded any decent image quality.


for Video the .avi needs to be 640x480 maximum in resolution, and it has to be edited in virtualdub compressio type: uncompressed video color scheme must be set to 5 bit 5:5:5 or something similar. other options will not work. don't toy with framerate, leave the original one. as for audio...

avi2mve accepts audio from another .avi or a .wav or .mp3 with the -w parameter and file location. but don't get fooled with those nice adverts ".mp3" as most common output .mp3 from lame encoder will obviously not work. Fallout works with PCM s16le codec that is a "signed 16bit Little Endian PCM codec"

basically in ffmpeg you do this:
ffmpeg -y -i <input audio> -acodec pcm_s16le -f s16le -ac <number of audio channels 1=mono or 2=stereo. only stereo will work for MVE> -ar <audio frequency> output.wav

that's wrong..

this is right:

PCM must be made from a file with constant bitrate
so first:

ffmpeg -i <input file> -codec:a libmp3lame -ar 44100 -b:a 128k output.mp3

then:
ffmpeg -y -i input.mp3 -acodec pcm_s16le -ac 2 -ar <sample rate> output.wav

-f s16le … PCM signed 16-bit little-endian samples

-ac 2 … 2 channel (Stereo) ( must be stereo)

-ar <audio frequency> … sample rate 22050Hz or 44100Hz theoretical max is 48000Hz for s16le

next you go:

open the audio and video track in video editing software, so that you know the exact length of the video including miliseconds.
for lack of a better option i use shotcut that instead of miliseconds spits second to 24 parts. then you calculate for example in shotcut video length minutes x60x24 + video length in seconds x24 + what's after seconds without multiplying by anything. do the same for audio

nest step:
ffmpeg -v error -stats -y -i "<input audio file in quotes>" -af atempo=<audio value from above>/<video value from above> "<output audio file in quotes>"

depending on what's bigger audio number or video number the audio will get squeezed or streached to the video length, without a drastic change in pitch. doing calculations in miliseconds x1000 instead of x24 from shotcut values yealds higher precision of audio to video length fitting.

after that you open cmd in avi2mve location and:

avi2mve <input.avi> <output.mve> [-p <optional .pal file] [-w <PCM audio file in .avi .wav or .mp3 container>] [-old/-hq] [-dither(optionally)].

and that's it. the -hq gets damn long to make, other than that the output is damn ugly ingame anyways.
 
Last edited:
Back
Top