Fix FFmpeg wanting to use JPEG files when rendering PNG

The preview video task would attempt to use JPEG preview files when the
"Preview" checkbox is checked, even when this checkbox is not shown in
Blender's UI (when the output format is not EXR). Blender still stores
this property, even when it's unused, and that's what tripped up the job
compiler.

The "Simple Blender Render" job type now first checks whether the previews
are necessary at all, and only then uses them.
This commit is contained in:
Sybren A. Stüvel 2022-11-10 14:10:03 +01:00
parent 1cef0d48df
commit 982dca0d4e

View File

@ -114,7 +114,8 @@ function authorRenderTasks(settings, renderDir, renderOutput) {
} }
function authorCreateVideoTask(settings, renderDir) { function authorCreateVideoTask(settings, renderDir) {
if (!settings.has_previews && ffmpegIncompatibleImageFormats.has(settings.format)) { const needsPreviews = ffmpegIncompatibleImageFormats.has(settings.format);
if (needsPreviews && !settings.has_previews) {
print("Not authoring video task, FFmpeg-incompatible render output") print("Not authoring video task, FFmpeg-incompatible render output")
return; return;
} }
@ -125,7 +126,7 @@ function authorCreateVideoTask(settings, renderDir) {
const stem = path.stem(settings.blendfile).replace('.flamenco', ''); const stem = path.stem(settings.blendfile).replace('.flamenco', '');
const outfile = path.join(renderDir, `${stem}-${settings.frames}.mp4`); const outfile = path.join(renderDir, `${stem}-${settings.frames}.mp4`);
const outfileExt = settings.has_previews ? ".jpg" : settings.image_file_extension; const outfileExt = needsPreviews ? ".jpg" : settings.image_file_extension;
const task = author.Task('preview-video', 'ffmpeg'); const task = author.Task('preview-video', 'ffmpeg');
const command = author.Command("frames-to-video", { const command = author.Command("frames-to-video", {