@tongue-core/sdk 0.1.0-rc.6 → 0.1.0-rc.7
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/dist/project.js +7 -3
- package/dist/render/inputs.js +2 -1
- package/dist/render/stills.js +1 -1
- package/dist/render/worker.js +1 -1
- package/package.json +8 -8
package/dist/project.js
CHANGED
|
@@ -132,9 +132,13 @@ export const openFilm = Effect.fn("openFilm")(function* (path, options = {}) {
|
|
|
132
132
|
* entry, else its source path under the root. */
|
|
133
133
|
export const videoInputs = (film) => {
|
|
134
134
|
const out = {};
|
|
135
|
-
for (const asset of film.assets)
|
|
136
|
-
if (asset.kind
|
|
137
|
-
|
|
135
|
+
for (const asset of film.assets) {
|
|
136
|
+
if (asset.kind !== "video")
|
|
137
|
+
continue;
|
|
138
|
+
// Own keys only: a video called "constructor" mustn't find Object's.
|
|
139
|
+
const given = film.sources && Object.hasOwn(film.sources, asset.name) ? film.sources[asset.name] : undefined;
|
|
140
|
+
out[asset.name] = given ?? resolve(film.project.root, asset.source);
|
|
141
|
+
}
|
|
138
142
|
return out;
|
|
139
143
|
};
|
|
140
144
|
/** What a film's outputs are called: the project's folder (or the module's file) name, and the
|
package/dist/render/inputs.js
CHANGED
|
@@ -18,8 +18,9 @@ export const checkVideoInputs = Effect.fn("checkVideoInputs")(function* (film) {
|
|
|
18
18
|
return inputs;
|
|
19
19
|
const listed = missing.map((m) => `"${m.name}" at ${m.path}`).join(", ");
|
|
20
20
|
const example = missing.map((m) => `"${m.name}": "/path/to/${m.name}.mp4"`).join(", ");
|
|
21
|
+
const flags = missing.map((m) => `--source ${m.name}=/path/to/${m.name}.mp4`).join(" ");
|
|
21
22
|
return yield* new AssetFailure({
|
|
22
23
|
asset: missing.map((m) => `video:${m.name}`).join(", "),
|
|
23
|
-
message: `A render decodes each video from its original file, and ${missing.length === 1 ? `video ${listed} isn't there` : `these aren't there: ${listed}`}. Put ${missing.length === 1 ? "it" : "them"} there, or say where ${missing.length === 1 ? "it is" : "they are"}
|
|
24
|
+
message: `A render decodes each video from its original file, and ${missing.length === 1 ? `video ${listed} isn't there` : `these aren't there: ${listed}`}. Put ${missing.length === 1 ? "it" : "them"} there, or say where ${missing.length === 1 ? "it is" : "they are"}: openFilm's sources option ({ ${example} }), or ${flags} with the tongue command.`,
|
|
24
25
|
});
|
|
25
26
|
});
|
package/dist/render/stills.js
CHANGED
|
@@ -16,7 +16,7 @@ export function videoFramesFor(film, assets, ffmpeg) {
|
|
|
16
16
|
const inputs = videoInputs(film);
|
|
17
17
|
return new FfmpegVideoFrames(ffmpeg, (asset) => {
|
|
18
18
|
const info = assets.videos.get(asset.name)?.info;
|
|
19
|
-
const path = inputs[asset.name];
|
|
19
|
+
const path = Object.hasOwn(inputs, asset.name) ? inputs[asset.name] : undefined;
|
|
20
20
|
return info && path !== undefined ? { path, info } : null;
|
|
21
21
|
});
|
|
22
22
|
}
|
package/dist/render/worker.js
CHANGED
|
@@ -32,7 +32,7 @@ try {
|
|
|
32
32
|
const renderer = await FilmRenderer.create(plan, loaded, backend);
|
|
33
33
|
const video = new FfmpegVideoFrames(job.ffmpeg, (asset) => {
|
|
34
34
|
const info = loaded.videos.get(asset.name)?.info;
|
|
35
|
-
const path = job.videos[asset.name];
|
|
35
|
+
const path = Object.hasOwn(job.videos, asset.name) ? job.videos[asset.name] : undefined;
|
|
36
36
|
return info && path !== undefined ? { path, info } : null;
|
|
37
37
|
});
|
|
38
38
|
const spec = encoderSpec(job.encoder, job.settings, plan.fps);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tongue-core/sdk",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.7",
|
|
4
4
|
"description": "Everything you do with a Tongue film, as a library: start a project from a template, build it into film.json, import, plan, check, render frames and video. Built with Effect.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,15 +36,15 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@effect/platform-bun": "4.0.6",
|
|
38
38
|
"@effect/platform-node-shared": "4.0.6",
|
|
39
|
-
"@tongue-core/engine": "0.1.0-rc.
|
|
40
|
-
"@tongue-core/film": "0.1.0-rc.
|
|
41
|
-
"@tongue-core/project": "0.1.0-rc.
|
|
42
|
-
"@tongue-core/studio": "0.1.0-rc.
|
|
43
|
-
"@tongue-core/templates": "0.1.0-rc.
|
|
44
|
-
"@tongue-core/ui": "0.1.0-rc.
|
|
39
|
+
"@tongue-core/engine": "0.1.0-rc.7",
|
|
40
|
+
"@tongue-core/film": "0.1.0-rc.7",
|
|
41
|
+
"@tongue-core/project": "0.1.0-rc.7",
|
|
42
|
+
"@tongue-core/studio": "0.1.0-rc.7",
|
|
43
|
+
"@tongue-core/templates": "0.1.0-rc.7",
|
|
44
|
+
"@tongue-core/ui": "0.1.0-rc.7"
|
|
45
45
|
},
|
|
46
46
|
"optionalDependencies": {
|
|
47
|
-
"@tongue-core/raster-linux-x64": "0.1.0-rc.
|
|
47
|
+
"@tongue-core/raster-linux-x64": "0.1.0-rc.7"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"effect": "^4.0.6"
|