使用 LFLiveKit 捕获屏幕并流式传输到 rtmp 服务器

Capture screen and stream to rtmp server using LFLiveKit

我正在尝试使用 LFLiveKit sdk 将 rtmp 流发送到服务器。我试过这样流式传输像素缓冲区,

var Lsession: LFLiveSession = {
  let audioConfiguration = LFLiveAudioConfiguration.defaultConfiguration(for: LFLiveAudioQuality.high)
  let videoConfiguration = LFLiveVideoConfiguration.defaultConfiguration(for: LFLiveVideoQuality.low3)
  let session = LFLiveSession(audioConfiguration: audioConfiguration, videoConfiguration: videoConfiguration)
  return session!
}()

let stream = LFLiveStreamInfo()
stream.url = "rtmp://domain.com:1935/show/testS"
Lsession.pushVideo(frame.capturedImage)

如何使用屏幕截图初始化会话?有什么指点吗?

我必须像这样在会话初始化中设置捕获类型,

let session = LFLiveSession(audioConfiguration: audioConfiguration, videoConfiguration: videoConfigurationcaptureType: LFLiveCaptureTypeMask.inputMaskVideo)