kasaneru 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.ja.md +1 -0
- package/README.md +1 -0
- package/bin/kasaneru.mjs +41 -25
- package/flutter_backend/pubspec.yaml +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `kasaneru` are documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.0.3] - 2026-11-21
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- `--help` / `-h` and `--version` / `-v` work; an unknown option prints the usage instead of a stack trace.
|
|
10
|
+
|
|
5
11
|
## [0.0.2] - 2026-11-21
|
|
6
12
|
|
|
7
13
|
### Changed
|
package/README.ja.md
CHANGED
|
@@ -46,6 +46,7 @@ node bin/kasaneru.mjs inspect out/basic.mp4
|
|
|
46
46
|
| `captions <字幕ファイル> --fps N` | SRT・ASSを `[{from, to, text}]`(コマ数)のJSONにする |
|
|
47
47
|
| `probe <素材> [--fps N]` | 素材の長さ(コマ数)・大きさ・音声の有無を調べる |
|
|
48
48
|
| `envelope <音声> --fps N` | コマごとの音量を配列で出す(口パクなど) |
|
|
49
|
+
| `--help` / `--version` | 使い方・版を表示する。知らない指定を渡すと、どれが違うかと使い方を出して終了コード2で終わる |
|
|
49
50
|
|
|
50
51
|
`render` の主な指定:
|
|
51
52
|
|
package/README.md
CHANGED
|
@@ -46,6 +46,7 @@ node bin/kasaneru.mjs inspect out/basic.mp4
|
|
|
46
46
|
| `captions <subtitle file> --fps N` | Converts SRT/ASS to JSON `[{from, to, text}]` (in frames) |
|
|
47
47
|
| `probe <asset> [--fps N]` | Reports an asset's length (in frames), dimensions, and whether it has audio |
|
|
48
48
|
| `envelope <audio> --fps N` | Outputs the per-frame volume as an array (for lip sync and the like) |
|
|
49
|
+
| `--help` / `--version` | Prints the usage or the version. An unknown option prints which one and the usage, and exits with code 2 |
|
|
49
50
|
|
|
50
51
|
Main options for `render`:
|
|
51
52
|
|
package/bin/kasaneru.mjs
CHANGED
|
@@ -14,6 +14,7 @@ import {readSubtitles, toFrames} from '../src/subtitles.mjs';
|
|
|
14
14
|
import {formatProblems, validateManifest} from '../src/validate.mjs';
|
|
15
15
|
|
|
16
16
|
const USAGE = `usage:
|
|
17
|
+
kasaneru --help | --version
|
|
17
18
|
kasaneru render <manifest.json> -o <out.mp4|.mov|.webm|.gif> Render
|
|
18
19
|
[--backend browser|flutter|none] [--frames A-B] [--concurrency N] [--props <file|json>] [--set a.b=value]...
|
|
19
20
|
[--encoder libx264|h264_videotoolbox] [--crf N] [--audio-bitrate 192k] [--every-frame] [--keep-work] [--work <dir>]
|
|
@@ -28,31 +29,46 @@ const USAGE = `usage:
|
|
|
28
29
|
kasaneru probe <file> [--fps N] Report the length and dimensions of an asset
|
|
29
30
|
kasaneru envelope <audio> --fps N Output the per-frame volume as JSON (for lip sync)`;
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
32
|
+
let parsed;
|
|
33
|
+
try {
|
|
34
|
+
parsed = parseArgs({
|
|
35
|
+
allowPositionals: true,
|
|
36
|
+
options: {
|
|
37
|
+
help: {type: 'boolean', short: 'h', default: false},
|
|
38
|
+
version: {type: 'boolean', short: 'v', default: false},
|
|
39
|
+
out: {type: 'string', short: 'o'},
|
|
40
|
+
backend: {type: 'string', default: 'browser'},
|
|
41
|
+
'every-frame': {type: 'boolean', default: false},
|
|
42
|
+
concurrency: {type: 'string', default: '4'},
|
|
43
|
+
encoder: {type: 'string', default: 'libx264'},
|
|
44
|
+
crf: {type: 'string', default: '18'},
|
|
45
|
+
'audio-bitrate': {type: 'string'},
|
|
46
|
+
'allow-missing-assets': {type: 'boolean', default: false},
|
|
47
|
+
work: {type: 'string'},
|
|
48
|
+
frames: {type: 'string'},
|
|
49
|
+
frame: {type: 'string'},
|
|
50
|
+
'keep-work': {type: 'boolean', default: false},
|
|
51
|
+
fps: {type: 'string'},
|
|
52
|
+
props: {type: 'string'},
|
|
53
|
+
set: {type: 'string', multiple: true},
|
|
54
|
+
deep: {type: 'boolean', default: false},
|
|
55
|
+
every: {type: 'string'},
|
|
56
|
+
manifest: {type: 'string'},
|
|
57
|
+
cols: {type: 'string', default: '4'},
|
|
58
|
+
key: {type: 'string'},
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
} catch (e) {
|
|
62
|
+
// An unknown option or a missing value: say which, then show the usage (not a stack trace).
|
|
63
|
+
console.error(`${e.message}\n\n${USAGE}`);
|
|
64
|
+
process.exit(2);
|
|
65
|
+
}
|
|
66
|
+
const {values: opt, positionals} = parsed;
|
|
67
|
+
if (opt.help) { console.log(USAGE); process.exit(0); }
|
|
68
|
+
if (opt.version) {
|
|
69
|
+
console.log(JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')).version);
|
|
70
|
+
process.exit(0);
|
|
71
|
+
}
|
|
56
72
|
const [command, target] = positionals;
|
|
57
73
|
const fail = (message, code = 2) => { console.error(message); process.exit(code); };
|
|
58
74
|
const print = (value) => console.log(JSON.stringify(value, null, 2));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kasaneru",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Render video from a JSON manifest. ffmpeg cuts and composites video and audio; a rendering backend (browser or Flutter) draws text, shapes and 3D as images to layer on top",
|
|
6
6
|
"keywords": [
|