diff --git a/i18n/en/Advisor.resx b/i18n/en/Advisor.resx index c76505d4..27db3d3f 100644 --- a/i18n/en/Advisor.resx +++ b/i18n/en/Advisor.resx @@ -97,6 +97,7 @@ Smoothing the camera path over {0} frames removes shake and keeps deliberate pans.{0} smoothing sigma in frames Strong flicker ({0} EV): every frame lands on the smooth curve.{0} RMS flicker in EV Mild flicker ({0} EV): reliable frames keep 20% of their own variation.{0} RMS flicker in EV + The camera's intervalometer shot this sequence, so its pauses were deliberate (gaps: {0}): adaptive timing keeps them short and the pace even.{0} gap count Intervals vary by {0} s around {1} s: adaptive timing follows the capture clock so motion stays even.{0} interval jitter in seconds; {1} median interval in seconds {0} gaps in the cadence: adaptive timing keeps the output pace true to capture time.{0} gap count Steady {0} s interval (jitter {1} s): each photo becomes one video frame.{0} median interval in seconds; {1} jitter in seconds diff --git a/i18n/it/Advisor.it.resx b/i18n/it/Advisor.it.resx index c199c431..88a10f18 100644 --- a/i18n/it/Advisor.it.resx +++ b/i18n/it/Advisor.it.resx @@ -97,6 +97,7 @@ Smussare il percorso della fotocamera su {0} fotogrammi elimina la vibrazione e conserva le panoramiche volute. Sfarfallio forte ({0} EV): ogni fotogramma viene portato sulla curva regolare. Sfarfallio lieve ({0} EV): i fotogrammi affidabili conservano il 20% della propria variazione. + La sequenza è stata scattata dall'intervallometro della fotocamera, quindi le pause sono volute (pause: {0}): la temporizzazione adattiva le accorcia e mantiene il ritmo. Gli intervalli variano di {0} s attorno a {1} s: la temporizzazione adattiva segue l'orario di scatto e rende il movimento uniforme. {0} pause nella cadenza: la temporizzazione adattiva mantiene il ritmo fedele all'orario di scatto. Intervallo costante di {0} s (variazione {1} s): ogni foto diventa un fotogramma del video. diff --git a/src/Titano.Core/Advice/Advisor.cs b/src/Titano.Core/Advice/Advisor.cs index 32217eb1..2f447b58 100644 --- a/src/Titano.Core/Advice/Advisor.cs +++ b/src/Titano.Core/Advice/Advisor.cs @@ -16,17 +16,32 @@ public static class Advisor { /// /// Recommendations for every parameter the rules cover (see ), in section order, plus - /// every finding of both analyses; a finding both report (frames that cannot be decoded: the light analysis reads - /// the flags the deep pass recorded) is listed once, as the light analysis has it. Without a deep report, - /// pixel-based parameters get missing-data recommendations. + /// every finding of both analyses. Frames that cannot be decoded are reported by both (the light analysis reads the + /// undecodable flags, the deep pass also counts missing and corrupt files and those beyond this host's decoders): + /// they are listed once, over the union of both lists, at the higher severity. Without a deep report, pixel-based + /// parameters get missing-data recommendations. /// public static AdvisorResult Recommend(LightAnalysisReport light, DeepAnalysisReport? deep, SequenceContext context) { ArgumentNullException.ThrowIfNull(light); ArgumentNullException.ThrowIfNull(context); var findings = new List(light.Findings); - var lightKeys = light.Findings.Select(f => f.Key).ToHashSet(StringComparer.Ordinal); - if (deep is not null) findings.AddRange(deep.Findings.Select(f => f.ToFinding()).Where(f => !lightKeys.Contains(f.Key))); + foreach (var finding in deep?.Findings.Select(f => f.ToFinding()) ?? []) + { + var shared = finding.Key == DeepFindingKeys.UnreadableFrames ? findings.FindIndex(f => f.Key == finding.Key) : -1; + if (shared < 0) + { + findings.Add(finding); + continue; + } + var unreadable = light.UndecodableFrames.Union(deep!.Issues.Undecodable).Order().ToList(); + findings[shared] = findings[shared] with + { + Severity = (FindingSeverity)int.Max((int)findings[shared].Severity, (int)finding.Severity), + Arguments = [unreadable.Count], + Frames = [.. unreadable.Take(Finding.MaxFrames)], + }; + } return new AdvisorResult(new AdvisorRules(light, deep, context).Run(), findings); } diff --git a/src/Titano.Core/Advice/AdvisorKeys.cs b/src/Titano.Core/Advice/AdvisorKeys.cs index 305a8bd5..8c3c89d8 100644 --- a/src/Titano.Core/Advice/AdvisorKeys.cs +++ b/src/Titano.Core/Advice/AdvisorKeys.cs @@ -19,6 +19,7 @@ public static class AdvisorKeys public static string TimingSessions { get; } = LocKey("Advisor.Reason.Timing.Sessions"); public static string TimingIrregular { get; } = LocKey("Advisor.Reason.Timing.Irregular"); + public static string TimingIntervalometer { get; } = LocKey("Advisor.Reason.Timing.Intervalometer"); public static string TimingSparseGapsSmooth { get; } = LocKey("Advisor.Reason.Timing.SparseGapsSmooth"); public static string TimingSparseGaps { get; } = LocKey("Advisor.Reason.Timing.SparseGaps"); public static string TimingManyGaps { get; } = LocKey("Advisor.Reason.Timing.ManyGaps"); diff --git a/src/Titano.Core/Advice/AdvisorRules.cs b/src/Titano.Core/Advice/AdvisorRules.cs index 00cef188..4a34dcbe 100644 --- a/src/Titano.Core/Advice/AdvisorRules.cs +++ b/src/Titano.Core/Advice/AdvisorRules.cs @@ -185,11 +185,13 @@ internal sealed class AdvisorRules /// /// Timing mode, in order: several capture sessions (pauses ≥ the session gap) → Adaptive; jitter above 10 % of the - /// median interval → Adaptive; gaps that are sparse (≤ 2 % of intervals, each ≤ 10 × median) with smooth measured - /// motion (95th percentile ≤ 1 % of the long edge per frame) → Interpolated, or Constant when motion is unknown or - /// fast; denser gaps → Adaptive; otherwise Constant. Frame rate, in order: "fit to N s" target → the standard rate - /// nearest frames/N; under 240 frames → 24 (clip ≥ 10 s); over 10 min at 30 fps → 60; several sessions → 30; fast - /// motion (≥ 1 % of the long edge per frame) → 24; measured moderate motion (≥ 0.2 %) → 24; otherwise 30. + /// median interval → Adaptive; gaps in a sequence the camera's own intervalometer shot (most frames carry its + /// MakerNote hint), so its pauses were deliberate → Adaptive; gaps that are sparse (≤ 2 % of intervals, each ≤ 10 × + /// median) with smooth measured motion (95th percentile ≤ 1 % of the long edge per frame) → Interpolated, or Constant + /// when motion is unknown or fast; denser gaps → Adaptive; otherwise Constant. Frame rate, in order: "fit to N s" + /// target → the standard rate nearest frames/N; under 240 frames → 24 (clip ≥ 10 s); over 10 min at 30 fps → 60; + /// several sessions → 30; fast motion (≥ 1 % of the long edge per frame) → 24; measured moderate motion (≥ 0.2 %) → + /// 24; otherwise 30. /// private void Timing() { @@ -222,6 +224,11 @@ internal sealed class AdvisorRules _timing = TimingMode.Adaptive; Add(section, parameter, _timing, 0.7, AdvisorKeys.TimingIrregular, R(jitter, 2), R(median, 2)); } + else if (gaps.Count > 0 && 2 * _light.IntervalometerFrames > _light.FrameCount) + { + _timing = TimingMode.Adaptive; + Add(section, parameter, _timing, 0.8, AdvisorKeys.TimingIntervalometer, gaps.Count); + } else if (gaps.Count > 0) { var sparse = gaps.Count <= double.Max(1, 0.02 * _light.Intervals.Count) && gaps.All(g => g.Seconds <= 10 * median); diff --git a/src/Titano.Core/Analysis/LightAnalysisReport.cs b/src/Titano.Core/Analysis/LightAnalysisReport.cs index 9e7fe647..fedd5360 100644 --- a/src/Titano.Core/Analysis/LightAnalysisReport.cs +++ b/src/Titano.Core/Analysis/LightAnalysisReport.cs @@ -137,5 +137,8 @@ public sealed record LightAnalysisReport /// Frames that nothing decodes (format tier 3): renders skip them. public IReadOnlyList UndecodableFrames { get; init; } = []; + /// Frames the camera's own interval-shooting mode took (MakerNote hint, ). + public int IntervalometerFrames { get; init; } + public IReadOnlyList Findings { get; init; } = []; } diff --git a/src/Titano.Core/Analysis/LightAnalyzer.cs b/src/Titano.Core/Analysis/LightAnalyzer.cs index aa1f0c1a..be8685d8 100644 --- a/src/Titano.Core/Analysis/LightAnalyzer.cs +++ b/src/Titano.Core/Analysis/LightAnalyzer.cs @@ -61,6 +61,7 @@ public static class LightAnalyzer DayPhases = phases, PreviewOnlyFrames = previewOnly, UndecodableFrames = undecodable, + IntervalometerFrames = frames.Count(f => (f.Flags & FrameFlags.Intervalometer) != 0), Findings = findings, }; } diff --git a/src/Titano.Core/Archiving/SequenceFrames.cs b/src/Titano.Core/Archiving/SequenceFrames.cs index 8f79a8de..5f72d16b 100644 --- a/src/Titano.Core/Archiving/SequenceFrames.cs +++ b/src/Titano.Core/Archiving/SequenceFrames.cs @@ -14,7 +14,7 @@ public static class SequenceFrames return byTime != 0 ? byTime : string.CompareOrdinal(a.File, b.File); }); - /// A frame record from light metadata. + /// A frame record from light metadata (with when the MakerNote says so). /// Path relative to the sequence folder. /// Used when the file records no capture time of its own (only a file-system date). public static SidecarFrame FromMetadata(Guid id, string file, string? original, long size, string? sha256, FrameMetadata metadata, @@ -45,6 +45,7 @@ public static class SequenceFrames PreviewLength = metadata.LargestPreview?.Length, PreviewW = Positive(metadata.LargestPreview?.Width), PreviewH = Positive(metadata.LargestPreview?.Height), + Flags = metadata.IntervalShooting == true ? FrameFlags.Intervalometer : FrameFlags.None, }; } diff --git a/src/Titano.Core/Model/Enums.cs b/src/Titano.Core/Model/Enums.cs index 2bb39f50..d6dcfd3c 100644 --- a/src/Titano.Core/Model/Enums.cs +++ b/src/Titano.Core/Model/Enums.cs @@ -24,6 +24,12 @@ public enum FrameFlags Undecodable = 32, Black = 64, White = 128, + + /// + /// The camera's own interval-shooting or time-lapse mode took the frame (MakerNote hint, BRIEF §9): a capture fact, + /// not a problem; its pauses were deliberate (§10.3 adaptive timing). + /// + Intervalometer = 256, } [Flags]