Comments (25)
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.
此代码提示:Value of type 'SubtitleInfo' has no member 'makeSubtitle'
from ksplayer.
更新下最新的代码
from ksplayer.
tvOS上没有这个方法。
我昨天更新的
from ksplayer.
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.
用最新的 develop分支
from ksplayer.
上面的方法,不能显示webvtt字幕。
let subtitle = player.tracks(mediaType: .subtitle)
print(subtitle)
这样可以打印出webvtt字幕的信息,但是如何使用他呢。
from ksplayer.
如果是用avplayer的话,那直接用
player.select(track: track)
就可以了。avplayer你需要在设备上开启字幕功能。才能显示。
from ksplayer.
该视频使用 KSMEPlayer 才能播放
from ksplayer.
麻烦你提供下视频的url。我试下
from ksplayer.
请查看您的邮箱,我前几天发了邮件给您。
现在的情况是,在真机测试,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.
基于图形的字幕现在还不支持。现在只支持这几种格式的字幕
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.
能否看下邮件,确认下我是否对那条流携带的字幕轨道认识错误?
from ksplayer.
希望能尽快支持,基于图形的字幕在国外的使用场景非常多。
from ksplayer.
-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.
基于图形的那个字幕是什么格式的呢
from ksplayer.
from ksplayer.
你能提供下有dvb字幕的视频让我测试下吗?
from ksplayer.
我发了邮件到您的邮箱:[email protected],麻烦查收一下。
from ksplayer.
收到了。谢谢
from ksplayer.
我看你添加了 dvbs字幕支持,但是我更新了代码,还不能使用呢
from ksplayer.
是的,只是增加了dvbs格式的识别。但是这个解码还需要做特殊的处理,因为他是图片字幕跟之前的文字字幕不大一样。需要把流程改下。改动比较大。图片字幕的内存占用太高了。
from ksplayer.
可以借鉴下 VLC 播放器,辛苦。
from ksplayer.
字幕问题能解决吗?
from ksplayer.
这个问题还在改
from ksplayer.
Related Issues (20)
- Some TV runs black when switching between streams HOT 7
- 有没有计划支持libass字幕 HOT 5
- Player fails if played too early HOT 5
- 8K 视频播放闪退 HOT 2
- Tracy player does not play local files stored in iphone HOT 3
- Subtitles have been broken in this repo HOT 32
- This stream won't play, but works in VLC HOT 2
- Observe the `(Embed)` string attached straight away at the end of the subtitle's name. HOT 5
- It takes so long before the audio switches HOT 1
- tvos VideoSettingView 显示不正常 HOT 9
- App强制竖屏,全屏后自动判断视频比例决定宽度占满(竖屏)还是高度占满(横屏) HOT 2
- Multiple streams and audio session switch HOT 8
- Application hang when changing url too quickly HOT 3
- Large amount of crashes detected from Xcode in `Resample.swift` `audioFormat()`
- macOS Somona issue HOT 7
- Live stream freezes for many people HOT 13
- Crash in this library `partial apply for closure #1 in closure #1 in Double.init<A>` HOT 4
- Issue with uploading to apple : NSSpeechRecognitionUsageDescription
- - 增加音频转文字的功能 - feature HOT 2
- Constat crash HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ksplayer.