Tool to convert USM video files into user-friendly formats.
This tool is originally by @Rikux3, and this is a combination of the forks by @abheekda1, @vpellan, @fignyafsyakaya, and @MightyZanark, alongside my (@Commenter25) own changes. If you're curious about the differences, here's everything changed since Rikux3's original:
- All audio tracks will be extracted and converted
- Subtitle tracks will be extracted and converted to SRT files
- Configurable output directory
- Can run from any working directory
- Multithreading support, automatically uses max
- Updated to dotnet10
- vgmstream dependency removed
- Windows-only FFmpeg downloading removed
- Refactored source code to use .NET System libraries
- Published as a single standalone binary (no .NET runtime needed)
- Bumped version to 2.0.0, seeing as nobody else has yet
- probably brutalized c# i'm sorry
At some point, I would still like to make the config.json able to load from the standard config location for the system, like XDG_CONFIG_HOME, %APPDATA%, ~/.config, Environment.SpecialFolder.ApplicationData, whatever. That way, you could put the program in your PATH without putting a random json file in your path. I also think it'd be nice to have an option to only extract/convert one type of track. For example, only extracting the audio. But I don't feel like doing either at the moment :p
To begin with, make sure to install the dependency ffmpeg. This is platform-specific and can be figured out easily enough.
After that, it's as easy as it can get.
UsmToolkit extract <file/folder> [-o=OUTPUT_DIRECTORY] [-t=MAX_NUMBER_OF_THREAD]
UsmToolkit convert <file/folder> [-o=OUTPUT_DIRECTORY] [-p] [-t=MAX_NUMBER_OF_THREAD]
-p will preserve the raw files, like you would get running extract; as well as the srt files.
Pass a specific extension to only keep that, like -p srt. You can do this multiple times.
For more information, run UsmToolkit extract -h and UsmToolkit convert -h.
You should find config.json in the folder of the executable. With it, you can completely customize how the extracted file is processed by ffmpeg.
The default configuration is to copy the MPEG-1 video exactly, losslessly re-encode the audio to FLAC, convert the subtitles to SRT, and combine those into an MP4 file.
You can change these settings and add additional functions using standard ffmpeg syntax. For example, if you wanted to merge surround sound tracks into stereo, and use the more typically supported AAC format, you could change the audio parameters to -c:a aac -af pan='stereo|FL=FL+FC+0.5*BL+BR|FR=FR+LFE+0.5*BL+BR', which would combine the channels in the following order:
* Left channel: CH1, CH3, CH5 50% volume, CH6
* Right channel: CH2, CH4, CH5 50% volume, CH6
That said, if you want to get more advanced (such as changing settings for individual inputs), you will want to experiment with ffmpeg yourself outside of this program.
I (Commenter25) have personally only tested this with Batman: Arkham City. The subtitle functionality was originally created for Alien: Isolation, though it has been significantly modified since, so I can't say for certain if it would be the same. You should consider the subtitle extraction and conversion highly experimental. That said, if something goes horribly wrong with a particular game, please do make a bug report!
UsmToolkit follows the MIT License. It uses code from VGMToolbox.