question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SSA-in-MKV doesn't support simultaneous subtitles

See original GitHub issue

ExoPlayer Version

2.17.1

Devices that reproduce the issue

  • All devices I used. It’s not device-relevant.

  • Devices I used: OnePlus 8T, OnePlus 10 Pro, Xiaomi Mi11 Ultra, Asus ROG Phone 4, Red Magic 6, Xiaomi Redmi Note 8 Pro, Samsung Galaxy S21

  • All of the aforementioned devices run Android 10 to 12.

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps

  • Loading any media file.
  • Passing an SRT/ASS subtitle file to ExoPlayer that contains two (or more) lines that show up at the same time.

Expected result

  • Both subtitles should appear at the same time.

Actual result

  • If two subtitles are overlapping, the subtitle that appears later will remove the existence of the subtitle that appeared before it, albeit both co-existing during that timeframe.
  • In many movies and series, subtitles overlap in some dialogues.

Media

OverlappingSubsDemo.zip

As for the video file, just grab any media from https://thedigitaltheater.com/dts-trailers/

Bug Report

  • You will email the zip file produced by adb bugreport to dev.exoplayer@gmail.com after filing this issue.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
icbakercommented, Jul 14, 2022

Thanks for clarifying that this specifically affects SSA inside MKV - that would explain why the commit I was referencing above isn’t ‘working’.

And thanks for providing example media, that will help to check any fix made for this works as expected.

The timestamps for SSA subtitles inside Matroska containers are extracted from the Matroska TimeStamp and BlockDuration elements. The MatroskaExtractor then emits a separate ExoPlayer ‘sample’ for each subtitle. This is in contrast to the way ‘sideloaded’ SSA subtitles are handled, where the whole file is emitted as a single ExoPlayer ‘sample’

The changes in https://github.com/google/ExoPlayer/pull/6595 assume that all the overlapping subtitles appear in the same ‘sample’.

We have some much larger subtitle changes in our future plans, which will change how subtitles map to ‘samples’, and should make the code paths between sideloaded SSA and SSA-in-MKV more similar. I’m afraid don’t think it’s worth trying to fix this issue with the current code, because it’s all going to change, and so the work would largely be wasted - but I will add it to the list of issues we should aim to resolve as part of the much larger refactor. Thanks for raising it 😃

0reactions
Reddnekcommented, Jul 7, 2022

ExampleFiles.zip

Regardless to MimeTypes such as ASS and SRT. There are two categories of subtitles I am talking about: Externally-loaded ones (manually loaded) and internal ones (coming in a MKV container).

The issue does NOT exist with manually-loaded SSA/ASS subtitle files. Here’s where the problem is:

  • SRT subtitle tracks whether they’re manually loaded or internal in a MKV container.
  • and ASS/SSA subtitle tracks that come in a MKV container (Internal subs). (only one sub shows up at a time).

I have attached the following files to reproduce the problem:

  • 3 Subtitle Files: SSA, ASS and SRT - Produced by Aegisub and they all have identical subtitle lines.
  • 2 Video files: 1 MP4 sample and 1 MKV sample that contains 2 subtitle tracks (One is SRT, the other is ASS).

Tested as of version 2.18.0. @icbaker @google-oss-bot I hope this helps.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTML5 Video: Displaying two different subtitles simultaneously
I am using the standard HTML5 video subtitle functions to display subtitles (provided in srt and vtt) in the builtin HTML5 video player....
Read more >
How to Add Multiple Subtitles to a Video in DaVinci Resolve
In this tutorial, I'll show you How to Add Multiple Subtitles to a Video in DaVinci Resolve. Download DaVinci Resolve ...
Read more >
Displaying two subtitle tracks simultaneously - Ask Ubuntu
It would help a lot while learning a new language. I have some *.mkv movie with two embedded subtitles, how would I turn...
Read more >
Is it possible to insert two simultaneous subtitles (closed ...
When using a single subtitle frame, I have found that it is not possible to have text in two different font thicknesses -...
Read more >
YouTube™ dual subtitles
Automatically switch to local language, bilingual subtitles, ... to machine translation if not. feedback email support@dual-subtitles.com.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found