mediasoup-client-swift icon indicating copy to clipboard operation
mediasoup-client-swift copied to clipboard

Laggy video in iPhone

Open samchen7910 opened this issue 2 years ago • 3 comments

Firstly, thanks for the package, it's awesome. I'm facing an issue the video stream from iPhone is extremely laggy but iPad is working fine. with the same code.

iPhone 12 with iOS versions 15.5 and 16.6 iPad 2020 with iPadOS version 16.5.1

Pictures below show that when iPhone joins a room, the RAM goes up to 600mbs+, while iPad stays at 170mbs+ Screenshot 2023-08-08 at 14 38 12 Screenshot 2023-08-02 at 15 17 55

samchen7910 avatar Aug 08 '23 12:08 samchen7910

First guess is to check your video quality. iPhone camera native resolution and frame rate are really too much for realtime streaming, so you should set it thoughtfully. What resolution and frame rate do you capture from camera and what resolution (or resolutions) do you encode and stream?

Here are two runs of same code on same device I've just done, but with different video quality settings:

Screenshot 2023-08-08 at 22 04 38 Screenshot 2023-08-08 at 21 59 05

fedulvtubudul avatar Aug 08 '23 13:08 fedulvtubudul

Thanks for quick response @fedulvtubudul Here are the resolution and frame rate which I captured from iPhone's camera. In the encoding part, I leave it at Nil. This setup works well with the mediasoup_ios_client. Could you tell me which resolution, frame rate, and encoded resolution did you use?

Screenshot 2023-08-08 at 15 40 29 Screenshot 2023-08-08 at 15 39 37

samchen7910 avatar Aug 08 '23 14:08 samchen7910

640x360@20fps is not that much to be a problem. Have you tried to examine your app with Instruments and see where all the memory goes?

fedulvtubudul avatar Aug 16 '23 12:08 fedulvtubudul