@gentbajko/slopify 4.4.0 → 4.5.1
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/edge/http/projects.js +7 -3
- package/dist/extension/slopify-studio-chrome.zip +0 -0
- package/dist/extension/slopify-studio-firefox.zip +0 -0
- package/dist/main.js +12 -3
- package/dist/patch-notes/4.5.0.md +20 -0
- package/dist/patch-notes/4.5.1.md +11 -0
- package/dist/patch-notes/index.json +12 -0
- package/dist/slices/admission/schema.js +3 -1
- package/dist/slices/rebuild/activity.js +37 -4
- package/dist/slices/rebuild/recipe-edit.js +8 -1
- package/dist/slices/rebuild/runtime-export.js +4 -3
- package/dist/slices/video/edit-settings.js +17 -0
- package/dist/slices/video/encoder-probe.js +124 -0
- package/dist/slices/video/encoding.js +143 -91
- package/dist/slices/video/ffmpeg.js +4 -2
- package/dist/slices/video/slideshow.js +32 -8
- package/dist/tutorials/Create-Video-and-Style.md +13 -0
- package/dist/tutorials/Settings-Reference.md +2 -0
- package/dist/tutorials/Video-Editing.md +4 -0
- package/dist/web/assets/index-C0n0zeuZ.js +460 -0
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/dist/web/assets/index-CA_I2trg.js +0 -460
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { constants, setPriority } from "node:os";
|
|
2
2
|
import { errorText } from "../../kernel/errors.js";
|
|
3
3
|
import { bt709Tags } from "./colour.js";
|
|
4
|
+
import { videoCodecLabels } from "./edit-settings.js";
|
|
4
5
|
import { lookEncoding } from "./look.js";
|
|
5
6
|
// Settings → Production defaults → Rendering: how this computer encodes a video's picture.
|
|
6
7
|
// They change how a video is made, never what it is, so no recipe fingerprint carries them and
|
|
7
|
-
// a render reads them once as it starts (`renderMachine`).
|
|
8
|
+
// a render reads them once as it starts (`renderMachine`). The finished video's codec is the
|
|
9
|
+
// project's (`edit-settings.ts`), and combines with them here.
|
|
8
10
|
export const videoEncoders = ["cpu", "nvidia"];
|
|
9
11
|
export const clipEncodeSpeeds = ["thorough", "fast"];
|
|
10
12
|
export const renderPriorities = ["normal", "background"];
|
|
@@ -24,20 +26,39 @@ const intermediateCrf = "16";
|
|
|
24
26
|
// size CRF 23 does, where NVENC scores about 2.5 VMAF below x264 (no NVENC setting tried closed
|
|
25
27
|
// that gap at that size).
|
|
26
28
|
export const nvencQuality = { intermediate: 20, final: 28.5 };
|
|
29
|
+
// measured on a real 3-minute stretch of a 1080p30 video, slow pan and zoom over dense
|
|
30
|
+
// engraving, each scoring about 94.4 VMAF against the H.264 file x264 makes today: SVT-AV1 at
|
|
31
|
+
// preset 6, CRF 36 is about 29% of its size at about 7x real time on 32 threads; av1_nvenc at
|
|
32
|
+
// CQ 34 about 44%; hevc_nvenc at CQ 27 about 59%. x265 at CRF 26 (preset medium) is not
|
|
33
|
+
// measured yet: a starting point expected to land near the same quality.
|
|
34
|
+
export const codecQuality = {
|
|
35
|
+
svtav1Preset: 6,
|
|
36
|
+
svtav1Crf: 36,
|
|
37
|
+
av1Nvenc: 34,
|
|
38
|
+
hevcNvenc: 27,
|
|
39
|
+
x265Crf: 26,
|
|
40
|
+
};
|
|
27
41
|
// measured on the first 24 shots of a real project, each still shown once (11.5 minutes, 32
|
|
28
42
|
// threads, changelog.d/2026-11-13-one-encode.md): clips that draw their own captions took
|
|
29
43
|
// 83 s at x264's default preset and 69 s at `faster`, for 1.2 VMAF less. That is the step
|
|
30
44
|
// Fast already was for clips encoded twice (118 s against 145 s, 0.7 VMAF less). `veryfast`
|
|
31
45
|
// cost 4.3 VMAF.
|
|
32
46
|
const captionedFastPreset = "faster";
|
|
47
|
+
// x264's own keyframe interval, so every clip, whatever its codec, opens on its one keyframe as
|
|
48
|
+
// x264's do and the clips still join by copying.
|
|
49
|
+
const keyframes = ["-g", "250"];
|
|
50
|
+
// HEVC in MP4 tagged hvc1 rather than hev1, which Apple's players and some browsers refuse.
|
|
51
|
+
const hvc1 = ["-tag:v", "hvc1"];
|
|
33
52
|
// `final` is a picture someone watches (a clip joined by copying, a burned-in part, the join);
|
|
34
|
-
// `intermediate` is a clip decoded again under burned-in captions
|
|
35
|
-
// draws its own captions, watched
|
|
53
|
+
// `intermediate` is a clip decoded again under burned-in captions, never watched, so it stays
|
|
54
|
+
// H.264 whatever the video's codec; `captioned` is a clip that draws its own captions, watched
|
|
55
|
+
// as it is.
|
|
36
56
|
export function codecArgs(encode, role, look) {
|
|
37
|
-
if (encode.kind === "nvenc")
|
|
57
|
+
if (encode.kind === "nvenc") {
|
|
58
|
+
const codec = role === "intermediate" ? undefined : encode.codec;
|
|
38
59
|
return [
|
|
39
60
|
"-c:v",
|
|
40
|
-
"
|
|
61
|
+
`${codec ?? "h264"}_nvenc`,
|
|
41
62
|
// The slowest, best preset, constant quality with no bitrate cap. No `-multipass`: measured,
|
|
42
63
|
// a second full-resolution pass gave no better picture for its size on these videos.
|
|
43
64
|
"-preset",
|
|
@@ -47,17 +68,51 @@ export function codecArgs(encode, role, look) {
|
|
|
47
68
|
"-rc",
|
|
48
69
|
"vbr",
|
|
49
70
|
"-cq",
|
|
50
|
-
String(
|
|
71
|
+
String(codec === "hevc"
|
|
72
|
+
? codecQuality.hevcNvenc
|
|
73
|
+
: codec === "av1"
|
|
74
|
+
? codecQuality.av1Nvenc
|
|
75
|
+
: nvencQuality[role === "intermediate" ? "intermediate" : "final"]),
|
|
51
76
|
"-b:v",
|
|
52
77
|
"0",
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"-g",
|
|
56
|
-
"250",
|
|
78
|
+
...keyframes,
|
|
79
|
+
...(codec === "hevc" ? hvc1 : []),
|
|
57
80
|
"-pix_fmt",
|
|
58
81
|
"yuv420p",
|
|
59
82
|
...bt709Tags,
|
|
60
83
|
];
|
|
84
|
+
}
|
|
85
|
+
if (encode.kind === "x265" || encode.kind === "svtav1") {
|
|
86
|
+
if (role === "intermediate")
|
|
87
|
+
return codecArgs({ kind: "x264", clipSpeed: encode.clipSpeed }, role, look);
|
|
88
|
+
const common = ["-pix_fmt", "yuv420p", ...bt709Tags];
|
|
89
|
+
return encode.kind === "x265"
|
|
90
|
+
? [
|
|
91
|
+
"-c:v",
|
|
92
|
+
"libx265",
|
|
93
|
+
...common,
|
|
94
|
+
...lookEncoding(look),
|
|
95
|
+
"-preset",
|
|
96
|
+
"medium",
|
|
97
|
+
"-crf",
|
|
98
|
+
String(codecQuality.x265Crf),
|
|
99
|
+
...keyframes,
|
|
100
|
+
...hvc1,
|
|
101
|
+
// x265 reports every frame's statistics on stderr otherwise.
|
|
102
|
+
"-x265-params",
|
|
103
|
+
"log-level=error",
|
|
104
|
+
]
|
|
105
|
+
: [
|
|
106
|
+
"-c:v",
|
|
107
|
+
"libsvtav1",
|
|
108
|
+
...common,
|
|
109
|
+
"-preset",
|
|
110
|
+
String(codecQuality.svtav1Preset),
|
|
111
|
+
"-crf",
|
|
112
|
+
String(codecQuality.svtav1Crf),
|
|
113
|
+
...keyframes,
|
|
114
|
+
];
|
|
115
|
+
}
|
|
61
116
|
const fast = encode.clipSpeed === "fast";
|
|
62
117
|
return [
|
|
63
118
|
"-c:v",
|
|
@@ -73,103 +128,100 @@ export function codecArgs(encode, role, look) {
|
|
|
73
128
|
: []),
|
|
74
129
|
];
|
|
75
130
|
}
|
|
131
|
+
// What the join adds when it copies the clips: copying keeps the codec but not its MP4 tag.
|
|
132
|
+
export function copyTag(encode) {
|
|
133
|
+
return encode.kind === "x265" || (encode.kind === "nvenc" && encode.codec === "hevc") ? hvc1 : [];
|
|
134
|
+
}
|
|
135
|
+
// The ffmpeg that encodes the picture: the computer's own for NVENC and SVT-AV1, else the
|
|
136
|
+
// bundled one.
|
|
137
|
+
export function encoderBin(encode, bundled) {
|
|
138
|
+
return encode.kind === "nvenc" || encode.kind === "svtav1" ? encode.bin : bundled;
|
|
139
|
+
}
|
|
76
140
|
// Said to a person who may have no NVIDIA card at all: stock ffmpeg builds list the NVIDIA
|
|
77
141
|
// encoder everywhere, so a failed test usually means there is no card, not a broken one. What
|
|
78
142
|
// the test printed goes under Details (`detail`), never into these sentences.
|
|
79
143
|
export const noNvenc = "No NVIDIA graphics card was found on this computer.";
|
|
80
|
-
export const
|
|
144
|
+
export const noSvtAv1 = "No ffmpeg with SVT-AV1 (libsvtav1) was found on this computer.";
|
|
81
145
|
// The reason with the test's output, for the log and a run's notice.
|
|
82
146
|
export function nvencWhy(status) {
|
|
83
147
|
return status.detail === undefined ? status.reason : `${status.reason} (${status.detail})`;
|
|
84
148
|
}
|
|
85
|
-
// The
|
|
86
|
-
//
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
"-loglevel",
|
|
91
|
-
"error",
|
|
92
|
-
"-f",
|
|
93
|
-
"lavfi",
|
|
94
|
-
"-i",
|
|
95
|
-
"color=c=black:s=256x256:r=30:d=0.1",
|
|
96
|
-
"-frames:v",
|
|
97
|
-
"1",
|
|
98
|
-
...codecArgs({ kind: "nvenc", bin: "", clipSpeed: "thorough" }, "final", undefined),
|
|
99
|
-
"-f",
|
|
100
|
-
"null",
|
|
101
|
-
"-",
|
|
102
|
-
];
|
|
103
|
-
// The filters a render runs in the NVENC ffmpeg besides the encoder.
|
|
104
|
-
const neededFilters = ["zoompan", "perspective", "fillborders", "xfade", "ass"];
|
|
105
|
-
// Which ffmpeg can encode on an NVIDIA card, asked once and remembered until Slopify restarts.
|
|
106
|
-
// The bundled ffmpeg first, then the computer's own: unlike everything else, NVENC is the
|
|
107
|
-
// computer's (its driver and its ffmpeg), and only used when chosen in Settings.
|
|
108
|
-
export function createNvencProbe(deps) {
|
|
109
|
-
let answer;
|
|
110
|
-
return () => {
|
|
111
|
-
answer ??= probe(deps).catch((error) => ({
|
|
112
|
-
available: false,
|
|
113
|
-
reason: noNvenc,
|
|
114
|
-
detail: errorText(error),
|
|
115
|
-
}));
|
|
116
|
-
return answer;
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
async function probe(deps) {
|
|
120
|
-
let failed;
|
|
121
|
-
for (const bin of new Set(deps.candidates)) {
|
|
122
|
-
const encoders = await deps.exec(bin, ["-hide_banner", "-encoders"]).catch(() => "");
|
|
123
|
-
if (!/^\s*V\S*\s+h264_nvenc\s/m.test(encoders))
|
|
124
|
-
continue;
|
|
125
|
-
const filters = await deps.exec(bin, ["-hide_banner", "-filters"]).catch(() => "");
|
|
126
|
-
const missing = neededFilters.filter((name) => !new RegExp(`^\\s*\\S+\\s+${name}\\s`, "m").test(filters));
|
|
127
|
-
if (missing.length > 0) {
|
|
128
|
-
failed = `the ffmpeg at ${bin} has NVENC but not the ${missing.join(", ")} filter a video needs`;
|
|
129
|
-
continue;
|
|
130
|
-
}
|
|
131
|
-
try {
|
|
132
|
-
await deps.exec(bin, testArgs);
|
|
133
|
-
deps.log.write("info", "video.encoder", { detail: `NVENC works through ${bin}` });
|
|
134
|
-
return { available: true, bin };
|
|
135
|
-
}
|
|
136
|
-
catch (error) {
|
|
137
|
-
failed = `the ffmpeg at ${bin} lists NVENC but its test encode failed: ${errorText(error)}`;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
if (failed !== undefined) {
|
|
141
|
-
deps.log.write("info", "video.encoder", { detail: failed });
|
|
142
|
-
return { available: false, reason: failedNvenc, detail: failed };
|
|
143
|
-
}
|
|
144
|
-
return { available: false, reason: noNvenc };
|
|
145
|
-
}
|
|
146
|
-
// The render's machine settings, read as it starts. A card chosen but not working is a notice,
|
|
147
|
-
// never a failed render: the processor encodes it instead.
|
|
149
|
+
// The render's machine settings, read as it starts. Automatic is AV1 on the NVIDIA card
|
|
150
|
+
// whenever the card can encode it, whatever the Video encoder says, with today's H.264 as its
|
|
151
|
+
// `fallback`; without such a card it is today's H.264 render, said nowhere, since that is the
|
|
152
|
+
// ordinary way. An explicit encoder or codec chosen but not working is a notice, never a
|
|
153
|
+
// failed render: the processor encodes it instead, or H.264 does.
|
|
148
154
|
export async function renderMachine(deps) {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
155
|
+
if (deps.codec !== "auto")
|
|
156
|
+
return chosenMachine({ ...deps, codec: deps.codec ?? "h264" });
|
|
157
|
+
const today = await chosenMachine({ ...deps, codec: "h264" });
|
|
158
|
+
const card = await deps.nvenc();
|
|
159
|
+
if (!card.available)
|
|
160
|
+
return today;
|
|
161
|
+
const av1 = await deps.nvenc("av1");
|
|
162
|
+
if (!av1.available)
|
|
163
|
+
return today;
|
|
164
|
+
return {
|
|
165
|
+
machine: {
|
|
166
|
+
encode: {
|
|
167
|
+
kind: "nvenc",
|
|
168
|
+
bin: av1.bin,
|
|
169
|
+
clipSpeed: deps.settings.clipEncodeSpeed,
|
|
170
|
+
codec: "av1",
|
|
159
171
|
},
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
172
|
+
priority: deps.settings.renderPriority,
|
|
173
|
+
fallback: today.machine.encode,
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
async function chosenMachine(deps) {
|
|
178
|
+
const { settings, codec } = deps;
|
|
179
|
+
const clipSpeed = settings.clipEncodeSpeed;
|
|
180
|
+
const warn = (detail) => deps.log.write("warn", "video.encoder", { projectId: deps.projectId, detail });
|
|
181
|
+
const done = (chosen) => ({
|
|
182
|
+
machine: { encode: chosen.encode, priority: settings.renderPriority },
|
|
183
|
+
...(chosen.notices.length === 0 ? {} : { notice: chosen.notices.join(" ") }),
|
|
164
184
|
});
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
185
|
+
const cpu = async () => {
|
|
186
|
+
if (codec === "h264")
|
|
187
|
+
return { encode: { kind: "x264", clipSpeed }, notices: [] };
|
|
188
|
+
if (codec === "hevc")
|
|
189
|
+
return { encode: { kind: "x265", clipSpeed }, notices: [] };
|
|
190
|
+
const svt = (await deps.svtav1?.()) ?? { available: false, reason: noSvtAv1 };
|
|
191
|
+
if (svt.available)
|
|
192
|
+
return { encode: { kind: "svtav1", bin: svt.bin, clipSpeed }, notices: [] };
|
|
193
|
+
warn(`AV1 chosen but SVT-AV1 is unavailable; encoding H.264. ${nvencWhy(svt)}`);
|
|
194
|
+
return { encode: { kind: "x264", clipSpeed }, notices: [svtav1FallbackNotice(nvencWhy(svt))] };
|
|
168
195
|
};
|
|
196
|
+
if (settings.videoEncoder !== "nvidia")
|
|
197
|
+
return done(await cpu());
|
|
198
|
+
const card = await deps.nvenc();
|
|
199
|
+
if (!card.available) {
|
|
200
|
+
warn(`NVIDIA encoder chosen but unavailable; encoding on the processor. ${nvencWhy(card)}`);
|
|
201
|
+
const chosen = await cpu();
|
|
202
|
+
return done({
|
|
203
|
+
encode: chosen.encode,
|
|
204
|
+
notices: [nvencFallbackNotice(nvencWhy(card)), ...chosen.notices],
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
const h264 = { kind: "nvenc", bin: card.bin, clipSpeed };
|
|
208
|
+
if (codec === "h264")
|
|
209
|
+
return done({ encode: h264, notices: [] });
|
|
210
|
+
const own = await deps.nvenc(codec);
|
|
211
|
+
if (own.available)
|
|
212
|
+
return done({ encode: { ...h264, bin: own.bin, codec }, notices: [] });
|
|
213
|
+
warn(`${videoCodecLabels[codec]} on the NVIDIA card is unavailable; encoding H.264 on it.`);
|
|
214
|
+
return done({ encode: h264, notices: [cardCodecNotice(codec, nvencWhy(own))] });
|
|
169
215
|
}
|
|
170
216
|
export function nvencFallbackNotice(reason) {
|
|
171
217
|
return `This video was encoded on the processor because the NVIDIA graphics card encoder didn't work (${reason.replace(/\.$/, "")}). Check the NVIDIA driver, or choose Processor (x264) in Settings → Production defaults → Video encoder.`;
|
|
172
218
|
}
|
|
219
|
+
export function svtav1FallbackNotice(reason) {
|
|
220
|
+
return `This video was encoded as H.264 instead of AV1 because AV1 on the processor needs an ffmpeg with SVT-AV1 (${reason.replace(/\.$/, "")}). Install an ffmpeg built with SVT-AV1 and restart Slopify, or choose H.264 or HEVC under Video codec in the project's Video settings.`;
|
|
221
|
+
}
|
|
222
|
+
function cardCodecNotice(codec, reason) {
|
|
223
|
+
return `This video was encoded as H.264 on the NVIDIA graphics card because it couldn't encode ${videoCodecLabels[codec]} (${reason.replace(/\.$/, "")}). Choose H.264${codec === "av1" ? " or HEVC" : ""} under Video codec in the project's Video settings, or Processor in Settings → Production defaults → Video encoder.`;
|
|
224
|
+
}
|
|
173
225
|
// Background renders run below normal priority: nice 10 on Linux and macOS, the below-normal
|
|
174
226
|
// class on Windows. Threads ffmpeg starts afterwards inherit it. Advisory: a system that
|
|
175
227
|
// refuses is logged and the render carries on.
|
|
@@ -3,7 +3,7 @@ import { isAbsolute, resolve as resolvePath } from "node:path";
|
|
|
3
3
|
import { errorText, internalError } from "../../kernel/errors.js";
|
|
4
4
|
import { bedChains, bedInputs } from "./ambient-mix.js";
|
|
5
5
|
import { bt709Frames, bt709Scale } from "./colour.js";
|
|
6
|
-
import { codecArgs, defaultEncode, setRenderPriority, } from "./encoding.js";
|
|
6
|
+
import { codecArgs, copyTag, defaultEncode, setRenderPriority, } from "./encoding.js";
|
|
7
7
|
import { gradeFilter, lookChain, placed } from "./look.js";
|
|
8
8
|
import { moveOf } from "./move.js";
|
|
9
9
|
import { decimal } from "./plan.js";
|
|
@@ -295,7 +295,9 @@ export function joinArgs(edit, output, list, burnSubtitles = false, portraits =
|
|
|
295
295
|
"-map",
|
|
296
296
|
burnSubtitles ? "[v]" : "0:v",
|
|
297
297
|
...(audio ? ["-map", sound === undefined ? "[a]" : "1:a"] : []),
|
|
298
|
-
...(burnSubtitles
|
|
298
|
+
...(burnSubtitles
|
|
299
|
+
? codecArgs(encode, "final", edit.look)
|
|
300
|
+
: ["-c:v", "copy", ...copyTag(encode)]),
|
|
299
301
|
...(audio ? ["-c:a", sound === undefined ? "aac" : "copy"] : ["-an"]),
|
|
300
302
|
"-movflags",
|
|
301
303
|
"+faststart",
|
|
@@ -5,7 +5,7 @@ import { masterFile, masterReport } from "../loudness/loudnorm.js";
|
|
|
5
5
|
import { cardsAss } from "./cards.js";
|
|
6
6
|
import { cacheKey, contentIdentity, fileIdentity, keepClip, pruneClips, reuseClip, } from "./clip-cache.js";
|
|
7
7
|
import { captionedClips, drawsOwnCaptions, readCaptions, } from "./clip-captions.js";
|
|
8
|
-
import { defaultEncode, nvencFallbackNotice, } from "./encoding.js";
|
|
8
|
+
import { defaultEncode, encoderBin, nvencFallbackNotice, svtav1FallbackNotice, } from "./encoding.js";
|
|
9
9
|
import { audioMixArgs, burnPartArgs, concatList, joinArgs, runFfmpeg, segmentArgs, slideshowClips, } from "./ffmpeg.js";
|
|
10
10
|
import { cardsIn } from "./look.js";
|
|
11
11
|
import { inPool, renderJobs } from "./pool.js";
|
|
@@ -20,11 +20,30 @@ const captionFonts = "caption-fonts";
|
|
|
20
20
|
const leastPartFrames = 60 * 30;
|
|
21
21
|
// The sound the join plays, as the join itself brings every segment to it.
|
|
22
22
|
const masterFormat = { sampleRate: 44100, channels: 2 };
|
|
23
|
-
// What the master measured, when the run asked for one. A render
|
|
24
|
-
// for any reason but a cancel is made again on the
|
|
23
|
+
// What the master measured, when the run asked for one. A render in the computer's own ffmpeg
|
|
24
|
+
// (the NVIDIA card, SVT-AV1) that fails for any reason but a cancel is made again on the
|
|
25
|
+
// processor with the bundled one: neither ever fails a render. The card's HEVC falls back to
|
|
26
|
+
// x265; its AV1, like SVT-AV1's, to H.264, since the processor's AV1 needs that same ffmpeg.
|
|
25
27
|
export async function renderSlideshow(run) {
|
|
26
28
|
const encode = run.machine?.encode ?? defaultEncode;
|
|
27
|
-
|
|
29
|
+
const fallback = run.machine?.fallback;
|
|
30
|
+
// Automatic's card AV1: today's H.264 render takes over, without a notice, which keeps its
|
|
31
|
+
// own way of recovering from a card that fails.
|
|
32
|
+
if (fallback !== undefined && run.machine !== undefined) {
|
|
33
|
+
try {
|
|
34
|
+
return await renderWith(run, encode);
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
if (run.signal.aborted)
|
|
38
|
+
throw error;
|
|
39
|
+
run.log.write("warn", "video.encoder", {
|
|
40
|
+
detail: `the automatic AV1 render on the card failed; rendering H.264 as before: ${errorText(error)}`,
|
|
41
|
+
});
|
|
42
|
+
const { fallback: _used, ...machine } = run.machine;
|
|
43
|
+
return renderSlideshow({ ...run, machine: { ...machine, encode: fallback } });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (encode.kind !== "nvenc" && encode.kind !== "svtav1")
|
|
28
47
|
return renderWith(run, encode);
|
|
29
48
|
try {
|
|
30
49
|
return await renderWith(run, encode);
|
|
@@ -33,18 +52,23 @@ export async function renderSlideshow(run) {
|
|
|
33
52
|
if (run.signal.aborted)
|
|
34
53
|
throw error;
|
|
35
54
|
const detail = errorText(error);
|
|
55
|
+
const card = encode.kind === "nvenc";
|
|
36
56
|
run.log.write("warn", "video.encoder", {
|
|
37
|
-
detail: `the NVENC render failed; rendering again on the processor: ${detail}`,
|
|
57
|
+
detail: `the ${card ? "NVENC" : "SVT-AV1"} render failed; rendering again on the processor: ${detail}`,
|
|
58
|
+
});
|
|
59
|
+
const why = `it stopped the render: ${detail}`;
|
|
60
|
+
run.notice?.(card ? nvencFallbackNotice(why) : svtav1FallbackNotice(why));
|
|
61
|
+
return renderWith(run, {
|
|
62
|
+
kind: card && encode.codec === "hevc" ? "x265" : "x264",
|
|
63
|
+
clipSpeed: encode.clipSpeed,
|
|
38
64
|
});
|
|
39
|
-
run.notice?.(nvencFallbackNotice(`it stopped the render: ${detail}`));
|
|
40
|
-
return renderWith(run, { kind: "x264", clipSpeed: encode.clipSpeed });
|
|
41
65
|
}
|
|
42
66
|
}
|
|
43
67
|
async function renderWith(run, encode) {
|
|
44
68
|
const { edit } = run;
|
|
45
69
|
const priority = run.machine?.priority;
|
|
46
70
|
// The ffmpeg that encodes the picture; copying, sound and probing stay with the bundled one.
|
|
47
|
-
const encoder = encode
|
|
71
|
+
const encoder = encoderBin(encode, run.bin);
|
|
48
72
|
const distinct = slideshowClips(edit);
|
|
49
73
|
// Captions are burned in one of two ways (`clip-captions.ts`): drawn by each clip's own run,
|
|
50
74
|
// or over the joined clips in a second encode.
|
|
@@ -63,6 +63,19 @@ After the run, you can fix a misheard word or nudge a caption's timing on the pr
|
|
|
63
63
|
|
|
64
64
|
Turning on **More images for long videos** in the Images row switches **Motion** from Zoom to **Mix of both**. See [Images](Create-Images#more-images-for-long-videos).
|
|
65
65
|
|
|
66
|
+
## Video codec
|
|
67
|
+
|
|
68
|
+
**Video codec** sits beside **Cuts** and decides the format of the finished video file. It is saved with the project or template.
|
|
69
|
+
|
|
70
|
+
| Choice | What it does |
|
|
71
|
+
| --- | --- |
|
|
72
|
+
| **Automatic (AV1 on the graphics card, else H.264)** | The default, and what a project without the setting gets. AV1 encoded on the NVIDIA card whenever the card can encode AV1 (RTX 40 series and newer), whatever **Video encoder** says in Settings: about 44% of the H.264 file for the same picture. Without such a card the video is H.264 exactly as before, made by the Video encoder you chose, and nothing is said about it. If the card's AV1 fails mid-render, the video is made again the old way. |
|
|
73
|
+
| **H.264** | Works everywhere: every player, browser and upload site. Always H.264, as every video was before, never AV1. |
|
|
74
|
+
| **HEVC** | About half to three fifths of the file for the same picture. On the processor it is x265, from Slopify's own ffmpeg; on an NVIDIA card, the card's HEVC encoder. |
|
|
75
|
+
| **AV1** | The smallest file: about 29% of the H.264 one on the processor, about 44% on an NVIDIA card, for the same picture (measured on a 1080p video). On the processor it needs an ffmpeg with SVT-AV1 on the computer (the `ffmpeg` on your `PATH` or `/usr/bin/ffmpeg`) and renders slower. |
|
|
76
|
+
|
|
77
|
+
For the explicit choices, whether the processor or the NVIDIA card encodes it is **Settings → Production defaults → Video encoder**. If AV1 is chosen and no ffmpeg with SVT-AV1 is found, or the card can't encode the chosen codec, the video is made as H.264 and its Video part says why; the video is never failed for it. Shorts and the style preview are always H.264. Choosing HEVC or AV1 makes only the video again; Automatic and H.264 leave a finished video current, and it comes out AV1 the next time it is made where the card allows.
|
|
78
|
+
|
|
66
79
|
## The Look
|
|
67
80
|
|
|
68
81
|
**Look** is a fold in the row. Folded, its line lists what is on (for example **Crossfade 2 s · Warm fantasy · Fog · Vignette**). Everything in it is drawn on this computer at no cost; only animated images are charged, by the image service.
|
|
@@ -121,6 +121,8 @@ The volume fields show only while the switch is on. A project keeps what it star
|
|
|
121
121
|
|
|
122
122
|
What they cost and give, measured on the first 24 images (11.5 minutes) of a real project with captions in the video, each image shown once (16-core processor, RTX 5080): **Thorough** took 83 seconds; **Fast** took 69, a sixth less, for a slightly softer picture (1.2 VMAF less) and a file a sixth smaller. **NVIDIA** took 42 seconds, half the waiting (the zoom and pan on each image still runs on the processor), but with a visibly softer picture than x264 (about 2.5 VMAF less at the same file size, measured in 4.0): pick it when the time matters more than the last bit of sharpness. In a video whose images come round again, Fast cut the waiting by a fifth as well (118 seconds against 145) for 0.7 VMAF less. **Background** makes no difference to the file at all.
|
|
123
123
|
|
|
124
|
+
A project's **Video codec** (in its Video settings) is **Automatic** unless set: AV1 on the NVIDIA card whenever the card can encode it, even with Processor chosen here, and otherwise H.264 through this setting exactly as before. Its explicit choices (H.264, HEVC or AV1) combine with the Video encoder: HEVC is x265 on the processor and the card's HEVC encoder on NVIDIA; AV1 is SVT-AV1 from the computer's own ffmpeg on the processor and the card's AV1 encoder on NVIDIA. Without an ffmpeg with SVT-AV1, or on a card that can't encode the codec, the video is made as H.264 and the project's Video part says so.
|
|
125
|
+
|
|
124
126
|
If the NVIDIA encoder is chosen but stops working (a driver update, the card busy elsewhere), the video is encoded on the processor instead, never failed, and the project's Video part says so, with the reason and where to change it. Slopify checks for the card once per start; restart Slopify after installing a driver or an ffmpeg with NVENC.
|
|
125
127
|
|
|
126
128
|
Agents read and change these with `get_settings` and `update_settings`, and check the card with `get_video_encoders`.
|
|
@@ -31,6 +31,10 @@ Motion takes turns so a long video stays watchable. Zoom goes in, out, in. Pan g
|
|
|
31
31
|
|
|
32
32
|
New projects default to **Follow the narration**. It needs word timing, so it works in English and the languages that have it; in other languages the picker is fixed to Every N seconds and a note says why. See [Other Languages](Other-Languages).
|
|
33
33
|
|
|
34
|
+
## Video codec
|
|
35
|
+
|
|
36
|
+
**Video codec** sits under Cuts: **Automatic (AV1 on the graphics card, else H.264)**, the default, or **H.264** (works everywhere), **HEVC** or **AV1**. Automatic encodes AV1 on an NVIDIA card that can (whatever the Video encoder setting says), and otherwise H.264 exactly as before, without a note. HEVC and AV1 make about half to a third of the file for the same picture; AV1 on the processor needs an ffmpeg with SVT-AV1 on the computer and renders slower. The explicit choices combine with **Settings → Production defaults → Video encoder**, and fall back to H.264 with a note in the Video part when the computer can't encode them. Choosing HEVC or AV1 outdates only the video; Automatic and H.264 outdate nothing. Shorts stay H.264. See [Video and style](Create-Video-and-Style#video-codec).
|
|
37
|
+
|
|
34
38
|
## The Look
|
|
35
39
|
|
|
36
40
|
**Look** is a folding row under Cuts. Its summary line lists what is on, or "Plain cuts, no effects".
|