Giter Club home page Giter Club logo

Comments (25)

kingslay avatar kingslay commented on June 4, 2024
   override open func player(layer: KSPlayerLayer, state: KSPlayerState) {
        super.player(layer: layer, state: state)
        if state == .readyToPlay, let player = layer.player {
            print(player.naturalSize)
            // list the all subtitles
            let subtitleInfos = srtControl.filterInfos { _ in true }
            subtitleInfos.forEach {
                print($0.name)
            }
            subtitleInfos.first?.makeSubtitle { result in
                self.resource?.subtitle = try? result.get()
            }
            for track in player.tracks(mediaType: .audio) {
                print("audio name: \(track.name) language: \(track.language ?? "")")
            }
        }
    }

from ksplayer.

aningxu avatar aningxu commented on June 4, 2024

此代码提示:Value of type 'SubtitleInfo' has no member 'makeSubtitle'

from ksplayer.

kingslay avatar kingslay commented on June 4, 2024

更新下最新的代码

from ksplayer.

aningxu avatar aningxu commented on June 4, 2024

tvOS上没有这个方法。
我昨天更新的

from ksplayer.

aningxu avatar aningxu commented on June 4, 2024

pod update
Update all pods
Updating local specs repositories
Analyzing dependencies
Pre-downloading: KSPlayer from https://github.com/kingslay/KSPlayer.git, branch master
Pre-downloading: Openssl from https://github.com/kingslay/KSPlayer.git, branch master
Downloading dependencies
Installing KSPlayer 1.0
Installing Openssl 1.1.1
Generating Pods project
Integrating client project
Pod installation complete! There are 2 dependencies from the Podfile and 2 total pods installed.

[!] Automatically assigning platform tvOS with version 14.0 on target XXX because no platform was specified. Please specify a platform for this target in your Podfile. See https://guides.cocoapods.org/syntax/podfile.html#platform.

更新显示版本还是1.0呢。

from ksplayer.

kingslay avatar kingslay commented on June 4, 2024

用最新的 develop分支

from ksplayer.

aningxu avatar aningxu commented on June 4, 2024

WX20200731-172402

上面的方法,不能显示webvtt字幕。

let subtitle = player.tracks(mediaType: .subtitle)
print(subtitle)
这样可以打印出webvtt字幕的信息,但是如何使用他呢。

WX20200731-172746

from ksplayer.

kingslay avatar kingslay commented on June 4, 2024

如果是用avplayer的话,那直接用
player.select(track: track) 就可以了。avplayer你需要在设备上开启字幕功能。才能显示。

from ksplayer.

aningxu avatar aningxu commented on June 4, 2024

该视频使用 KSMEPlayer 才能播放

from ksplayer.

kingslay avatar kingslay commented on June 4, 2024

麻烦你提供下视频的url。我试下

from ksplayer.

aningxu avatar aningxu commented on June 4, 2024

请查看您的邮箱,我前几天发了邮件给您。
现在的情况是,在真机测试,webvtt的字幕能正常显示,另外一种基于图形的字幕能显示字幕轨道信息,但是不能在屏幕显示。

我用的代码如下:
let audio = player.tracks(mediaType: .audio)
let subtitle = player.tracks(mediaType: .subtitle)

        print(audio)
        print(subtitle)

        player.select(track: audio[0])
        player.select(track: subtitle[0])

from ksplayer.

kingslay avatar kingslay commented on June 4, 2024

基于图形的字幕现在还不支持。现在只支持这几种格式的字幕
CONFIGURE_FLAGS="$CONFIGURE_FLAGS --enable-decoder=ass"
CONFIGURE_FLAGS="$CONFIGURE_FLAGS --enable-decoder=srt"
CONFIGURE_FLAGS="$CONFIGURE_FLAGS --enable-decoder=ssa"
CONFIGURE_FLAGS="$CONFIGURE_FLAGS --enable-decoder=movtext"
CONFIGURE_FLAGS="$CONFIGURE_FLAGS --enable-decoder=subrip"
CONFIGURE_FLAGS="$CONFIGURE_FLAGS --enable-decoder=dvdsub"
CONFIGURE_FLAGS="$CONFIGURE_FLAGS --enable-decoder=webvtt"

from ksplayer.

aningxu avatar aningxu commented on June 4, 2024

能否看下邮件,确认下我是否对那条流携带的字幕轨道认识错误?

from ksplayer.

aningxu avatar aningxu commented on June 4, 2024

希望能尽快支持,基于图形的字幕在国外的使用场景非常多。

from ksplayer.

aningxu avatar aningxu commented on June 4, 2024

-filter_complex [0:s:0]scale=1920*1080,setpts=PTS-STARTPTS-0/TB,tblend=all_mode=linearlight,select='isnan(prev_selected_t)+gte(t-prev_selected_t,0.1)'[s0];[0:v][s0]overlay[v]

ffmpeg 是可以使用以上命令来选择字幕轨道的。

from ksplayer.

kingslay avatar kingslay commented on June 4, 2024

基于图形的那个字幕是什么格式的呢

from ksplayer.

aningxu avatar aningxu commented on June 4, 2024

dvb subtitles
IMG10

from ksplayer.

kingslay avatar kingslay commented on June 4, 2024

你能提供下有dvb字幕的视频让我测试下吗?

from ksplayer.

aningxu avatar aningxu commented on June 4, 2024

我发了邮件到您的邮箱:[email protected],麻烦查收一下。

from ksplayer.

kingslay avatar kingslay commented on June 4, 2024

收到了。谢谢

from ksplayer.

aningxu avatar aningxu commented on June 4, 2024

我看你添加了 dvbs字幕支持,但是我更新了代码,还不能使用呢

from ksplayer.

kingslay avatar kingslay commented on June 4, 2024

是的,只是增加了dvbs格式的识别。但是这个解码还需要做特殊的处理,因为他是图片字幕跟之前的文字字幕不大一样。需要把流程改下。改动比较大。图片字幕的内存占用太高了。

from ksplayer.

aningxu avatar aningxu commented on June 4, 2024

可以借鉴下 VLC 播放器,辛苦。

from ksplayer.

aningxu avatar aningxu commented on June 4, 2024

字幕问题能解决吗?

from ksplayer.

kingslay avatar kingslay commented on June 4, 2024

这个问题还在改

from ksplayer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.