Last active
January 27, 2024 03:30
-
-
Save squaresmile/d2bb08da3578234ee6f9d205868f71bb to your computer and use it in GitHub Desktop.
Extract the video file from Criware .usm file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$key_b = "" | |
$key_a = "" | |
Get-ChildItem | ForEach-Object { | |
if ($_.Extension -eq ".usm") { | |
$VideoName = $_.BaseName | |
$AudioFiles = Get-ChildItem -Filter "$($VideoName)*.bin" | |
if ($AudioFiles -ne $null) { | |
$AudioFile = $AudioFiles | Select-Object -First 1 | |
crid_mod.exe -b $key_b -a $key_a -v $_.Name | |
$m2v = "$($VideoName).m2v" | |
hca2wav.exe -b $key_b -a $key_a $AudioFile.Name | |
$wav = "$($AudioFile.BaseName).wav" | |
ffmpeg -y -i $m2v -i $wav -c:v copy -c:a aac -b:a 128k "$($VideoName).mp4" | |
Remove-Item $m2v | |
Remove-Item $wav | |
Remove-Item $AudioFile | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
crid_mod.exe
: https://mega.nz/file/TJQniYwL#Dp_D-KvzVlVgTwqzVJc1n3vslBZsHdy8pdDqzhRtsOIhca2wav.exe
: https://github.com/OpenCGSS/DereTore/releasesRequires extracted HCA audio files in the same folder from VGMToolbox:
Misc. Tools > Stream Tools > Video Demultiplexer > USM (CRI Movie 2) / Extract Audio Only