bunipendix / pycriusm Goto Github PK
View Code? Open in Web Editor NEWa python script to decrypt and demux Honkai: Star Rail cutscene video
a python script to decrypt and demux Honkai: Star Rail cutscene video
It seems my 2.1 cutscene doesn't work, but 2.0 is fine though
Hello, I'm sorry for the question but do you know how to obtain the "GetVideoVersionKeyScRsp.json"?
I know it's using Iridium-SR, but since this version of PyCriUsm came out, which has the corrupted 2.2 scenes, I've been looking for how to use Iridium-SR. What I don't know is how to get the "StarRail.proto" and the "packetIds.json". I have searched everywhere, in the Melledy/LunarCore repository and the Dimbreath/StarRailData repository, but I can't find those files. Could you help me know how to get them?
Looks like key_gen part needs to be updated everytime new resources are added, just curious how do you generate these configuration file or would you update this repo at your convienience?
Hello author! Please help me on your program. I don't understand this example:
def extract_video(video_path, output_dir):
a = UsmDemuxer(video_path)
video_name, audio_names = a.export(output_dir)
return video_name, audio_names
So I tried to run python demux.py in cri_usm_demuxer folder, and I got this output:
Traceback (most recent call last):
File "C:\Users***\Downloads\Compressed\PyCriUsm-main\cri_usm_demuxer\demux.py", line 10, in
from .decrypt import VideoDecrypter
ImportError: attempted relative import with no known parent package
I've used the tool to try and demux to ivf files, but none of the encrypted files can be played, including those before 2.2 all the way to 1.0.
Audio can be played just fine.
How do you get the keys of cutscenes?
And where is the keys of the following cutscenes?
CS_ChapLoop_Black.usm
CS_ChapLoop01_Act0010.usm
CS_ChapLoop01_Act0020.usm
CS_ChapLoop01_Act0030.usm
CS_ChapLoop01_Act0070.usm
CS_ChapLoop01_Act0080.usm
CS_ChapLoop01_Act0090.usm
CS_ChapLoop01_Act0100.usm
CS_ChapLoop01_Act0100_f.usm
CS_ChapLoop01_Act0100_m.usm
CS_ChapLoop01_Act0110.usm
CS_ChapLoop02_Act0010.usm
CS_ChapLoop02_Act0040.usm
I want to get the packets as fast as possible after the latest version is released.
Can anyone share their knowledge about capturing packets?
之前过任务的循环动画(文件名里带loop的)都是不加密的,用vgmtoolbox简单一搞就行了,这个版本也开始加密了,心塞
The current version of pycriusm has some unknown problems. I'll try to fix it when free.
Act290-Act420无法正常播放,Act3030,Act3040,Act3050可以正常播放
不知道是不是key错了,用的0.1.0版本提取,(0.2.0版本我跑不起来)
以下是keygen生成的2.2key
"2.2": {
"CS_Chap03_Act290": 34343628189265910,
"CS_Chap03_Act291": 31724129236787323,
"CS_Chap03_Act292": 36303075526024129,
"CS_Chap03_Act293": 34394315752131405,
"CS_Chap03_Act294": 36756492249222538,
"CS_Chap03_Act295": 38857952270624683,
"CS_Chap03_Act296": 36629637414349375,
"CS_Chap03_Act297": 36789396009833296,
"CS_Chap03_Act298": 35453543606285533,
"CS_Chap03_Act300_f": 69052883475069961,
"CS_Chap03_Act300_m": 69052883475069968,
"CS_Chap03_Act320_f": 64285851182029801,
"CS_Chap03_Act320_m": 64285851182029808,
"CS_Chap03_Act330_f": 68357291907217520,
"CS_Chap03_Act330_m": 68357291907217527,
"CS_Chap03_Act340_f": 64494127626372980,
"CS_Chap03_Act340_m": 64494127626372987,
"CS_Chap03_Act350_f": 66397565858597399,
"CS_Chap03_Act350_m": 66397565858597406,
"CS_Chap03_Act360_f": 65177370866893207,
"CS_Chap03_Act360_m": 65177370866893214,
"CS_Chap03_Act370_f": 71549816607797696,
"CS_Chap03_Act370_m": 71549816607797703,
"CS_Chap03_Act380_f": 69013117824009615,
"CS_Chap03_Act380_m": 69013117824009622,
"CS_Chap03_Act390_f": 64195379981055792,
"CS_Chap03_Act390_m": 64195379981055799,
"CS_Chap03_Act400": 36757672915453144,
"CS_Chap03_Act410_f": 69303035880316340,
"CS_Chap03_Act410_m": 69303035880316347,
"CS_Chap03_Act420": 38790658027680965,
"CS_Chap03_Act3030": 11463307764324669,
"CS_Chap03_Act3040": 11469307207675653,
"CS_Chap03_Act3050": 14458332448662471
}
Only 3 frames from the output video can be played, here's a output message of ffmpeg, is there an overflow on DTS and PTS -9170736216176061440?
ffmpeg -i CS_Chap01_Act150_m.ivf -c copy CS_Chap01_Act150_m.webm
Input #0, ivf, from '/Users/ibobby/GitHub/PyCriUsm/output/CS_Chap01_Act150_m.ivf':
Duration: 00:00:39.13, start: 0.000000, bitrate: 8003 kb/s
Stream #0:0: Video: vp9 (Profile 0) (VP90 / 0x30395056), yuv420p(tv, smpte170m/unknown/unknown), 2560x1440, 30 tbr, 30 tbn
Output #0, webm, to '/Users/ibobby/GitHub/PyCriUsm/output/CS_Chap01_Act150_m.webm':
Metadata:
encoder : Lavf60.16.100
Stream #0:0: Video: vp9 (Profile 0) (VP90 / 0x30395056), yuv420p(tv, smpte170m/unknown/unknown), 2560x1440, q=2-31, 30 tbr, 1k tbn
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
Truncating packet of size 469827712 to 39049055
[ivf @ 0x7fabcea04680] Packet corrupt (stream = 0, dts = NOPTS).
[in#0/ivf @ 0x7fabcea043c0] corrupt input packet in stream 0
DTS -9170736216176061440, next:33333 st:0 invalid dropping
PTS -9170736216176061440, next:33333 invalid dropping st:0
[out#0/webm @ 0x7fabbd704540] video:38232kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
size= 98kB time=00:00:00.03 bitrate=24150.0kbits/s speed=0.577x
Would love that to be able to use the tool for 2.0
I was importing the demux.py, and it gives me this error message:
from .decrypt import VideoDecrypter
ImportError: attempted relative import with no known parent package
After I remove that '.' before decrypt it works fine.
To be honest, I don't know what '.decrypt' is, so this could be a result of my misuse, if this is the case, I apologize.
Hello author! Help me please on your programm. i install this programm in my pc, and she dont work. I have installed visual studio and msbuild, but it didn't help in solving my problem. Screenshot: imgur
import asyncio
from pycriusm import extract_usm
videos, audios = asyncio.run(extract_usm("Path", "output_folder", is_async=True))
Error:
ImportError: dynamic module does not define module export function (PyInit_pycriusm)
Can anyone tell me how to use it?
keygen里面的文件VideoConfig.json和GetVideoVersionKeyScRsp.json跟key.json的关系是什么?
如果我只想提取单个版本的文件我要怎么做?我把keygen里面的文件全删了似乎也不影响程序运行,估计是读取了key.json里面的内容?但是如果我把key.json里其他keys都删了(比如说我只保留了2.1的keys)我依然能提取到前面版本的内容。
我找gpt写的一个代码来批量转换(不知道是不是代码的问题)
import asyncio
import os
from PyCriUsm import extract_usm
input_directory = r'E:\temp\Star Rail\Game\StarRail_Data\StreamingAssets\Video\Windows'
output_directory = r'D:\Video'
async def process_usm_file(file_path):
"""处理单个usm文件"""
try:
videos, audios = await extract_usm(file_path, output_directory, is_async=True)
print(f"处理完成:{file_path}")
except Exception as e:
print(f"处理错误:{file_path},错误:{e}")
async def process_all_usm_files(input_dir):
"""遍历目录并处理所有usm文件"""
tasks = []
# 遍历文件夹中所有文件
for file_name in os.listdir(input_dir):
if file_name.endswith('.usm'):
full_path = os.path.join(input_dir, file_name)
# 创建任务
task = process_usm_file(full_path)
tasks.append(task)
# 并发执行所有任务
await asyncio.gather(*tasks)
asyncio.run(process_all_usm_files(input_directory))
I've been studying this all day but there's no way out of this problem
ImportError: dynamic module does not define module export function (PyInit_decrypt)
is there any help for this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.