feat: export panel and Render menu, playback options, videos library (owner review 1 phase 5) (#27)
CI / Build and test (push) Successful in 9m41s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 9s
Release / Build, test and publish (push) Successful in 14m49s
CI / PostgreSQL 16 integration (push) Successful in 8m51s
CI / PostgreSQL 17 integration (push) Successful in 9m48s
CI / Docker image (push) Successful in 54s
Release / Server image (push) Successful in 1m39s
CI / Build and test (push) Successful in 9m41s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 9s
Release / Build, test and publish (push) Successful in 14m49s
CI / PostgreSQL 16 integration (push) Successful in 8m51s
CI / PostgreSQL 17 integration (push) Successful in 9m48s
CI / Docker image (push) Successful in 54s
Release / Server image (push) Successful in 1m39s
Owner review 1 R3, R8, R9. A grouped Export step and Render menu; encoding, playback (reverse, boomerang, loops, fades, hold) and still frames; one videos library on the desktop and the server with a verified trash and copies to a videos folder. Closes #21 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
This commit was merged in pull request #27.
This commit is contained in:
1 parent
188b2c2e55
commit
728ffa35cb
729 files changed
+26954
-1652
No files matched your search
@@ -44,6 +44,34 @@ public static class ProcessingJobs
|
||||
JsonSerializer.Serialize(parameters, ProtocolJson.Default.RenderJobParameters), JobPriority.User);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="JobKind.Render"/> of one frame saved as an image (owner review 1, R8, "Save frame"): frame
|
||||
/// <paramref name="frameIndex"/> of the sequence (its photo <paramref name="photoSha256"/> wins when both are given and the
|
||||
/// frames moved since) with <paramref name="codec"/>, one of <see cref="RenderRules.StillCodecs"/>, at the output size of
|
||||
/// <paramref name="export"/>, with every correction and no playback. <paramref name="project"/> embeds the settings to
|
||||
/// render, as <see cref="Render"/>. The job needs settings format <see cref="RenderRules.StillFormat"/>, so an older node,
|
||||
/// which would render the whole video, never claims it.
|
||||
/// </summary>
|
||||
/// <exception cref="ArgumentOutOfRangeException"><paramref name="codec"/> is not a still codec, or <paramref name="frameIndex"/> is negative.</exception>
|
||||
public static ArchiveJobRequest Still(Sequence sequence, ExportSettings export, VideoCodec codec, int frameIndex, string? photoSha256, int sourceWidth,
|
||||
int sourceHeight, ProjectSettings? project = null)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(sequence);
|
||||
ArgumentNullException.ThrowIfNull(export);
|
||||
if (!RenderRules.StillCodecs.Contains(codec)) throw new ArgumentOutOfRangeException(nameof(codec), codec, "Not a still codec.");
|
||||
ArgumentOutOfRangeException.ThrowIfNegative(frameIndex);
|
||||
var still = export with { Batch = [], Playback = null, Overrides = export.Overrides with { Codec = CodecName(codec), Container = null } };
|
||||
var parameters = Parameters(still, sourceWidth, sourceHeight, project?.ToJson(), false, project ?? ReadSettings(sequence.SettingsJson));
|
||||
parameters = parameters with
|
||||
{
|
||||
StillFrame = frameIndex,
|
||||
StillPhoto = string.IsNullOrEmpty(photoSha256) ? null : photoSha256.ToLowerInvariant(),
|
||||
RequiredSettingsFormat = int.Max(parameters.RequiredSettingsFormat, RenderRules.StillFormat),
|
||||
};
|
||||
return new ArchiveJobRequest(JobKind.Render, [sequence.Id], RenderLabel(sequence.DisplayTitle, parameters.PresetName),
|
||||
JsonSerializer.Serialize(parameters, ProtocolJson.Default.RenderJobParameters), JobPriority.User);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="JobKind.Render"/> of a project version (owner review 2, R8) on the sequence's home: the version's portable
|
||||
/// settings, placed on the sequence's frames by the render, with <paramref name="export"/> as their export section; the
|
||||
@@ -125,10 +153,19 @@ public static class ProcessingJobs
|
||||
{
|
||||
Width = width,
|
||||
Height = height,
|
||||
RequiredSettingsFormat = int.Max(parameters.RequiredSettingsFormat, RequiredFormat(settings, resolved, sourceWidth, sourceHeight)),
|
||||
// The job's own export (playback included) is what renders, not the export the settings carry; but a node parses
|
||||
// the settings text as it is, so never less than the format that text is written in.
|
||||
RequiredSettingsFormat = int.Max(parameters.RequiredSettingsFormat, int.Max(TextFormat(settings),
|
||||
RequiredFormat(settings with { Export = ReadExport(parameters.PresetJson) }, resolved, sourceWidth, sourceHeight))),
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The format of the settings text a node parses: the version it was read with, or the one <see cref="ProjectSettings.ToJson"/>
|
||||
/// writes for it. A node that reads less refuses that text, whatever export the job renders.
|
||||
/// </summary>
|
||||
private static int TextFormat(ProjectSettings settings) => int.Max(settings.Version, settings.WrittenFormat);
|
||||
|
||||
/// <summary>
|
||||
/// The settings format a render of <paramref name="settings"/> with <paramref name="export"/> and each of its batch
|
||||
/// presets needs (the highest <see cref="RenderRules.RequiredFormat"/> of them): what a server or a render node must read
|
||||
@@ -138,8 +175,8 @@ public static class ProcessingJobs
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(settings);
|
||||
ArgumentNullException.ThrowIfNull(export);
|
||||
return BatchPresets(export).Select(id => ExportResolver.Resolve(BatchExport(export, id))).Prepend(ExportResolver.Resolve(export))
|
||||
.Max(resolved => RequiredFormat(settings, resolved, sourceWidth, sourceHeight));
|
||||
return BatchPresets(export).Select(id => BatchExport(export, id)).Prepend(export)
|
||||
.Max(each => RequiredFormat(settings with { Export = each }, ExportResolver.Resolve(each), sourceWidth, sourceHeight));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -182,9 +219,12 @@ public static class ProcessingJobs
|
||||
.Where(id => !id.Equals(main, StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
|
||||
/// <summary>A batch preset rendered with its own values, named and placed like the export it belongs to.</summary>
|
||||
/// <summary>
|
||||
/// A batch preset rendered with its own values, named, placed and played like the export it belongs to: its playback
|
||||
/// (owner review 1, R8: direction, loops, fades, hold) lives in the export, so every batch preset inherits it.
|
||||
/// </summary>
|
||||
internal static ExportSettings BatchExport(ExportSettings export, string presetId) =>
|
||||
new() { Preset = new Auto<string>().WithManual(presetId), NameTemplate = export.NameTemplate, Folder = export.Folder };
|
||||
new() { Preset = new Auto<string>().WithManual(presetId), NameTemplate = export.NameTemplate, Folder = export.Folder, Playback = export.Playback };
|
||||
|
||||
/// <param name="settings">The settings rendered, for the output size and the format (else read from <paramref name="settingsJson"/>); unknown, the preset's size.</param>
|
||||
private static RenderJobParameters Parameters(ExportSettings export, int sourceWidth, int sourceHeight, string? settingsJson, bool useProxies,
|
||||
@@ -194,7 +234,11 @@ public static class ProcessingJobs
|
||||
settings ??= ReadSettings(settingsJson);
|
||||
var (width, height) = (settings is null ? null : Size(settings, resolved, sourceWidth, sourceHeight))
|
||||
?? (resolved.Width > 0 ? resolved.Width : sourceWidth, resolved.Height > 0 ? resolved.Height : sourceHeight);
|
||||
var format = settings is null ? ProjectSettings.BaseVersion : RequiredFormat(settings, resolved, sourceWidth, sourceHeight);
|
||||
// The format of what renders: the settings with this export in place of their own (its playback raises it to 3), and
|
||||
// never less than the format of the settings text the node parses.
|
||||
var format = settings is null
|
||||
? new ProjectSettings { Export = export }.RequiredFormat
|
||||
: int.Max(TextFormat(settings), RequiredFormat(settings with { Export = export }, resolved, sourceWidth, sourceHeight));
|
||||
return new RenderJobParameters(PresetName(resolved), JsonSerializer.Serialize(export, ProcessingJson.Default.ExportSettings), CodecName(resolved.Codec),
|
||||
width, height, useProxies, settingsJson, RequiredSettingsFormat: format);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user