Skip to content

Support the preserveASSMarkup option when loading external ASS subtitles #48

Closed

Description

@bitxeno

What should the engine do?

Currently, the preserveASSMarkup option supports only embedded subtitles. It would be very helpful if loading an external subtitle with selectSidecarSubtitle also preserved ASS markup and returned the ASS header.

Motivating media or use case

swift-ass-renderer can render external ASS subtitles, not only embedded ASS subtitles.

Area

Public API surface

Host app / integration context

No response

Would you be willing to open a PR?

No

Activity

  1. added
    enhancement
    on Jun 17, 2026
  2. superuser404notfound commented on Jun 17, 2026

    @superuser404notfound
    Owner

    Shipped on main ✅

    selectSidecarSubtitle(url:) now honours the session's LoadOptions.preserveASSMarkup for external .ass / .ssa files, exactly like embedded tracks:

    • Cues carry the raw libavcodec event line (override tags, style references, escapes intact) instead of stripped plain text.
    • The script header ([Script Info] + [V4+ Styles]) extracted from the sidecar's subtitle-stream extradata is surfaced on the new published engine.sidecarASSHeader (the sidecar analogue of TrackInfo.assHeader).

    Wiring for swift-ass-renderer is unchanged from the embedded path: feed each cue's raw text + startTime / endTime into ASSScriptBuilder(header: engine.sidecarASSHeader), then hand builder.script() to loadTrack(content:). SRT / VTT sidecars and the text-only secondary channel are unaffected (no ASS payload, header stays nil).

    Verified off-device by a new test that decodes a real ASS file through FFmpeg and asserts the override tags survive and the header feeds ASSScriptBuilder. It will ride the next tagged release.

    Thanks for the clear request!

  3. superuser404notfound commented on Jun 17, 2026

    @superuser404notfound
    Owner

    Released in 3.10.0. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions