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 0API 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.
| Argument | Accepted input |
|---|---|
| starts | Vector of: nonnegative exact integer |
| ends | Vector of: nonnegative exact integer |
| numerator | positive exact integer |
| denominator | positive exact integer |
| allow_overlap | nonnegative 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
Expected output
0 1 1 2
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
