Note: All tools used are linked at the bottom of the post.
In this guide I will cover:
- How to extract content from the game and locate audio and video files
- How to convert the audio and video into viewable formats
Extracting the files from the game using DXMD Extract
- Unpack the DXMDExtract archive and move DXMDExtract.exe to the installation location for the game, for example, for the Steam version:
Main game: Steam\steamapps\common\Deus Ex Mankind Divided\runtime
DLC: Steam\steamapps\common\Deus Ex Mankind Divided\DLC\runtime - In that same folder, create a new text file. Open it in a text editor, and enter the following line:
DXMDExtract . .\extracted
Example: - Save and exit, and then rename the file to unpack.bat
- Double-click on it, and then the Command Prompt will appear and begin to unpack the game
Browsing the contents of the extracted files using DEMDDatabase
- Unpack the DEMDDatabase archive and run DEMD Database.exe
- File > Open > Open unpacked DB
- Navigate to the NameMap.txt file from the extracted folder created previously when unpacking with DXMDExtract
- After loading, the file trees are now displayed graphically and can be browsed, for example if you’re searching for conversational dialogue, you can expand the file list until you find what you need
Convert unsorted audio files with HxD
- Navigate to the runtime folder for either the main installation of Mankind Divided or the DLC runtime folder. Here the audio and video files appear to be unsorted and scattered. Audio files have the extension .pc_fsbm
- Save the file with HxD editor, this will automatically create a backup of the original .pc_fsbm file in the same folder
- As a .fsb file, it can now be converted to.wav using vgmstream or FSB Extractor - this is covered in detail in my other guide on extracting audio and video from Deus Ex: Human Revolution - the process is identical.
Extract specific audio (i.e. conversational dialogue) with DEMD Database
- For a more targeted approach, the NameMap.txt file that is generated from the DXMD Extraction comes in useful as it lists every file and where they can be found within the file tree
- Opening it with a text editor and using the find function can help narrow down the search, in this instance I was searching for a specific conversation, and in the .txt file it is called dlc_1_441_con. I was able to find this easily in the file tree
- It is possible to export the entire conversation in one go, but in order to do that the fast export savepath needs to be set first. To do this, go to File > Settings
Convert unsorted video files (cinematics, loading screens) with HxD
- Before starting, you need RAD Video Tools (Bink Video Player) to play the videos after converting them. Download and install it, as you'll need it for the next section of this guide to convert the audio streams from the video.
- Navigate to the runtime folder for either the main installation of Mankind Divided or the DLC runtime folder. Here the audio and video files appear to be unsorted and scattered. Video files have the extension .pc_binkvid
- Save the file with HxD editor, this will automatically create a backup of the original .pc_binkvid file in the same folder
Extract and split audio tracks from .bk2 files with VGMToolbox
- Open VGMToolbox > Misc. Tools > Stream Tools > Video Demultiplexer > Options > set the Format to BIK (Bink Video Container) > check Split Audio Tracks > check Extract Audio and Video
- Drag and drop the .bk2 file you want to extract into the grey area and it will automatically run with the options set
Note: In the EU version of the game, layer 00000004 contains the English voices, and layers 00000005, 00000006, 00000007, 00000008, 00000009, 0000000C, and 0000000D all have other European localisations such as Spanish, German, Russian, etc. Layer 00000000 seems to have the main background music and effects, 00000001, 00000002, and 00000003 have additional effects such as footsteps, etc.
Convert the audio streams using RAD Video Tools
- Open RAD Video Tools > navigate to and select every .audio.split.bik file you want to convert > Convert a File > Yes to Batch Process dialogue box if you are converting multiple files
Convert the audio streams using VLC Media Player
- Open VLC Media Player > Media > Convert/Save
- The .bik file should now be converted into a .wav file and can be found in your set destination folder
Convert the video stream using RAD Video Tools
- Open RAD Video Tools > navigate to and select the original .BK2 file you want to convert > Convert a File
- Within the Bink Converter window > change the Output Type to .MP4 > leave the other settings as default > make sure Audio is NOT selected > click the Convert button on the right
- A window will appear showing the progress of the conversion
- The .BK2 file should now be converted to an .MP4 file without audio
Combine the video stream and the audio streams using FFmpeg
Note: You can use FFmpeg (a command line interface program, instructions to install on Windows are here) to add map each audio stream as separate channels, but the problem with this is that a video player can only play one channel at a time. If all channels are to play, an amix filter would need to be applied that will combine all the channels into one track, for example:
ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
But for the sake of simplicity, another way to do this without having to write up a complex command and enter all the file names is to import all of the audio streams (i.e. all the SFX ones and ONE voice one depending on the localisation you want) into Audacity, and then export all of them into one .wav file:
Then, with one video file and one audio file, you simply need to combine the two into one file using the following command:
ffmpeg -i 2B4301F00CBF6612436EB95C599AAFC3.mp4 -i 2B4301F00CBF6612436EB95C599AAFC3_00000000.audio.merge.wav -c:v copy -shortest output.mp4
To understand the command, the video and audio are set as inputs (filename will be different depending on which files you are doing this with), it will copy the same codec settings to avoid quality loss, it will cut to the shortest stream length to avoid overrunning if the lengths differ, and the output name will simply be output.mp4:
When played, the video remains with a very high quality and all the audio channels are audible in one audio track:
View the results on YouTube:
Tools
- DXMDExtract: https://sktest.aruarose.com/DXMDExtract_v002.7z
- DEMDDatabase: https://disk.yandex.com/d/qUxdTmJa3MxHEs
- HxD: https://mh-nexus.de/en/hxd
- RAD Video Tools: http://www.radgametools.com/bnkdown.htm
- VLC Media Player: https://www.videolan.org
- FFmpeg: https://www.gyan.dev/ffmpeg/builds/ffmpeg-git-full.7z
Great post! Helps a lot.
ReplyDeleteHow did you get DEMD Database to extract to ogg? I just get a 'convert failed' error and it stays a wavebank and there doesn't seem to be any option to tell it where the codec is or anything.
ReplyDelete