livekit / client-sdk-swift

LiveKit Swift Client SDK. Easily build live audio or video experiences on iOS, macOS, tvOS, and visionOS.
https://livekit.io
Apache License 2.0
195 stars 97 forks source link

Co-streaming Video Freezes with presetH216_169 CameraCaptureOption for Front Camera and When Moving App to Background #252

Open isandeepj opened 1 year ago

isandeepj commented 1 year ago

Describe the bug When using the presetH216_169 camera capture option with the front camera in co-streaming mode, the video freezes. The issue also arises when the co-streamer moves the application to the background and then brings it back to the foreground. However, when switching to the h360_169 setting, the video streams seamlessly

SDK Version

iOS Version

Steps to Reproduce

  1. Set up a co-streaming session using the presetH216_169 camera capture option for the front camera.
  2. Start the co-stream.
  3. Observe the freezing behavior of the video stream.
  4. Move the co-streamer app to the background and then bring it back to the foreground.
  5. Observe the video freezing behavior again.

Expected behavior The video should stream seamlessly without any freezes when using presetH216_169 and when transitioning the app between the foreground and background

Screenshots Screenshot 2023-09-21 at 7 22 57 PM Screenshot 2023-09-21 at 7 22 47 PM

Code Snippet

lazy var roomOptions: RoomOptions = {
    let cameraCaptureOptions = CameraCaptureOptions(position: .front, preferredFormat: nil, dimensions: VideoParameters.presetH216_169.dimensions, fps: VideoParameters.presetH216_169.encoding.maxFps)
    let options = RoomOptions(defaultCameraCaptureOptions: cameraCaptureOptions, adaptiveStream: false, dynacast: false)
    return options
}()
hiroshihorie commented 1 year ago

Are you using E2EE ?

isandeepj commented 1 year ago

No

hiroshihorie commented 1 year ago

Was this working in earlier versions but started happening recently ?

isandeepj commented 1 year ago

@hiroshihorie When using the presetH216_169 camera capture option with the front camera in co-streaming mode, the video freezes. The issue also arises when the co-streamer moves the application to the background and then brings it back to the foreground. However, when switching to the h360_169 setting, the video streams seamlessly

lazy var roomOptions: RoomOptions = {
    let cameraCaptureOptions = CameraCaptureOptions(position: .front, preferredFormat: nil, dimensions: VideoParameters.presetH216_169.dimensions, fps: VideoParameters.presetH216_169.encoding.maxFps)
    let options = RoomOptions(defaultCameraCaptureOptions: cameraCaptureOptions, adaptiveStream: false, dynacast: false)
    return options
}()
isandeepj commented 1 year ago

@hiroshihorie any update on this?