Add libass support!
https://github.com/libass/libass

As you can see, its weird not to see Just Player in here seeing its open sourced like the others. ASS/SSA subs is the only thing missing for Just player. Particularly for Anime fans!
Hope you could add it too!
This is a job for ExoPlayer: https://github.com/google/ExoPlayer/issues/8435#issuecomment-759327563
@moneytoo Its an entirely separate entity from exoplayer. Emby and plex (recently added libass) android players both use exoplayer and libass on top of it.
Hope you can look it up.
https://libass.github.io/JavascriptSubtitlesOctopus/videojs.html https://libass.github.io/JavascriptSubtitlesOctopus/index.html
Here are some JS examples on browser players using libass.
Configuring subtitle renderer possible in Just player?
Libass is an open source subtitle renderer and a replacement for the VSfilter.
Example,
- on MPC-HC, you could change it by pointing to a folder with libass.
- on MPV, you could point a "script" folder with latest libass
If there were any publicly available patches/integration of libass in ExoPlayer, I would include them. Unfortunately, no one is sharing that. It would be needed to be implemented in the engine so it's really not a task for Just Player.
As there is already the peerless2012/libass-android library, here's a test build of Just Player with it: https://brouken.com/player/libass/ It's not compatible with latest Media3 alphas and it causes some issues with non-ASS videos but feel free to try it.
As there is already the peerless2012/libass-android library, here's a test build of Just Player with it: https://brouken.com/player/libass/ It's not compatible with latest Media3 alphas and it causes some issues with non-ASS videos but feel free to try it.
Already fixed, and external ass subtitle supported, check release.
Hope this can help you, if you have any issue, create an issue, pr is also great.
@moneytoo I tried the libasss-v0.191 branch and the results so far are not satisfactory. Compared to the vanilla player I noticed the following differences:
- The font is "thin", I have bold fonts enabled in the settings.
- The embedded font is not used, rather some generic fallback is being used, it's not as nice as the vanilla font, the edges are very jagged.
- Since the embedded font is not used, the fallback is too large and falls out of alignment (it starts to overlap with hardcoded subtitles).
- Not quite sure what happened but subtitles stopped working entirely after I accidentally closed the player and reopened it quickly within 5 seconds, changing the subtitles and turning them on or off had no effect. I had to completely close out of it again and then restart the video to make the subtitles work.
Noticed another major bug, HDR/Dolby Vision has stopped working in this build, the TV is not getting the HDR metadata. It used to work perfectly fine in the previous stable release.
@moneytoo I tried the libasss-v0.191 branch and the results so far are not satisfactory. Compared to the vanilla player I noticed the following differences:
- The font is "thin", I have bold fonts enabled in the settings.
- The embedded font is not used, rather some generic fallback is being used, it's not as nice as the vanilla font, the edges are very jagged.
- Since the embedded font is not used, the fallback is too large and falls out of alignment (it starts to overlap with hardcoded subtitles).
- Not quite sure what happened but subtitles stopped working entirely after I accidentally closed the player and reopened it quickly within 5 seconds, changing the subtitles and turning them on or off had no effect. I had to completely close out of it again and then restart the video to make the subtitles work.
- The font is "thin", I have bold fonts enabled in the settings.
Customer font style is not support now.
- The embedded font is not used, rather some generic fallback is being used, it's not as nice as the vanilla font, the edges are very jagged.
The embedded font in mkv should work, what's format of your file?
- Since the embedded font is not used, the fallback is too large and falls out of alignment (it starts to overlap with hardcoded subtitles).
Share the file, and I can make a test.
- Not quite sure what happened but subtitles stopped working entirely after I accidentally closed the player and reopened it quickly within 5 seconds, changing the subtitles and turning them on or off had no effect. I had to completely close out of it again and then restart the video to make the subtitles work.
And tell me how to reproduce this issue.
Noticed another major bug, HDR/Dolby Vision has stopped working in this build, the TV is not getting the HDR metadata. It used to work perfectly fine in the previous stable release.
My test dv mkv works fine on my pad, is this only for some file or all file?
@peerless2012 Thank you for the response!
Share the file, and I can make a test.
Sure! I extracted a segment from the file: https://send.cyberjake.xyz/download/fd7d2a6a671c8399/#An1H_OGoger95AMuPGfHDw
And tell me how to reproduce this issue.
Sorry, that's the best I could do, it's not easy to reproduce.
My test dv mkv works fine on my pad, is this only for some file or all file?
Not sure because I only tested with a single DV/HDR file, here's a segment from that file: https://send.cyberjake.xyz/download/ec8cd8cd45828e9b/#y4gjveDBP5XAt77icKylUQ
Just in case everything works for you, can you try my specific build of Just Player? This is the exact build that I used for testing: https://github.com/TheDcoder/JustPlayer/releases/tag/v0.191-libass
Due to my test, the font in mkv works fine, both my demo and your's is workd.
DV/HDR mkv, I can't confirm that's right or wrong.
And the subtitle lost or time error seems is a problem.
Due to my test, the font in mkv works fine, both my demo and your's is workd.
That's nice... but then it makes me wonder why it doesn't work on my TV 😞
DV/HDR mkv, I can't confirm that's right or wrong.
The colours will look "washed out" (too bright etc.) if the HDR metadata is not sent, so if you didn't notice anything like that then it's probably working fine.
The subtitle lost issue is caused by the start time when setMedia
Great, you have already pin-pointed the issue! I'm not an Android developer so @moneytoo will have to fix this :)
@peerless2012 I just tried the same media file in the Android Emulator (TV model) and the subtitles there are working fine, so it looks like the issue is limited to only some devices like my real TV 😕
Aside from that I also managed to reproduce the "no subtitles" issue reliably on the emulator, you just need to disable embedded subtitles and enable bold style from the settings, both options are important, otherwise the bug wouldn't be triggered.
After that point the subtitles will stop showing up entirely no matter what you do, even changing the settings back won't work. The only "fix" I have found is to wipe the app data. Not sure if this is the same bug as what I found on my real TV.
I think all these issue is by the setMedia with position, you can delete postion filed in it and test again.
Before:
player.setMediaItem(mediaItemBuilder.build(), mPrefs.getPosition());
After:
player.setMediaItem(mediaItemBuilder.build());
@peerless2012 Wow, that was a very fast response! I'll definitely try that but in the meanwhile I figured out why the subtitle formatting was "fixed", it's because I remuxed the file to cut out the audio and rest of the video.
I reinstalled the libass fork on my real TV and the test subtitle file worked absolutely fine. So the issue only happens with some files, and here's one of them with zero modifications: https://de.skysend.ch/download/d77da768a1e5f264/#4_ajV1ijQ0zB_irDz-kp_w
Please test this file, I am positive that it will be formatted improperly.
To be sure, what I talk above (remove position in setMedia) is just a test way, if you remove it, you will lost the last position remember.
And if you want to use last position remember, you need to find another way, like on media prepared and seek. OR use LEGACY mode( No damic anim).
@peerless2012 I think the test fix worked, now I can't reproduce the issue.
Anyway, HDR/DV is the other big issue with the libass builds, I just reconfirmed the issue with several different video files and all of them are not sending the metadata. This is really visible in DV-only videos where the colours look all messed up (most of them become a shade of purple).
Any ideas why this might be happening?
@peerless2012 Wow, that was a very fast response! I'll definitely try that but in the meanwhile I figured out why the subtitle formatting was "fixed", it's because I remuxed the file to cut out the audio and rest of the video.
I reinstalled the libass fork on my real TV and the test subtitle file worked absolutely fine. So the issue only happens with some files, and here's one of them with zero modifications: https://de.skysend.ch/download/d77da768a1e5f264/#4_ajV1ijQ0zB_irDz-kp_w
Please test this file, I am positive that it will be formatted improperly.
The file above can't play by media3, so I can't have a test.
And the dv mkv on my pad works fine, the dv logo on system bar is active when play.
@peerless2012 I am able to play the same file on my TV without any errors, can you try disabling thr video tunneling option in the settings? Some videos don't play with that enabled.
Regarding DV, are you using the OpenGL renderer? As you know during our testing today my TV displayed DV only with the legacy renderer.
@peerless2012 I am able to play the same file on my TV without any errors, can you try disabling thr video tunneling option in the settings? Some videos don't play with that enabled.
Regarding DV, are you using the OpenGL renderer? As you know during our testing today my TV displayed DV only with the legacy renderer.
Try the latest bull in your fork, it's a CANVAS mode.
And I also test the OPEN_GL mode and CANVAS mode for dv you give me on my pad, the color is correct.
The mxplayer play dv, screen is green and purple, so I can confirm JustPlayer with ass plugin render the correct color.
@peerless2012 Unfortunately CANVAS mode has broken DV in my TV, I am back to seeing the incorrect green and purple colours.
As for the subtitles issue it's still present in the full video sample I sent to you. Were you able to get it to play on your device?
Yes, just like I talk above. and let's test and talk on discord please.
@peerless2012 I may have figured out why your device was not able to play the full media sample I provided earlier, it uses a 10-bit colour depth which is not widely supported by many hardware decoders.
Here's another sample media from the same batch and has the same subtitle font issues, but it uses 8-bit colour depth which is supported by all decoders: https://de.skysend.ch/download/f0819b447cf7341d/#rX6p6fVlFLUtJ-caTOo_8g
Use new OVERLY mode, both support ass animation and HDR/DV, so this conversation should be end.
@moneytoo should this issue be closed now that https://github.com/peerless2012/libass-android is available?