PGS display sets with more than one object desync the stream

Open
#76 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
57/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
macos, swift

Research direction

Start with PGS.parseNextSubtitle and trace how it advances through PDS, ODS, and END segments; inspect PCS composition positions and SubtitleTimeline.composite for the existing FFmpeg path. Reproduce with a display set containing two ODS objects, then confirm parsing reaches END, collects both objects, and composites them at their PCS positions without abandoning the remaining track.

Written by the indexing model from the issue text.

Description

bug

PGS.parseNextSubtitle returns as soon as it has a PDS and the first ODS, then does offset += pgsHeaderLength // Skip the end segment. When a display set has a second ODS (two composition objects, e.g. captions at top and bottom at once, which is common on Blu-ray), that skips 13 bytes into the second ODS instead of an END segment. Parsing then continues from the middle of RLE data and usually abandons the rest of the track.

Fix: parse each display set up to its END segment, collect every object, and composite them at their PCS composition positions (SubtitleTimeline.composite already does this for FFmpeg rects). Possibly related to #47.

Dominant language
Swift
Stars
42
Forks
9
Avg merge
9h 30m
Merged PRs (30d)
4

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ecdye/macSubtitleOCR

All issues in ecdye/macSubtitleOCR

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.