二次元直播 - 虛擬主播與 ReplayKit 的邂逅 - Han Chang === {%hackmd FGRWt1UuTFKk0wSbGgg-SA %} ## YouTube {%youtube OV1TJpOsafA %} ## Slide {%slideshare ChiaHanChang/replay-kit %} 使用 ReplayKit 將螢幕影像與聲音推流 ## 大綱 17 直撥推流架構 螢幕直播推流架構 實作螢幕直撥遇到的問題 ## 17 直播推流架構 原本的架構:直播主推到server server再推給觀眾 Server Clusters: 多台server做負載平衡,以及分散式運算  ### 主播端:客製化的LFLiveKit Fork 上面的分支,進行客製化的需求(如混音,濾鏡)  ## 螢幕直播推流架構 使用App Entension, 無法單獨安裝,但是可以獨立開啟  ## 實作螢幕直撥遇到的問題 ### extenstion 如何與 app 溝通 * NSUserDefault * CFNotoficationCenter ### 觀眾聽不到主播的聲音 * 混音: 以App Audio為主,因為錄製的時候有可能麥克風沒有開啟  ### ㄧ 有聲音但是畫面卡頓 * call back 的頻率是0.5秒,導致處理聲音的時間太久 * 解決方法 為聲音做不同的time stamp ### 螢幕轉橫就跑版了 * 螢幕方向資訊 * CMSampleBufferRef * RPVideoSampleOrientationKey * CGImagePropertyOrientation  * 限制使用者版本為iOS 11以上,才能知道使用者的螢幕轉向了 ## 總結 * Server Clusters * ReplayKit 2 (Broadcast Upload Extension) * LFLiveKit ## Reference * [Replaykit](https://developer.apple.com/documentation/replaykit) * [LFLiveKit](https://github.com/LaiFengiOS/LFLiveKit) ###### tags:`iPlayground2019`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up