-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support SSA/ASS styling #8435
Comments
@icbaker Tentatively marking as an enhancement, but please dupe or close as needed. Thanks! |
Thanks for the request. Unfortunately we don't currently have any capacity to improve ExoPlayer's SSA/ASS styling support. However we would welcome high quality PRs in this area. I'm also happy to discuss various approaches with PR authors if a new feature doesn't fit easily into the existing code structure (either before the PR, or in the review, whichever is easier). |
Could we determine a basic checklist of what isn't supported, to determine what features of the spec can be focused on in order of size and/or ease of implementation? (I'm not familiar with what exactly even is supported currently). |
That sounds like a good idea - the best way to do that is probably to compare the In case it's helpful, we would probably prioritise things roughly in this order:
I don't know if SSA has anything in the final category - but if it looks like it does then please come talk to us before spending ages refactoring |
I'm not a developer, so I can't exactly contribute a lot, but proper support of ass/ssa in Exoplayer is something I'd very much would like to have, as Plex for Android currently makes me sad... |
Thanks for the pointer to libass, I took a quick look. I think you're possibly suggesting two alternative things:
In case anyone is considering trying the first of these, I'd like to pre-emptively warn against it. libass looks like it's written in C, and we're very reluctant to pull in native/JNI dependencies unless a pure Java implementation of the same behaviour is deemed ~impossible. Given SSA/ASS is a relatively simple plaintext-based format, it seems completely feasible to parse it fully using pure Java - so it's extremely unlikely we'd accept a PR that introduced a native dependency to achieve this. There's more discussion about (not) using native deps for parsing subtitles in #7746 and #7749. The second suggestion (use it as a reference implementation) makes perfect sense - and afaict it's used by VLC, so it should be enough to just play any content with VLC and compare to ExoPlayer's behaviour. |
I leave that up to actual developers to decide. I just thought I'd point out that libass exists and is probably the best reference we have, and that rendering subs differently from libass could potentially make people like me wonder why the subs behave differently in ExoPlayer. The second alternative is probably the better option for ExoPlayer. :) |
hey @icbaker , I'll check what the current @jakobkukla did you have anything specific in mind? I mean is there a specific styling option which you would like to see first? |
Thanks for taking a look! Breaking down the work into small PRs definitely sounds good. |
@szaboa To be honest I'm not really aware what is currently supported and what not. But the ability to display fonts and colors properly would be nice! |
@icbaker
My plan is to start implement some easy ones first :) |
The spec I linked above (#8435 (comment)) seems to think that Underline, Strikeout, ScaleX, ScaleY, Spacing and Angle are supported in v4+. In fact are possibly only supported there and not in v4. Maybe those rows in your table are accidentally flipped? Or maybe I'm misreading the spec... The If you're going to add v4 support we probably need to do think about whether we can reuse the These all look like they should be relatively easy (I've referenced the relevant Android styling span where it seems obvious):
The spec I'm looking at doesn't really define these clearly enough to be sure:
These look harder. They have basically no support in the existing
These are hard for other reasons:
|
Yep, you are right, the Underline, Strikeout, ScaleX, ScaleY, Spacing and Angle are supported in v4+ only, and not in v4. I will correct the table. Thanks for the tips, will definitely start with the easy ones. |
Initial PR for "Primary Colour" is here #8490. |
Is there any option/API to disable, customize or detect the styling? If an app sets custom |
@moneytoo Assuming you're using the ExoPlayer UI components, you can force the |
I just want to note that I haven't forgotten about this, just need to find time to continue it :) |
Initial PR for "FontSize" is here: #8615 |
OK,thank you very much!!! |
Hi, |
@icbaker I looked into what SSA/ASS supports and what is implemented and what not. So what I think about it.
wdyt? |
Re-implement SSA/ASS render would be a pure way, but takes much more time to get full feature support, I think import libass with JNI would be the easiest way to make things done. |
Plex has now side stepped this by bundling libass in their android client, presumably using ffmpeg or something to mux on the client side before passing to exoplayer. |
That would be not only the easiest way, but also the only way to correctly render all those obscure and advanced feature-rich ASS files that typesetting enthusiasts can come up with. There are a lot .ass files with over 25MB of animated signs, and at this point not even those long-standing libass alternatives like vsfilter or its derivates can render them properly. Trying to recreate libass would be a neverending task and a huge magnet for complaints about any kind of advanced signs not rendering correctly. Not to mention, libass has years of performance optimizations. Just adopting libass instead of making a new subtitle renderer could solve a lot of problems. |
I would love to vouch for this one as well.. this is awesome player, but its rly bad for anime without full support for ssa subtitles :( |
I wholeheartedly agree. If this issue hadn't been such a long-standing one and been actually looked into by Google itself rather than them watching from the sidelines and hoping for the community to fully do this job by the looks of it, I'd be a lot more optimistic about exoplayer re-implementing and keeping up with changes in-time or mostly in-time. But apparently relying on constantly staying in-sync with ass extensions is a futile effort, so just using libass seems like the most reliable, future-proof-ish effort there is from my limited understanding. It's a shame, but the dynamic nature of ass is both a curse, but also a blessing because it offers features not found elsewhere. The cost may be annoying. But when libass is doing the work needed why don't we just rely on it like what I think any sensible player does with proper ass-support? Why re-invent the wheel? It's not like there's much to gain from it right? Even if using libass might not be as performant as a fully-optimized re-implementation, what sorts of differences that can be felt are we talking about here? Subtitle rendering isn't something that needs to scale endlessly, especially not when it's per player, at humanly digestible play-speeds, etc... To anyone who is investing any sort of work into this effort: you have my most honest gratitude. The day Android has player-independent ACE ass support will be a good day! Not only for us anime and FOSS app fans. |
Is there way to fix overlapping subtitles ? |
It's a known issue, any fix would be supplied by exoplayer extending ass support. I'm not aware of user settings that can fix this. |
so its been two years already and we still dont have proper ssa support.. if using libass can solve this, can some dev do something about it? I think a lot of ppl would be rly happy. I know you are doing this for free, but still. thanks |
Is there any progress on it? Many other multimedia apps are based on ExoPlayer and thus have limited support on ass/ssa subtitles. |
|
I'm not sure if this can be called as a progress since nearly two years have passed and this pr is still not merged. In addition, there are still many styles that are not supported. Low priority label makes me desperate... |
I'd love to get this implemented as it would make this player the only one with DV and proper .ass support in Android besides Kodi which is way too heavy for anything other than an Nvidia Shield. |
Looking forward to this! |
Add support for SSA/ASS styling. Currently there is only "minimal" support for ASS subtitles since styling was removed from the initial PR. (See #2281)
It would be great to have full support of the spec. Many subtitles use these styling features to work directly with the video (e.g. to substitute text in a video). SSA/ASS styling is also very common in certain genres of media like Cartoons, Anime or Karaoke.
The text was updated successfully, but these errors were encountered: