Skip to content

Add native subtitle rendering with libass and FFmpeg - #214

Open
anilbeesetti wants to merge 8 commits into
mainfrom
codex/ffmpeg-text-renderer
Open

anilbeesetti wants to merge 8 commits into
mainfrom
codex/ffmpeg-text-renderer

Conversation

@anilbeesetti

Copy link
Copy Markdown
Owner

Media3's subtitle path does not preserve full ASS styling and drops WebM D_WEBVTT tracks before selection. This adds FfmpegTextRenderer for ASS/SSA through libass and PGS, VobSub and DVB through FFmpeg, while retaining Media3 parsing for other text formats.

  • Build upstream libass and pinned font/shaping dependencies directly for all four Android ABIs, with packaged license notices and native dependency/16 KiB alignment checks in CI.
  • Retain Matroska font attachments and embedded ASS fonts, and adapt WebM subtitle/caption packets without losing cue timing or settings.
  • Handle subtitle delay, speed, seek/reset and stream-end behavior. Forward video surface dimensions inside nextlib so applications do not need a viewport listener.
  • Include synthetic regression fixtures and NextPlayer integration patches that keep ordinary text centered and align bitmap cues with the video surface.

Validation

  • Latest revision: 21 device tests passed on a disposable ARM64 Android 16/API 36 emulator, including a 16-case subtitle playback matrix and automatic viewport resizing with default, FFmpeg-only and decoder-switching factories.
  • 11 library JVM tests and 18 NextPlayer player JVM tests passed; NextPlayer formatting and debug APK builds passed.
  • Native binaries built for all four ABIs; release AAR dependency, export, license and 16 KiB alignment checks passed. The native-build revision also passed 19 device tests on an Android 17/API 37 emulator with 16 KiB pages.
  • NextPlayer visual checks covered authored ASS fonts/positioning, SRT centering, embedded Greek WebVTT selection/rendering, and bitmap alignment without an app viewport listener. Supplied media and its screenshots are excluded from Git.

Known limits include recovering earlier overlapping WebM cues after buffered seeks and discovering font attachments stored after media clusters. Integration instructions and detailed evidence are in SUBTITLES.md.

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