|
1 | | -# VLC USM demux plugin |
| 1 | +# VLC USM 解复用插件 |
2 | 2 |
|
3 | | -This is a VLC 3 demux plugin for CRIWARE USM files. It extracts encrypted VP9 |
4 | | -payloads from `@SFV` chunks, tries keys from a configurable list, and hands VP9 |
5 | | -frames to VLC's native decoder. |
| 3 | +这是一个 VLC 3 的 CRIWARE USM 解复用插件。它会从 USM 文件的 `@SFV` |
| 4 | +chunk 中取出 VP9 视频帧,按配置的 CRIWARE key 解密,然后交给 VLC 自带的 |
| 5 | +VP9 解码器播放。 |
6 | 6 |
|
7 | | -## Build |
| 7 | +当前支持: |
| 8 | + |
| 9 | +- 直接打开 `.dat` / USM 文件。 |
| 10 | +- 加密 VP9 视频解密。 |
| 11 | +- 从默认 key 文件读取密钥,适合在文件管理器里双击打开。 |
| 12 | +- 基于时间轴拖动进度。 |
| 13 | + |
| 14 | +## 安装 Arch 包 |
| 15 | + |
| 16 | +仓库根目录已经可以生成 Arch 包: |
| 17 | + |
| 18 | +```sh |
| 19 | +cd packaging/arch |
| 20 | +PKGDEST=../.. makepkg -f |
| 21 | +cd ../.. |
| 22 | +sudo pacman -U vlc-plugin-usm-0.1.0-3-x86_64.pkg.tar.zst |
| 23 | +``` |
| 24 | + |
| 25 | +安装后,VLC 的插件缓存会由 pacman hook 自动更新。 |
| 26 | + |
| 27 | +## 配置密钥 |
| 28 | + |
| 29 | +推荐把 key 写到默认配置文件里,这样双击文件打开时也能自动解密: |
| 30 | + |
| 31 | +```sh |
| 32 | +mkdir -p ~/.config/vlc |
| 33 | +printf '0x7F4551499DF55E68\n' > ~/.config/vlc/usm-keys.txt |
| 34 | +``` |
| 35 | + |
| 36 | +默认读取顺序: |
| 37 | + |
| 38 | +1. `$XDG_CONFIG_HOME/vlc/usm-keys.txt` |
| 39 | +2. `~/.config/vlc/usm-keys.txt` |
| 40 | + |
| 41 | +key 文件支持十进制或 `0x` 前缀的十六进制;多个 key 可以用逗号、分号、 |
| 42 | +空白或换行分隔。`#` 后面的内容会当作注释。 |
| 43 | + |
| 44 | +也可以启动时临时传 key: |
| 45 | + |
| 46 | +```sh |
| 47 | +vlc --usm-keys 0x7F4551499DF55E68 /path/to/movie.dat |
| 48 | +``` |
| 49 | + |
| 50 | +或者指定一个自定义 key 文件: |
| 51 | + |
| 52 | +```sh |
| 53 | +vlc --usm-key-file /path/to/usm-keys.txt /path/to/movie.dat |
| 54 | +``` |
| 55 | + |
| 56 | +## 构建和测试 |
8 | 57 |
|
9 | 58 | ```sh |
10 | 59 | cmake -S . -B build |
11 | 60 | cmake --build build |
12 | 61 | ctest --test-dir build --output-on-failure |
13 | 62 | ``` |
14 | 63 |
|
15 | | -## Try with a local VLC plugin cache |
| 64 | +## 本地调试插件 |
| 65 | + |
| 66 | +可以不安装到系统,先用本地插件目录测试: |
16 | 67 |
|
17 | 68 | ```sh |
18 | 69 | mkdir -p build/vlc-plugins/demux |
19 | 70 | cp build/libusm_plugin.so build/vlc-plugins/demux/ |
20 | 71 | /usr/lib/vlc/vlc-cache-gen build/vlc-plugins |
21 | | -vlc --no-plugins-cache --plugin-path "$PWD/build/vlc-plugins" \ |
22 | | - --usm-keys 0x7F4551499DF55E68 \ |
23 | | - /home/clansty/Downloads/KALEID_/KALEID_MV_MAS.dat |
24 | | -``` |
25 | 72 |
|
26 | | -On recent VLC builds, use `VLC_PLUGIN_PATH` if `--plugin-path` is unavailable: |
27 | | - |
28 | | -```sh |
29 | 73 | VLC_PLUGIN_PATH="$PWD/build/vlc-plugins" vlc --no-plugins-cache \ |
30 | 74 | --usm-keys 0x7F4551499DF55E68 \ |
31 | | - /home/clansty/Downloads/KALEID_/KALEID_MV_MAS.dat |
32 | | -``` |
33 | | - |
34 | | -## Arch package |
35 | | - |
36 | | -```sh |
37 | | -cd packaging/arch |
38 | | -PKGDEST=../.. makepkg -f |
39 | | -cd ../.. |
40 | | -sudo pacman -U vlc-plugin-usm-0.1.0-1-x86_64.pkg.tar.zst |
| 75 | + /path/to/movie.dat |
41 | 76 | ``` |
42 | 77 |
|
43 | | -`--usm-keys` accepts comma, semicolon, whitespace, or newline separated keys. |
44 | | -Each key can be decimal or hexadecimal with a `0x` prefix. |
| 78 | +如果本地插件目录和系统已安装插件同时存在,VLC 可能仍然选中系统插件。做最终 |
| 79 | +验证时建议安装新包后再测试。 |
45 | 80 |
|
46 | | -By default, the plugin reads keys from `$XDG_CONFIG_HOME/vlc/usm-keys.txt`, or |
47 | | -`~/.config/vlc/usm-keys.txt` when `$XDG_CONFIG_HOME` is unset. This lets VLC load |
48 | | -keys when opening files from the GUI. |
| 81 | +## 已知限制 |
49 | 82 |
|
50 | | -`--usm-key-file` overrides the default path and points to a text file using the |
51 | | -same key format. Lines can include comments after `#`. |
| 83 | +- 当前只输出视频流,没有输出音频流。 |
| 84 | +- seek 通过从文件头重扫到目标时间附近的 VP9 keyframe 实现;大文件拖进度时 |
| 85 | + 可能会比普通容器慢一些。 |
0 commit comments