HackingGate / MyAnimeList-AppleMultiplatform

Unofficial MyAnimeList app for Apple TV, iPhone, iPad and Mac rewritten in SwiftUI (previous was TVML/TVJS) (never tries to publish to App Store due to potential copyright issue)
MIT License
23 stars 0 forks source link

Subtitles in HLS(m3u8) does not support ass format #8

Closed HackingGate closed 3 years ago

HackingGate commented 3 years ago

The IETF standard HTTP Live Streaming only support WebVTT subtitles.

WebVTT is based on SRT. Which is less rich than ASS.

AVFoundation provided by Apple only support WebVTT which means if I want the soft subtitles in the app. I have to convert ASS to WebVTT.

What will happen if I adopt WebVTT

The original ASS subtile from Crunchyroll looks like this

 Death March to the Parallel World Rhapsody Episode 1 ASS

The SRT subtitle converted by ffmpeg -i enUS.ass -c:s srt enUS.srt looks like this

 Death March to the Parallel World Rhapsody Episode 1 SRT

As you can see word Character and satou are not in the right position. It's better to remove those words and only keep the phrase on bottom center.

Not all anime in Crunchyroll are fully subbed. For example

Sword Art Online EP4

In this case. Format in ASS and SRT will not make a big difference.

Requirements for adopting ASS subtitles

I have to drop AVFoundation and use a third party video player.

What will happen if I do nothing

The subtitles will look good and will be in English only. It's hard encoded in the video. You cannot turn it off or change to other languages.

HackingGate commented 3 years ago

Looks like I also have to bypass Cloudflare's anti-bot page to get soft subtitles.

I can use this pip package cloudscraper to accomplish it. Command line tool CrunchyrollSwift-DL will support soft subtitles.

Because Swift for UI apps is not able to import Python. The UI app will remain as current.

If anyone have a bypass library in Swift and can be used on UI apps. Please reopen the issue.