Native PGS support - Printable Version +- Jellyfin Forum (https://forum.jellyfin.org) +-- Forum: Development (https://forum.jellyfin.org/f-development) +--- Forum: Web Development (https://forum.jellyfin.org/f-web-development) +--- Thread: Native PGS support (/t-native-pgs-support) |
Native PGS support - Arcus - 2024-06-06 Hello, I'm currently working on a way to enable native PGS support without transcoding in the web-version of Jellyfin. Problem: I really dislike burned-in subtitles. I like my my media library to be as clean and as complete as possible with all audio tracks and all subtitles when digitize my Blue Rays. Blue Rays always have graphical subtitles (PGS - .sub) that cannot be converted into text subtitles. Graphical subtitles can only be displayed with video transcoding. I'm using a NAS without GPU support, so transcoding even a 1080p video is reaching the CPUs limit. Also the video quality drops. I've built a tool that converts the video with all audio tracks into a MP4 using stream-friendly codecs. Then I extract all PGS subtitles, store them as .sub files next to the video. Then I run an automatic script to OCR the images and create an SRT file. The OCR only works half the time. Some images can't be read at all and are empty and every tenth word has a typo. Yes, I'm obsessed with having a perfect media collection... Solution: Allow Jellyfin to stream raw .sub files to the client and let the client render the graphical subtitles on-top of the video. Tasks / Status:
Problems and limitations...
Repositories:
Is this something anyone is interested in or am I the only one who would benefit from this? Is this even in the spirit of the Jellyfin project? Is it worth to build a clean implementation from the prototype, so it could be merged some day? Thanks for reading all of this! RE: Native PGS support - thornbill - 2024-06-06 It sounds roughly similar to what we do for ASS/SSA subs, so I don’t see why we wouldn’t want to try it! 💜 RE: Native PGS support - nyanmisaka - 2024-06-07 Considering that PGSSUB files are relatively large, we can apply some compression algorithm while transferring. This is the result given by 7zip fast: 182M vs 7.9M for a two hour subtitle BTW I saw a similar project before. https://github.com/MathNuts/SUPtitles RE: Native PGS support - Arcen - 2024-06-07 Have you tried TrOCR or other more recent OCR models? Obviously they're more computationally intense than, say, tesseract, but curious about results. RE: Native PGS support - Arcus - 2024-06-07 (2024-06-07, 09:48 AM)Arcen Wrote: Have you tried TrOCR or other more recent OCR models? Obviously they're more computationally intense than, say, tesseract, but curious about results.No, I haven't tried that yet. But it looks promising. Using compression is a great idea. I'll have a look at this. Update: I've build a working prototype:
It's still needs a lot of polish but it already works quite nicely. RE: Native PGS support - ferferga - 2024-06-15 @Arcus are you interested in PRing it in Vue as well? RE: Native PGS support - Arcus - 2024-06-21 (2024-06-15, 04:44 PM)ferferga Wrote: @Arcus are you interested in PRing it in Vue as well? @ferferga Sorry, I missed your message. Yes, I've already looked at the vue project, but first I'll fix the performance concerns for the default client. RE: Native PGS support - Mats - 2024-09-01 I rebased everything atop the latest release and tested it. Can confirm it works well with the LG webOS client (including movies). Great work! RE: Native PGS support - Host-in-the-Shell - 2024-09-01 This sounds like a major addition to have, particularly for us who use WebOS Jellyfin as our primary client. Is this something that later down the line could be merged into the main repos? I don't know much about how the JF code works and what its limitations are, so that's why I'm asking. |