Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support hca decryption and optimize #33

Closed
wants to merge 3 commits into from
Closed

support hca decryption and optimize #33

wants to merge 3 commits into from

Conversation

BUnipendix
Copy link
Contributor

cache decrypted hca data in memory to decrease disk io and increased speed by 15% to 35% (test on my computer).
set "-e ffmpeg" to enable decrypted hca export, because ffmpeg support hca decode.

@BUnipendix BUnipendix closed this Aug 21, 2022
@BUnipendix BUnipendix reopened this Aug 21, 2022
@ToaHartor
Copy link
Owner

Thanks for the PR.
So, if I understand well, it improves the extraction time by keeping the HCA data in memory (which is a good idea considering no one will actually read the raw HCA file). And if FFMPEG is used, then only the decryption is necessary since it natively supports HCA files.

Did I get that correctly ?

@BUnipendix
Copy link
Contributor Author

Thanks for the PR.
So, if I understand well, it improves the extraction time by keeping the HCA data in memory (which is a good idea considering no one will actually read the raw HCA file). And if FFMPEG is used, then only the decryption is necessary since it natively supports HCA files.

Did I get that correctly ?

yes

@ToaHartor
Copy link
Owner

ToaHartor commented Aug 21, 2022

Alright, so I tested the code a bit (on Windows), and I was wondering if you also got this error during the merge (with -loglevel trace, with the cutscene Cs_Inazuma_EQ4002207_ShikishogunRecalling_Boy.usm) :

[matroska @ 0000024e5aff7c40] No wav codec tag found for codec hca
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:4 --

There might be a fix to it, by adding in the codec section -c:a pcm_s16le.

Does FFMPEG need additional configuration to automatically detect it ?

@BUnipendix
Copy link
Contributor Author

Alright, so I tested the code a bit (on Windows), and I was wondering if you also got this error during the merge (with -loglevel trace, with the cutscene Cs_Inazuma_EQ4002207_ShikishogunRecalling_Boy.usm) :

[matroska @ 0000024e5aff7c40] No wav codec tag found for codec hca
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:4 --

There might be a fix to it, by adding in the codec section -c:a pcm_s16le.

Does FFMPEG need additional configuration to automatically detect it ?

yes. I merge it with my own script.So I didn't test its own merge features.

@BUnipendix
Copy link
Contributor Author

Alright, so I tested the code a bit (on Windows), and I was wondering if you also got this error during the merge (with -loglevel trace, with the cutscene Cs_Inazuma_EQ4002207_ShikishogunRecalling_Boy.usm) :

[matroska @ 0000024e5aff7c40] No wav codec tag found for codec hca
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:4 --

There might be a fix to it, by adding in the codec section -c:a pcm_s16le.

Does FFMPEG need additional configuration to automatically detect it ?

I use this FFMPEG encode option to merge mkv.

@ToaHartor
Copy link
Owner

Alright, I have some testing to do to see if I can copy the codec for the video and subtitles and specify the one for the audio. After that, I can merge this.

@BUnipendix BUnipendix closed this by deleting the head repository Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants