Skip to content

BT.709 "Always" with no crop or resize: keep the encode in subtitle-only jobs - #159

Draft
StuartCameronCode wants to merge 1 commit into
mainfrom
agentbob/8-bt-709-conversion-always-should-work-wit
Draft

StuartCameronCode wants to merge 1 commit into
mainfrom
agentbob/8-bt-709-conversion-always-should-work-wit

Conversation

@StuartCameronCode

Copy link
Copy Markdown
Owner

Forum feedback #154 / #155 (videohelp thread 419911) asked for a Rec.601 → Rec.709 conversion for analog SD sources, even without any other processing. Crop & Resize → Convert Colour to BT.709 → Always already converts with Cropping and Resize both off, provided the pass is on (choosing Always in the panel switches it on). The conversion itself needed no change.

The bug

The worker's enabled_passes() and the app's enabledPasses counted Crop & Resize only when it cropped or resized. The app decides subtitle-only mode from that list. So a job with subtitles on and a Crop & Resize that only converts colour (or only adds borders, or only does an integer upscale) skipped the encode, and the conversion was silently lost.

Change

  • enabled_passes() / enabledPasses list Crop & Resize whenever it is on. Its FrameMap is identity with radius 0, so frame counts, rate factors and preview windows are unchanged.
  • ProcessingPipeline.isSubtitleOnly is the one subtitle-only test, used for both the job and its output path. Before, the job read enabledPasses and the output path read videoPassCount, and the two had drifted apart.
  • When converting colour is all the pass does, its row in the pass list says "BT.709".
  • The option's description says Always needs no crop or resize. sinceAppVersion is unchanged, since the option shipped in 1.7.0.
  • CLAUDE.md gains a rule for this, and the README's pipeline table is updated.

Small behaviour change: a pass that is switched on but has no effect (Auto, SD output, every control off) also prevents subtitle-only mode now. A job like that is re-encoded rather than only transcribed. Nothing enabled is ever dropped silently, and the pass is off by default.

Tests

  • test_219, new:
    • An SD source with the pass's geometry off converts in both the encode and preview scripts.
    • The encoder is tagged BT.709 for matrix and transfer, and the source's primaries are kept.
    • No resize block is emitted.
    • Auto, Off and a switched-off pass emit no conversion.
  • New unit tests on both sides: the pass list, subtitle-only mode and the pass-row summary.
  • integration_filter_parameters_test.dart: the panel's route, where choosing Always switches the pass on and the script converts.
  • integration_bt709_conversion_test.dart (heavy), with no crop or resize:
    • Always converts at SD size, with every patch within 3 levels (0.64 measured).
    • The preview matches the encode.
    • Auto and Off are byte-identical to the source.

Results (macOS arm64):

  • cargo test passed, except the Whisper subtitle test, which needs an add-on the local checkout doesn't have.
  • flutter test --exclude-tags heavy,gpu: all 1467 tests passed.
  • integration_bt709_conversion_test.dart: all 8 tests passed.

🤖 Generated with Claude Code

…title-only mode

Crop & Resize's Convert Colour to BT.709 already converted with Cropping and
Resize both off, as long as the pass was on (choosing Always in the panel
switches it on). But the pass list only counted Crop & Resize when it cropped
or resized, and the app decides subtitle-only mode from that list: with
subtitles on and nothing else enabled, the job skipped the encode and the
conversion (or borders, or an integer upscale) was silently lost.

- enabled_passes / enabledPasses list Crop & Resize whenever it is on (its
  FrameMap is identity radius 0, so frame arithmetic is unchanged).
- ProcessingPipeline.isSubtitleOnly is the one test, used for both the job
  and its output path (they had drifted: enabledPasses vs videoPassCount).
- The pass row says "BT.709" when converting is all the pass does.
- The option's description says Always needs no crop or resize.

Tests: test_219 (both scripts, encoder tags, Auto/Off/switched-off), unit
tests both sides, the panel's route in integration_filter_parameters_test,
and three heavy tests: Always converts at SD size within 0.64 levels, preview
= encode (0.000), Auto and Off byte-identical to the source.

Forum feedback #154 / #155 (videohelp 419911).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant