Skip to content

Add utility to find the start of a capture - #1054

Open
JoeyLemur wants to merge 4 commits into
happycube:mainfrom
JoeyLemur:codex/ld-find-start
Open

Add utility to find the start of a capture#1054
JoeyLemur wants to merge 4 commits into
happycube:mainfrom
JoeyLemur:codex/ld-find-start

Conversation

@JoeyLemur

@JoeyLemur JoeyLemur commented Jul 29, 2026

Copy link
Copy Markdown

Description

Adds ld-find-start, a CLI that scans an RF capture for sustained, advancing CAV/CLV VBI frame numbers and outputs a validated ld-decode --start N argument for the preceding clean pre-roll. It includes guarded handling for uncertain VBI-less captures, packaging integration, and unit tests.

Motivation

Rather than repeated guessing of where the start of the disc content is and reading through ld-decode errors, I wanted a command to automatically find the start.

Related Issues

This works under v7.2.1, but not under main 8af0932 -- see issue #1053

Changes Made

Added the ld-find-start command-line tool.

  • Detects sustained sequential CAV/CLV VBI frame-address runs.
  • Replays preceding fields to retain clean pre-roll before programme content.
  • Reports uncertain VBI-less candidates without emitting an automatic --start.
  • Added package entry-point integration and focused unit tests.

Testing

  • python3 -m pytest -q — 25 passed.
  • python3 -m pytest -q tests/test_start_finder.py — 12 passed.
  • python3 -m isort --check-only and python3 -m py_compile for the new code.
  • Manual CLI smoke tests: python3 ld-find-start --help and python3 -m lddecode.start_finder --version.

The unit tests cover CAV/CLV detection, rejected non-sequential addresses, decoder failures, clean pre-roll recovery, guarded fallback behavior, and CLI exit/output behavior.

@JoeyLemur JoeyLemur closed this Jul 29, 2026
@JoeyLemur
JoeyLemur deleted the codex/ld-find-start branch July 29, 2026 18:07
@JoeyLemur
JoeyLemur restored the codex/ld-find-start branch July 29, 2026 18:07
@JoeyLemur JoeyLemur reopened this Jul 29, 2026
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