BlyxDocumentation
Browse chapters
Documentation / Workflow recipes

Spoonbill · Detect overlapping captions in a rational time base

Preflight caption cue timings against an explicit overlap policy.

Detect overlapping captions in a rational time base

Two cues touching at one endpoint are consecutive; two cues occupying the same frame overlap. Apply a policy using exact tick boundaries. At 30 ticks per second the track spans two seconds. The second cue begins before the first one finishes.

Run the framework with your own input

Install Blyx 0.2.1 and a Rust toolchain with a host linker, then run the versioned project. Each positional argument is a number or a comma-separated numerical vector. The CLI accepts up to 16 entries per vector. The imported module accepts longer inputs.

git clone --depth 1 --branch v0.1.0 https://github.com/Rahulchaube1/blyx-spoonbill.git
cd blyx-spoonbill
blyxc native-run project.blyx -- "0,20" "30,60" 1 30 0

API and return values

Returns [accepted, overlapping cue count, first overlap index, cue-track span in seconds]. Some subtitle tracks allow overlaps; the caller chooses the policy. Invalid input returns an empty vector.

ArgumentAccepted input
startsVector of: nonnegative exact integer
endsVector of: nonnegative exact integer
numeratorpositive exact integer
denominatorpositive exact integer
allow_overlapnonnegative exact integer

Use the libraries independently

The framework vendors the same library source published in these two repositories. Each module has its own package page, input contract and regression suite.

Try the program

Output Ready
Expected output
0
1
1
2
Open in the full playground →

Practice

Change allow_overlap = 1.0. Predict the result, then run the program.

Hint

Returns [accepted, overlapping cue count, first overlap index, cue-track span in seconds]. Some subtitle tracks allow overlaps; the caller chooses the policy.

Worked solution

The result vector is [1, 1, 1, 2]. Compare its fields with the return layout in the API section.

Find

    let allow_overlap = 0.0;

Replace with

    let allow_overlap = 1.0;

Output after the change

1
1
1
2