Skip to content

A graphical UI for ToaHartor's Genshin Cutscenes Demuxer

Notifications You must be signed in to change notification settings

azurenekowo/ayaka

Repository files navigation

Ayaka

A graphical UI implementation for ToaHartor's gi-cutsenes utility.

Disclaimer

  • This was created for educational and demonstrational purpose only.
  • I didn't code the demuxer / decrypter program myself, all I did was creating a front-end interface and code a new procedure to merge the video (see the "Limitations" section). All credits of the demuxing / decrypting process and the gi-cutscenes CLI program belongs to the mastermind of gh/ToaHartor.
  • All assets, including the font and the cutscenes files are intellectual property of miHoYo. The icon was taken from Genshin Impact Wiki.

Features

  • Select specific audio track / subtitles languages to be merged into a single video.
  • Provide an easy and intuitive interface to interact with gi-cutscenes
  • Screenshots:
Expand...

How to run?

Configuration file

config.json can be found at the root folder.
Below is a simple cheatsheet / handbook.

{
    "prerequisites": {
        "ffmpeg": "path",
        "gicutscenes": "<path_to_GICutscenes.exe>"
    },
    "output": "<output_directory>",
    "defaultFFMPEGFlags": "-preset superfast",
    "optionUSMFilesDir": "<folder_containing_usm_files>"
}
key meaning
prerequisites.ffmpeg The path to FFmpeg's binary. If set to path, it'll look inside %path%
prerequisites.gicutscenes The path to gi-cutscenes binary
output The path to the folder that the program will use to export the video
optionUSMFilesDir The path to the folder containing the .usm file(s) to load in

.usm file schema (a simplified breakdown)

It's basically an archive that is encrypted and needs to be decrypted/demuxed in order to view its content.

You can find them in [genshin impact folder]\GenshinImpact_Data\StreamingAssets\VideoAssets\StandaloneWindows64.
There are some cutscenes that have 2 files with the same name, suffixed with Boy / Girl.
It is for Aether / Lumine specifically.

Normally, it contains:

  • filename.ivf: The actual video file, without any subtitles or audio track.
  • filename_AUDIO_CODE.hca: The encrypted audio file. There are 4 values available for AUDIO_CODE:
    • 0: Chinese
    • 1: English
    • 2: Japanese
    • 3: Korean
  • If there are subtitles in the cutscene, gi-cutscenes will extract and convert them to .ass files, in the format filename_LANG_CODE.ass. There are 15 values available for LANG_CODE:
    • CHS: Chinese Simplified
    • CHT: Chinese Traditional
    • DE: German
    • EN: English
    • ES: Spanish
    • FR: French
    • ID: Indonesian
    • IT: Italian
    • JP: Japanese
    • KR: Korean
    • PT: Portuguese
    • RU: Russian
    • TH: Thai
    • TR: Turkish
    • VI: Vietnamese

Limitations

  • ToaHartor's gi-cutscenes doesn't provide an option to extract subtitles individually. You have to use its -m (merge) option and -nc (no cleanup), that will merge the video in order to generate the .ass files. Then after that, the program will start merging the audio track, the video and the subtitles (if provided) into a .mp4 file.
  • The speed depends on your device specs. could be somewhat improved with tweaking the -preset flag - doc
  • For now, Windows only.

Roadmap / TODOs

  • Live console output in the browser
  • Improve the stability and fallback options if FFmpeg fails
  • Migrating to fluent-ffmpeg instead of running it in the shell
  • Cross-platform support

Contribute to the project

All contributions are appreciated.
If you have an issue please submit it under the Issues tab. Or if you want to contribute, you can open a pull request.

About

A graphical UI for ToaHartor's Genshin Cutscenes Demuxer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published