kingslay / KSPlayer

A video player for iOS、macOS、tvOS、visionOS , based on AVPlayer and FFmpeg, support the horizontal, vertical screen. support adjust volume, brightness and seek by slide, support subtitles.
GNU General Public License v3.0
868 stars 182 forks source link

Subtitles in KSPlayer #757

Closed ott-play closed 3 months ago

ott-play commented 3 months ago

There is a problem with subtitles in KSPlayer Please look at a good example flow: https://d2zihajmogu5jn.cloudfront.net/elephantsdream/hls/ed_hd.m3u8

The avPlayer sees 5 tracks in this stream: English, Swedish, Russian, Japanese and Arabic VLC player: Swedish, Russian, Japanese, Arabic and English KSplayer from Git sees nothing at all(( TracyPlayer sees two:

Снимок экрана 2024-03-21 в 10 03 06

And another small question not about subtitles: how to stop the player? analog avplayer [self.avPlayer replaceCurrentItemWithPlayerItem:NULL];

kingslay commented 3 months ago

可以调用shutdown 这个方法来进行stop。 这个字幕无法显示是因为ffmpeg无法解析 m3u8里面的字幕。你可以用iina试下。也是无法显示字幕。 vlc不是完全使用ffmpeg的能力,所以vlc可以显示。

ott-play commented 3 months ago

Unfortunately, the shutdown is not at all equivalent(

what about the difference between subtitles in github KSplayer and TracyPlayer?

kingslay commented 3 months ago

TracyPlayer 增加了线上自动搜索字幕的功能,但是那个搜索出来的字幕不一定是对的 因为是根据名字来搜索的。

kingslay commented 3 months ago

你用shutdown 之后,那个点不符合你的预期呢?

ott-play commented 3 months ago

[self.avPlayer replaceCurrentItemWithPlayerItem:NULL]; completely returns the avPlayer to its initial state

after the shutdown, the picture remains on the screen and the status is buffered

kingslay commented 3 months ago

如果你要清空画面的话,需要在调用下 videoOutput?.flush() 。