Wargus / wargus

Importer and scripts for Warcraft II: Tides of Darkness, the expansion Beyond the Dark Portal, and Aleonas Tales
GNU General Public License v2.0
360 stars 55 forks source link

Fix videos extraction from GOG's BNE download #418

Closed baco closed 2 years ago

baco commented 2 years ago

Describe the bug When extracting data files for Warcraft II: Tides of Darknes & Beyond the Dark Portal titles, cinematics won't get extracted nor converted to OGV format.

For each of the files, FFmpeg outputs something like:

/home/baco/.stratagus/data.Wargus/videos/human-1.smk: No such file or directory

To Reproduce Steps to reproduce the behavior:

  1. Run wargus --extract
  2. Select the downloaded .exe from GOG (in my case: setup_warcraft_ii_2.02_v4_(28734).exe)
  3. When FFmpeg tries to convert the cinematics, it doesn't find the .smk files

Expected behavior Actually, the files are there, in the BNE .exe file, but under different names. The necessary files are inside Install.mpq, but some renaming is needed in order to have them right. These are the mappings I could grasp (but some may actually be wrong because I have never played the entire game on Windows, and I may have mixed the order of some of the cinematics):

File00000338.smk -> videos/logo.smk
File00000346.smk -> videos/gameintro.smk
File00000339.smk -> videos/orc-1.smk
File00000353.smk -> videos/orc-2.smk
File00000340.smk -> videos/orc-3.smk
File00000348.smk -> videos/orc-4.smk
File00000350.smk -> videos/human-1.smk
File00000356.smk -> videos/human-2.smk
File00000349.smk -> videos/human-3.smk
File00000343.smk -> videos/human-4.smk
File00000345.smk -> videos/exp-1.smk
File00000347.smk -> videos/orc-exp-2.smk
File00000344.smk -> videos/human-exp-2.smk

Making those renames manually while extracting the .exe gave me the correct cinematics in .ogv format.

Screenshots and Logs

...
videos/human-1 from MPQ file "/tmp/wargus/Install.mpq"
ffmpeg -y -i "/home/baco/.stratagus/data.Wargus/videos/human-1.smk" -codec:v libtheora -qscale:v 31 -codec:a libvorbis -qscale:a 15 -pix_fmt yuv420p -aspect 4:3 -vf scale=640:0,setsar=1:1 "/home/baco/.stratagus/data.Wargus/videos/human-1.ogv"
/home/baco/.stratagus/data.Wargus/videos/human-1.smk: No such file or directory
Can't convert video videos/human-1 to ogv format. Is ffmpeg installed in PATH?
videos/human-2 from MPQ file "/tmp/wargus/Install.mpq"
ffmpeg -y -i "/home/baco/.stratagus/data.Wargus/videos/human-2.smk" -codec:v libtheora -qscale:v 31 -codec:a libvorbis -qscale:a 15 -pix_fmt yuv420p -aspect 4:3 -vf scale=640:0,setsar=1:1 "/home/baco/.stratagus/data.Wargus/videos/human-2.ogv"
/home/baco/.stratagus/data.Wargus/videos/human-2.smk: No such file or directory
Can't convert video videos/human-2 to ogv format. Is ffmpeg installed in PATH?
...

as shown, FFmpeg runs, but it doesn't find the correct filenames

Desktop (please complete the following information):

timfel commented 2 years ago

Weird, I test with the gog installer (some version i downloaded last year) and it works there. I'll have a look

baco commented 2 years ago

I don't know if I can download an earlier version of the setup file. I've also noticed that voice tracks of the characters in-game haven't been converted either.

timfel commented 2 years ago

Which language version are you trying? As you can see at the very start start of the 3.1 release video (https://youtu.be/6a4dy16q49c), the same installer version (at least from the name) works for me...

baco commented 2 years ago

Nothing fancy, plain and simple [en-US]: Wargus Extraction

baco commented 2 years ago

I had seen that video, and I thought exactly the same “oh, this should work out of the box”, and after it didn't I upgraded from 3.1.2 to 3.2.0 my Wargus version; with the same outcome. So, my issue comes from before, it comes from at least 3.1.2

baco commented 2 years ago

Here's an idea. Do yo have the checksum of your installer (English version)? Mine are (MD5, SHA-256, SHA-512):

1635c5d2d5960f21d532c477837f238d  setup_warcraft_ii_2.02_v4_(28734).exe
639231696e38e7df6fa34ad0cd494d979a6a8c3b6417e1cf9c3bb7477d60c3b1  setup_warcraft_ii_2.02_v4_(28734).exe
fe3fdfed349f78592b4cb980731aeb232aa2c8a4acb7cf8a16c0c0629acd66029e13931645244a9142f99b9c7682c56b94ef8b6af8356c4c500eb6e95671445a  setup_warcraft_ii_2.02_v4_(28734).exe
timfel commented 2 years ago

ah, I see your issue. you probably just opened the mpq file without a listfile, right? old mpq files do not contain the filenames. If you just open these without a listfile, you get some arbitrary filenames. (see e.g. here for a bit of background). That being said, my checksums are different, even though the filename is the same. I downloaded a fresh copy from GOG yesterday. I can, however, extract just fine with the current Wargus version

timfel commented 2 years ago

Should've linked directly here which explains about the filenames

baco commented 2 years ago

Ok, it seems you are right. Obtaining the .txt corresponding to Warcraft2, there on that site, and using it to extract files from Install.mpq seemed to produce the correct naming of things:

$ smpq -x -L "Warcraft II BNE".txt Install.mpq
$ ls -1 Smk/
Blizzard.bik
Burn_M.smk
Demn_M.smk
Diablo2.bik
HVict_M.smk
HVicX_M.smk
Intro_M.smk
IntroX_M.smk
OrcX_M.smk
OVict_M.smk
Ships_M.smk
Smoke_M.smk
StarEx.bik
StarEx.smk
Turtle_M.smk
War3.bik
War3.smk
Zepp_M.smk

but those files still don't have the correct filenames FFmpegs expects to be passed. Or at least not the filenames it finally fails to find.

baco commented 2 years ago

Ok, extracting those files by hand, even though now, when using the Warcraft II BNE.txt as reference come with the correct names, doesn't seem to help wartool command to find and properly convert either the cinematics files or the voice ones.