gifvid 0.1.0
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/LICENSE +21 -0
- package/README.md +210 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +376 -0
- package/dist/cli.js.map +1 -0
- package/dist/core/manifest.d.ts +2 -0
- package/dist/core/manifest.js +5 -0
- package/dist/core/manifest.js.map +1 -0
- package/dist/core/media.d.ts +38 -0
- package/dist/core/media.js +197 -0
- package/dist/core/media.js.map +1 -0
- package/dist/core/presets.d.ts +11 -0
- package/dist/core/presets.js +101 -0
- package/dist/core/presets.js.map +1 -0
- package/dist/core/publish.d.ts +10 -0
- package/dist/core/publish.js +47 -0
- package/dist/core/publish.js.map +1 -0
- package/dist/core/source.d.ts +13 -0
- package/dist/core/source.js +135 -0
- package/dist/core/source.js.map +1 -0
- package/dist/core/tools.d.ts +15 -0
- package/dist/core/tools.js +60 -0
- package/dist/core/tools.js.map +1 -0
- package/dist/types.d.ts +89 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/files.d.ts +5 -0
- package/dist/utils/files.js +41 -0
- package/dist/utils/files.js.map +1 -0
- package/dist/utils/format.d.ts +3 -0
- package/dist/utils/format.js +36 -0
- package/dist/utils/format.js.map +1 -0
- package/dist/utils/time.d.ts +4 -0
- package/dist/utils/time.js +52 -0
- package/dist/utils/time.js.map +1 -0
- package/package.json +64 -0
- package/skills/gifvid-cli/SKILL.md +98 -0
- package/skills/gifvid-cli/agents/openai.yaml +4 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Daniel G Wilson
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
# gifvid
|
|
2
|
+
|
|
3
|
+
`gifvid` is a local-first CLI for turning a URL or local media file into a size-constrained GIF, MP4, or WebM that is actually usable in Slack, docs, and the web.
|
|
4
|
+
|
|
5
|
+
The product shape is simple:
|
|
6
|
+
|
|
7
|
+
1. bring in a video source
|
|
8
|
+
2. pick the exact clip window that matters
|
|
9
|
+
3. export something that fits where you need to send it
|
|
10
|
+
|
|
11
|
+
`gifvid` starts with the reliable primitives that already work on a real machine:
|
|
12
|
+
|
|
13
|
+
- `yt-dlp` for URL-based ingestion
|
|
14
|
+
- `ffmpeg` and `ffprobe` for clipping and rendering
|
|
15
|
+
- optional Cloudflare R2 upload for sharing
|
|
16
|
+
|
|
17
|
+
## Requirements
|
|
18
|
+
|
|
19
|
+
- Node.js 20+
|
|
20
|
+
- `ffmpeg`
|
|
21
|
+
- `ffprobe`
|
|
22
|
+
- `yt-dlp` for URL inputs
|
|
23
|
+
|
|
24
|
+
On macOS with Homebrew:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
brew install ffmpeg yt-dlp
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Install
|
|
31
|
+
|
|
32
|
+
Run without installing globally:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npx gifvid --help
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Install globally:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npm install -g gifvid
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
With pnpm:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pnpm dlx gifvid --help
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Quick Start
|
|
51
|
+
|
|
52
|
+
Inspect a source:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npx gifvid inspect "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Make a Slack-sized GIF from a URL:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npx gifvid make "https://www.youtube.com/watch?v=dQw4w9WgXcQ" \
|
|
62
|
+
--start 0:42 \
|
|
63
|
+
--duration 4 \
|
|
64
|
+
--preset slack
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Make a GIF from a local file with a hard size budget:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
npx gifvid make ./clip.mp4 \
|
|
71
|
+
--start 1:03 \
|
|
72
|
+
--end 1:07 \
|
|
73
|
+
--preset web \
|
|
74
|
+
--max-bytes 3mb
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Generate GIF, MP4, and WebM plus a manifest:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
npx gifvid make ./clip.mp4 \
|
|
81
|
+
--start 1:03 \
|
|
82
|
+
--duration 4 \
|
|
83
|
+
--preset slack \
|
|
84
|
+
--format all
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
If a URL host requires a real browser session, let `yt-dlp` read local cookies:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
npx gifvid make "https://www.youtube.com/watch?v=..." \
|
|
91
|
+
--browser chrome \
|
|
92
|
+
--start 0:15 \
|
|
93
|
+
--duration 3
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Commands
|
|
97
|
+
|
|
98
|
+
### `gifvid inspect <input>`
|
|
99
|
+
|
|
100
|
+
Shows source metadata and rough preset estimates.
|
|
101
|
+
|
|
102
|
+
Useful flags:
|
|
103
|
+
|
|
104
|
+
- `--browser <profile>` for URL sources that need browser cookies
|
|
105
|
+
- `--json` for structured output
|
|
106
|
+
|
|
107
|
+
### `gifvid make <input>`
|
|
108
|
+
|
|
109
|
+
Generates a clip asset from a URL or local media file.
|
|
110
|
+
|
|
111
|
+
Required:
|
|
112
|
+
|
|
113
|
+
- `--start <time>`
|
|
114
|
+
|
|
115
|
+
Choose one:
|
|
116
|
+
|
|
117
|
+
- `--end <time>`
|
|
118
|
+
- `--duration <time>`
|
|
119
|
+
|
|
120
|
+
Optional:
|
|
121
|
+
|
|
122
|
+
- `--preset <slack|web|tiny|hq>`
|
|
123
|
+
- `--format <gif|mp4|webm|all>`
|
|
124
|
+
- `--width <pixels>`
|
|
125
|
+
- `--fps <frames>`
|
|
126
|
+
- `--colors <count>`
|
|
127
|
+
- `--max-bytes <value>`
|
|
128
|
+
- `--browser <profile>`
|
|
129
|
+
- `--output-dir <path>`
|
|
130
|
+
- `--name <basename>`
|
|
131
|
+
- `--publish`
|
|
132
|
+
- `--json`
|
|
133
|
+
|
|
134
|
+
Every `make` run writes a sidecar manifest:
|
|
135
|
+
|
|
136
|
+
```text
|
|
137
|
+
<basename>.manifest.json
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
When `--format all` is used, the command emits:
|
|
141
|
+
|
|
142
|
+
- `<basename>.gif`
|
|
143
|
+
- `<basename>.mp4`
|
|
144
|
+
- `<basename>.webm`
|
|
145
|
+
- `<basename>.manifest.json`
|
|
146
|
+
|
|
147
|
+
### `gifvid publish <file>`
|
|
148
|
+
|
|
149
|
+
Uploads an existing asset to Cloudflare R2.
|
|
150
|
+
|
|
151
|
+
Optional:
|
|
152
|
+
|
|
153
|
+
- `--key <bucket/key.gif>`
|
|
154
|
+
- `--json`
|
|
155
|
+
|
|
156
|
+
## Cloudflare R2
|
|
157
|
+
|
|
158
|
+
Publishing is optional and env-driven.
|
|
159
|
+
|
|
160
|
+
Required env vars:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
GIFVID_R2_ACCOUNT_ID=...
|
|
164
|
+
GIFVID_R2_ACCESS_KEY_ID=...
|
|
165
|
+
GIFVID_R2_SECRET_ACCESS_KEY=...
|
|
166
|
+
GIFVID_R2_BUCKET=...
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Optional:
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
GIFVID_R2_PUBLIC_BASE_URL=https://cdn.example.com/
|
|
173
|
+
GIFVID_R2_KEY_PREFIX=gifs
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
If `GIFVID_R2_PUBLIC_BASE_URL` is set, `gifvid` returns a shareable public URL after upload.
|
|
177
|
+
|
|
178
|
+
## Presets
|
|
179
|
+
|
|
180
|
+
- `tiny`: low-friction reaction GIFs
|
|
181
|
+
- `slack`: default preset for chat usage
|
|
182
|
+
- `web`: bigger embed-friendly GIFs
|
|
183
|
+
- `hq`: highest-quality GIF master before you need a tighter byte budget
|
|
184
|
+
|
|
185
|
+
Each preset defines:
|
|
186
|
+
|
|
187
|
+
- a default clip length
|
|
188
|
+
- a max clip length
|
|
189
|
+
- a starting width, fps, and color count
|
|
190
|
+
- a default byte target
|
|
191
|
+
|
|
192
|
+
If the first GIF render is too large, `gifvid` iterates downward on palette, fps, and width until it lands under budget or returns the smallest viable result.
|
|
193
|
+
|
|
194
|
+
## Notes
|
|
195
|
+
|
|
196
|
+
- URL reliability is only as good as the local `yt-dlp` setup and the target site's defenses.
|
|
197
|
+
- GIF is the compatibility format. MP4 and WebM are often the better output.
|
|
198
|
+
- You are responsible for respecting source platform terms and any copyright or licensing constraints.
|
|
199
|
+
|
|
200
|
+
## Repository
|
|
201
|
+
|
|
202
|
+
Source, docs, and the public site live at:
|
|
203
|
+
|
|
204
|
+
[github.com/danielgwilson/gifvid](https://github.com/danielgwilson/gifvid)
|
|
205
|
+
|
|
206
|
+
If you are working from the repo itself instead of the published package, the workspace root exposes:
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
pnpm cli make ...
|
|
210
|
+
```
|
package/dist/cli.d.ts
ADDED
package/dist/cli.js
ADDED
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { rm } from 'node:fs/promises';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { Command, InvalidArgumentError } from 'commander';
|
|
5
|
+
import { writeRenderManifest } from './core/manifest.js';
|
|
6
|
+
import { estimateGifBytes, getPreset, listPresets } from './core/presets.js';
|
|
7
|
+
import { publishFileToR2 } from './core/publish.js';
|
|
8
|
+
import { renderGifFromClip, renderMp4FromClip, renderWebmFromClip } from './core/media.js';
|
|
9
|
+
import { acquireClip, inspectInput, isUrlInput } from './core/source.js';
|
|
10
|
+
import { assertRequiredTools } from './core/tools.js';
|
|
11
|
+
import { ensureDir, slugify } from './utils/files.js';
|
|
12
|
+
import { formatBytes, formatRatio, parseByteInput } from './utils/format.js';
|
|
13
|
+
import { formatClock, formatFileTimestamp, parseTimeInput } from './utils/time.js';
|
|
14
|
+
const PRESET_IDS = new Set(['slack', 'web', 'tiny', 'hq']);
|
|
15
|
+
const OUTPUT_FORMATS = new Set(['gif', 'mp4', 'webm', 'all']);
|
|
16
|
+
const BROWSER_IDS = new Set([
|
|
17
|
+
'brave',
|
|
18
|
+
'chrome',
|
|
19
|
+
'chromium',
|
|
20
|
+
'edge',
|
|
21
|
+
'firefox',
|
|
22
|
+
'safari',
|
|
23
|
+
]);
|
|
24
|
+
const program = new Command();
|
|
25
|
+
program
|
|
26
|
+
.name('gifvid')
|
|
27
|
+
.description('Local-first CLI for turning URLs and local media into size-constrained GIFs.')
|
|
28
|
+
.version(process.env.npm_package_version ?? '0.1.0')
|
|
29
|
+
.showHelpAfterError();
|
|
30
|
+
program
|
|
31
|
+
.command('inspect')
|
|
32
|
+
.description('Inspect a URL or local media file and show rough GIF size estimates.')
|
|
33
|
+
.argument('<input>', 'URL or local file path')
|
|
34
|
+
.option('--browser <profile>', 'load cookies from a local browser for URL inputs', parseBrowserOption)
|
|
35
|
+
.option('--json', 'emit JSON output')
|
|
36
|
+
.action(async (input, options) => {
|
|
37
|
+
const toolNames = isUrlInput(input) ? ['ytDlp'] : ['ffprobe'];
|
|
38
|
+
await assertRequiredTools(toolNames);
|
|
39
|
+
const source = await inspectInput(input, { browser: options.browser });
|
|
40
|
+
const result = buildInspectResult(source);
|
|
41
|
+
if (options.json) {
|
|
42
|
+
console.log(JSON.stringify(result, null, 2));
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
printInspectResult(result);
|
|
46
|
+
});
|
|
47
|
+
program
|
|
48
|
+
.command('make')
|
|
49
|
+
.description('Generate a GIF from a URL or local media file.')
|
|
50
|
+
.argument('<input>', 'URL or local file path')
|
|
51
|
+
.requiredOption('--start <time>', 'clip start time, e.g. 12, 1:23, or 1m23s', parseTimeOption)
|
|
52
|
+
.option('--end <time>', 'clip end time', parseTimeOption)
|
|
53
|
+
.option('--duration <time>', 'clip duration if end is omitted', parseTimeOption)
|
|
54
|
+
.option('--preset <id>', 'render preset: slack, web, tiny, hq', parsePresetOption, 'slack')
|
|
55
|
+
.option('--format <type>', 'output format: gif, mp4, webm, all', parseOutputFormatOption, 'gif')
|
|
56
|
+
.option('--width <pixels>', 'override output width', parseIntegerOption)
|
|
57
|
+
.option('--fps <frames>', 'override output fps', parseIntegerOption)
|
|
58
|
+
.option('--colors <count>', 'override palette size', parseIntegerOption)
|
|
59
|
+
.option('--max-bytes <value>', 'target max output size, e.g. 3mb', parseByteOption)
|
|
60
|
+
.option('--browser <profile>', 'load cookies from a local browser for URL inputs', parseBrowserOption)
|
|
61
|
+
.option('--output-dir <path>', 'directory for final GIF output', 'outputs')
|
|
62
|
+
.option('--name <basename>', 'custom output name, without extension')
|
|
63
|
+
.option('--publish', 'upload the finished asset to Cloudflare R2 using env vars')
|
|
64
|
+
.option('--json', 'emit JSON output')
|
|
65
|
+
.action(async (input, options) => {
|
|
66
|
+
const toolNames = isUrlInput(input)
|
|
67
|
+
? ['ytDlp', 'ffmpeg', 'ffprobe']
|
|
68
|
+
: ['ffmpeg', 'ffprobe'];
|
|
69
|
+
await assertRequiredTools(toolNames);
|
|
70
|
+
const source = await inspectInput(input, { browser: options.browser });
|
|
71
|
+
const clipWindow = resolveClipWindow(source, {
|
|
72
|
+
startSeconds: options.start,
|
|
73
|
+
endSeconds: options.end,
|
|
74
|
+
durationSeconds: options.duration,
|
|
75
|
+
presetId: options.preset,
|
|
76
|
+
});
|
|
77
|
+
const preset = getPreset(options.preset);
|
|
78
|
+
const profile = {
|
|
79
|
+
width: options.width ?? preset.defaultProfile.width,
|
|
80
|
+
fps: options.fps ?? preset.defaultProfile.fps,
|
|
81
|
+
colors: options.colors ?? preset.defaultProfile.colors,
|
|
82
|
+
targetBytes: options.maxBytes ?? preset.defaultProfile.targetBytes,
|
|
83
|
+
};
|
|
84
|
+
const outputPaths = buildOutputPaths({
|
|
85
|
+
outputDir: options.outputDir,
|
|
86
|
+
outputName: options.name,
|
|
87
|
+
source,
|
|
88
|
+
clipWindow,
|
|
89
|
+
});
|
|
90
|
+
const clip = await acquireClip({
|
|
91
|
+
source,
|
|
92
|
+
clipWindow,
|
|
93
|
+
browser: options.browser,
|
|
94
|
+
});
|
|
95
|
+
try {
|
|
96
|
+
const assets = await renderAssets({
|
|
97
|
+
clipPath: clip.clipPath,
|
|
98
|
+
outputPaths,
|
|
99
|
+
profile,
|
|
100
|
+
requestedFormat: options.format,
|
|
101
|
+
});
|
|
102
|
+
const result = {
|
|
103
|
+
createdAt: new Date().toISOString(),
|
|
104
|
+
source,
|
|
105
|
+
clipWindow,
|
|
106
|
+
preset: options.preset,
|
|
107
|
+
requestedFormat: options.format,
|
|
108
|
+
renderProfile: profile,
|
|
109
|
+
assets,
|
|
110
|
+
manifestPath: outputPaths.manifest,
|
|
111
|
+
};
|
|
112
|
+
await maybePublishAssets(result, Boolean(options.publish));
|
|
113
|
+
await writeRenderManifest(result.manifestPath, result);
|
|
114
|
+
if (options.publish) {
|
|
115
|
+
const publishResult = await publishFileToR2({ filePath: result.manifestPath });
|
|
116
|
+
result.manifestPublishedUrl = publishResult.publicUrl;
|
|
117
|
+
await writeRenderManifest(result.manifestPath, result);
|
|
118
|
+
await publishFileToR2({
|
|
119
|
+
filePath: result.manifestPath,
|
|
120
|
+
key: publishResult.key,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
if (options.json) {
|
|
124
|
+
console.log(JSON.stringify(result, null, 2));
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
printMakeResult(result);
|
|
128
|
+
}
|
|
129
|
+
finally {
|
|
130
|
+
await rm(clip.tempDir, { recursive: true, force: true });
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
program
|
|
134
|
+
.command('publish')
|
|
135
|
+
.description('Upload an existing asset to Cloudflare R2.')
|
|
136
|
+
.argument('<file>', 'path to an existing GIF or video file')
|
|
137
|
+
.option('--key <key>', 'custom destination key inside the bucket')
|
|
138
|
+
.option('--json', 'emit JSON output')
|
|
139
|
+
.action(async (filePath, options) => {
|
|
140
|
+
const result = await publishFileToR2({ filePath, key: options.key });
|
|
141
|
+
if (options.json) {
|
|
142
|
+
console.log(JSON.stringify(result, null, 2));
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
console.log(`Uploaded ${filePath}`);
|
|
146
|
+
console.log(`Bucket: ${result.bucket}`);
|
|
147
|
+
console.log(`Key: ${result.key}`);
|
|
148
|
+
if (result.publicUrl) {
|
|
149
|
+
console.log(`Public URL: ${result.publicUrl}`);
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
console.log('Public URL: not configured (set GIFVID_R2_PUBLIC_BASE_URL to get a shareable URL)');
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
program.parseAsync().catch((error) => {
|
|
156
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
157
|
+
console.error(message);
|
|
158
|
+
process.exitCode = 1;
|
|
159
|
+
});
|
|
160
|
+
function parseTimeOption(value) {
|
|
161
|
+
try {
|
|
162
|
+
return parseTimeInput(value);
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
throw new InvalidArgumentError(error instanceof Error ? error.message : String(error));
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
function parseByteOption(value) {
|
|
169
|
+
try {
|
|
170
|
+
return parseByteInput(value);
|
|
171
|
+
}
|
|
172
|
+
catch (error) {
|
|
173
|
+
throw new InvalidArgumentError(error instanceof Error ? error.message : String(error));
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
function parseIntegerOption(value) {
|
|
177
|
+
const parsed = Number.parseInt(value, 10);
|
|
178
|
+
if (!Number.isFinite(parsed) || parsed <= 0) {
|
|
179
|
+
throw new InvalidArgumentError(`Expected a positive integer, received "${value}"`);
|
|
180
|
+
}
|
|
181
|
+
return parsed;
|
|
182
|
+
}
|
|
183
|
+
function parsePresetOption(value) {
|
|
184
|
+
if (!PRESET_IDS.has(value)) {
|
|
185
|
+
throw new InvalidArgumentError(`Unsupported preset "${value}"`);
|
|
186
|
+
}
|
|
187
|
+
return value;
|
|
188
|
+
}
|
|
189
|
+
function parseOutputFormatOption(value) {
|
|
190
|
+
if (!OUTPUT_FORMATS.has(value)) {
|
|
191
|
+
throw new InvalidArgumentError(`Unsupported output format "${value}"`);
|
|
192
|
+
}
|
|
193
|
+
return value;
|
|
194
|
+
}
|
|
195
|
+
function parseBrowserOption(value) {
|
|
196
|
+
if (!BROWSER_IDS.has(value)) {
|
|
197
|
+
throw new InvalidArgumentError(`Unsupported browser profile "${value}"`);
|
|
198
|
+
}
|
|
199
|
+
return value;
|
|
200
|
+
}
|
|
201
|
+
function resolveClipWindow(source, input) {
|
|
202
|
+
const preset = getPreset(input.presetId);
|
|
203
|
+
if (input.endSeconds !== undefined && input.durationSeconds !== undefined) {
|
|
204
|
+
throw new Error('Use either --end or --duration, not both.');
|
|
205
|
+
}
|
|
206
|
+
const startSeconds = input.startSeconds;
|
|
207
|
+
const endSeconds = input.endSeconds ??
|
|
208
|
+
(input.durationSeconds !== undefined
|
|
209
|
+
? startSeconds + input.durationSeconds
|
|
210
|
+
: startSeconds + preset.defaultDurationSeconds);
|
|
211
|
+
const durationSeconds = endSeconds - startSeconds;
|
|
212
|
+
if (durationSeconds <= 0) {
|
|
213
|
+
throw new Error('Clip duration must be greater than 0 seconds.');
|
|
214
|
+
}
|
|
215
|
+
if (durationSeconds > preset.maxDurationSeconds) {
|
|
216
|
+
throw new Error(`Preset "${preset.id}" supports up to ${preset.maxDurationSeconds} seconds. Requested ${durationSeconds.toFixed(2)} seconds.`);
|
|
217
|
+
}
|
|
218
|
+
if (endSeconds > source.durationSeconds) {
|
|
219
|
+
throw new Error(`Clip end ${formatClock(endSeconds)} exceeds source duration ${formatClock(source.durationSeconds)}.`);
|
|
220
|
+
}
|
|
221
|
+
return {
|
|
222
|
+
startSeconds,
|
|
223
|
+
endSeconds,
|
|
224
|
+
durationSeconds,
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
function buildInspectResult(source) {
|
|
228
|
+
const aspectWidth = source.width ?? 16;
|
|
229
|
+
const aspectHeight = source.height ?? 9;
|
|
230
|
+
const durationSeconds = Math.min(source.durationSeconds, 6);
|
|
231
|
+
return {
|
|
232
|
+
source,
|
|
233
|
+
recommendedWindowSeconds: durationSeconds,
|
|
234
|
+
presetEstimates: listPresets().map((preset) => {
|
|
235
|
+
const estimatedHeight = Math.max(1, Math.round((preset.defaultProfile.width * aspectHeight) / aspectWidth));
|
|
236
|
+
return {
|
|
237
|
+
preset: preset.id,
|
|
238
|
+
profile: preset.defaultProfile,
|
|
239
|
+
estimatedBytes: estimateGifBytes({
|
|
240
|
+
durationSeconds: Math.min(durationSeconds, preset.defaultDurationSeconds),
|
|
241
|
+
width: preset.defaultProfile.width,
|
|
242
|
+
height: estimatedHeight,
|
|
243
|
+
fps: preset.defaultProfile.fps,
|
|
244
|
+
colors: preset.defaultProfile.colors,
|
|
245
|
+
}),
|
|
246
|
+
};
|
|
247
|
+
}),
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
function buildOutputPaths(input) {
|
|
251
|
+
const baseName = input.outputName ??
|
|
252
|
+
`${slugify(input.source.title)}-${formatFileTimestamp(input.clipWindow.startSeconds)}-${formatFileTimestamp(input.clipWindow.endSeconds)}`;
|
|
253
|
+
const basePath = path.resolve(input.outputDir, baseName);
|
|
254
|
+
return {
|
|
255
|
+
gif: `${basePath}.gif`,
|
|
256
|
+
mp4: `${basePath}.mp4`,
|
|
257
|
+
webm: `${basePath}.webm`,
|
|
258
|
+
manifest: `${basePath}.manifest.json`,
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
function printInspectResult(result) {
|
|
262
|
+
console.log(`Title: ${result.source.title}`);
|
|
263
|
+
console.log(`Kind: ${result.source.kind}`);
|
|
264
|
+
console.log(`Duration: ${formatClock(result.source.durationSeconds)}`);
|
|
265
|
+
const ratio = formatRatio(result.source.width, result.source.height);
|
|
266
|
+
if (ratio) {
|
|
267
|
+
console.log(`Dimensions: ${ratio}`);
|
|
268
|
+
}
|
|
269
|
+
if (result.source.uploader) {
|
|
270
|
+
console.log(`Uploader: ${result.source.uploader}`);
|
|
271
|
+
}
|
|
272
|
+
if (result.source.sourceUrl) {
|
|
273
|
+
console.log(`Source URL: ${result.source.sourceUrl}`);
|
|
274
|
+
}
|
|
275
|
+
console.log(`Suggested clip length: ${result.recommendedWindowSeconds}s`);
|
|
276
|
+
console.log('');
|
|
277
|
+
console.log('Preset estimates:');
|
|
278
|
+
for (const estimate of result.presetEstimates) {
|
|
279
|
+
const profile = estimate.profile;
|
|
280
|
+
console.log(`- ${estimate.preset}: ${profile.width}px @ ${profile.fps}fps, ${profile.colors} colors, rough size ${formatBytes(estimate.estimatedBytes)}`);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
function printMakeResult(result) {
|
|
284
|
+
const primaryAsset = result.assets[0];
|
|
285
|
+
console.log(`Created ${primaryAsset?.path ?? result.manifestPath}`);
|
|
286
|
+
console.log(`Source: ${result.source.title}`);
|
|
287
|
+
console.log(`Clip: ${formatClock(result.clipWindow.startSeconds)} -> ${formatClock(result.clipWindow.endSeconds)} (${result.clipWindow.durationSeconds.toFixed(2)}s)`);
|
|
288
|
+
for (const asset of result.assets) {
|
|
289
|
+
const ratio = asset.width && asset.height ? `${asset.width}x${asset.height}` : 'n/a';
|
|
290
|
+
console.log(`Asset (${asset.format}): ${ratio}, ${formatBytes(asset.bytes)} -> ${asset.path}`);
|
|
291
|
+
if (asset.format === 'gif' && asset.iterations?.length) {
|
|
292
|
+
console.log(`Compression attempts (${asset.format}): ${asset.iterations.length}`);
|
|
293
|
+
const winningIteration = asset.iterations.find((iteration) => iteration.bytes === asset.bytes);
|
|
294
|
+
if (winningIteration?.targetBytes) {
|
|
295
|
+
console.log(`Target budget (${asset.format}): ${formatBytes(winningIteration.targetBytes)}`);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
console.log(`Manifest: ${result.manifestPath}`);
|
|
300
|
+
for (const asset of result.assets) {
|
|
301
|
+
if (asset.publishedUrl) {
|
|
302
|
+
console.log(`Published URL (${asset.format}): ${asset.publishedUrl}`);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
if (result.manifestPublishedUrl) {
|
|
306
|
+
console.log(`Published URL (manifest): ${result.manifestPublishedUrl}`);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
async function renderAssets(input) {
|
|
310
|
+
await ensureDir(path.dirname(input.outputPaths.manifest));
|
|
311
|
+
const formats = requestedAssetFormats(input.requestedFormat);
|
|
312
|
+
const assets = [];
|
|
313
|
+
for (const format of formats) {
|
|
314
|
+
if (format === 'gif') {
|
|
315
|
+
const render = await renderGifFromClip({
|
|
316
|
+
clipPath: input.clipPath,
|
|
317
|
+
finalOutputPath: input.outputPaths.gif,
|
|
318
|
+
profile: input.profile,
|
|
319
|
+
});
|
|
320
|
+
assets.push({
|
|
321
|
+
format,
|
|
322
|
+
path: input.outputPaths.gif,
|
|
323
|
+
bytes: render.bytes,
|
|
324
|
+
width: render.width,
|
|
325
|
+
height: render.height,
|
|
326
|
+
iterations: render.iterations,
|
|
327
|
+
targetBytes: input.profile.targetBytes,
|
|
328
|
+
});
|
|
329
|
+
continue;
|
|
330
|
+
}
|
|
331
|
+
if (format === 'mp4') {
|
|
332
|
+
const render = await renderMp4FromClip({
|
|
333
|
+
clipPath: input.clipPath,
|
|
334
|
+
finalOutputPath: input.outputPaths.mp4,
|
|
335
|
+
profile: input.profile,
|
|
336
|
+
});
|
|
337
|
+
assets.push({
|
|
338
|
+
format,
|
|
339
|
+
path: input.outputPaths.mp4,
|
|
340
|
+
bytes: render.bytes,
|
|
341
|
+
width: render.width,
|
|
342
|
+
height: render.height,
|
|
343
|
+
});
|
|
344
|
+
continue;
|
|
345
|
+
}
|
|
346
|
+
const render = await renderWebmFromClip({
|
|
347
|
+
clipPath: input.clipPath,
|
|
348
|
+
finalOutputPath: input.outputPaths.webm,
|
|
349
|
+
profile: input.profile,
|
|
350
|
+
});
|
|
351
|
+
assets.push({
|
|
352
|
+
format,
|
|
353
|
+
path: input.outputPaths.webm,
|
|
354
|
+
bytes: render.bytes,
|
|
355
|
+
width: render.width,
|
|
356
|
+
height: render.height,
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
return assets;
|
|
360
|
+
}
|
|
361
|
+
function requestedAssetFormats(requestedFormat) {
|
|
362
|
+
if (requestedFormat === 'all') {
|
|
363
|
+
return ['gif', 'mp4', 'webm'];
|
|
364
|
+
}
|
|
365
|
+
return [requestedFormat];
|
|
366
|
+
}
|
|
367
|
+
async function maybePublishAssets(result, shouldPublish) {
|
|
368
|
+
if (!shouldPublish) {
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
for (const asset of result.assets) {
|
|
372
|
+
const publishResult = await publishFileToR2({ filePath: asset.path });
|
|
373
|
+
asset.publishedUrl = publishResult.publicUrl;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAA;AACrC,OAAO,IAAI,MAAM,WAAW,CAAA;AAE5B,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AAEzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAC1F,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,WAAW,EA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