feat(processing): selective render claims, analysis follow-ups, per-sequence failures
- JobEngine: ISelectiveJobHandler lets a host decline jobs of a kind it runs; declined jobs stay queued for other claimers without holding up the rest. JobContext.EnqueueFollowUpAsync queues follow-up work on the same engine. - Server renders the jobs whose every output a managed encoder produces (ManagedRenderJobHandler); MP4 jobs stay for render nodes. Program.cs registers ProcessingModule next to ArchiveModule. Server renders ignore a client's export folder. - Light analysis is queued after imports and after scans that indexed new sequences, so the advisor's Auto values exist without user action. - Analysis jobs log a failing sequence and go on; the job then fails and a retry analyses only the failed ones. The advised frame rate follows the user's fit-to duration. - ProcessingJobs.RenderEach splits a batch into one job per preset for servers; render nodes say which batch presets they did not render, fetch each content once and stop on a changed certificate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
30 files changed
+572
-85
No files matched your search
@@ -44,6 +44,32 @@ public static class ProcessingJobs
|
||||
JsonSerializer.Serialize(parameters, ProtocolJson.Default.RenderJobParameters), JobPriority.User);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// One <see cref="Render"/> job per preset of <paramref name="export"/>: its preset, then each batch preset with its
|
||||
/// own values. For a server: a render node uploads one file per job, so a batch must not travel as one job.
|
||||
/// </summary>
|
||||
public static IReadOnlyList<ArchiveJobRequest> RenderEach(Sequence sequence, ExportSettings export, int sourceWidth, int sourceHeight,
|
||||
ProjectSettings? project = null, bool useProxies = false)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(export);
|
||||
return
|
||||
[
|
||||
Render(sequence, export with { Batch = [] }, sourceWidth, sourceHeight, project, useProxies),
|
||||
.. BatchPresets(export).Select(id => Render(sequence, BatchExport(export, id), sourceWidth, sourceHeight, project, useProxies)),
|
||||
];
|
||||
}
|
||||
|
||||
/// <summary>The batch presets of an export besides its own, each once.</summary>
|
||||
internal static IEnumerable<string> BatchPresets(ExportSettings export)
|
||||
{
|
||||
var main = ExportResolver.Resolve(export).BasePresetId;
|
||||
return export.Batch.Distinct(StringComparer.OrdinalIgnoreCase).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>
|
||||
internal static ExportSettings BatchExport(ExportSettings export, string presetId) =>
|
||||
new() { Preset = new Auto<string>().WithManual(presetId), NameTemplate = export.NameTemplate, Folder = export.Folder };
|
||||
|
||||
/// <summary>Codec name in job parameters and render-node capabilities ("h264", "hevc", "mjpeg", "pngsequence"…).</summary>
|
||||
public static string CodecName(VideoCodec codec) => codec.ToString().ToLowerInvariant();
|
||||
|
||||
@@ -57,11 +83,20 @@ public static class ProcessingJobs
|
||||
/// <summary>The parameters of a render job and the export they select.</summary>
|
||||
/// <exception cref="InvalidDataException">The job has no valid render parameters.</exception>
|
||||
internal static (RenderJobParameters Parameters, ExportSettings Export) ReadRender(string? parametersJson)
|
||||
{
|
||||
var parameters = ReadParameters(parametersJson);
|
||||
return (parameters, ReadExport(parameters.PresetJson));
|
||||
}
|
||||
|
||||
/// <summary>The protocol record of a render job, without reading its export.</summary>
|
||||
/// <exception cref="InvalidDataException">The job has no valid render parameters.</exception>
|
||||
internal static RenderJobParameters ReadParameters(string? parametersJson)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (parametersJson is { Length: > 0 } && JsonSerializer.Deserialize(parametersJson, ProtocolJson.Default.RenderJobParameters) is { } parameters)
|
||||
return (parameters, ReadExport(parameters.PresetJson));
|
||||
if (parametersJson is { Length: > 0 } && JsonSerializer.Deserialize(parametersJson, ProtocolJson.Default.RenderJobParameters)
|
||||
is { PresetName.Length: > 0, PresetJson.Length: > 0, Codec.Length: > 0 } parameters)
|
||||
return parameters;
|
||||
}
|
||||
catch (JsonException ex)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user