Skip to content

Commit 195816a

Browse files
committed
Decrease frame rate in screen sharing and add some comments
1 parent 8b9b835 commit 195816a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ScreenShare/SampleHandler.swift

+8
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,17 @@ class SampleHandler: RPBroadcastSampleHandler, AntMediaClientDelegate {
8282
self.client.setExternalVideoCapture(externalVideoCapture: true);
8383
}
8484

85+
//in some ipad versions, resolution/aspect ratio is critical to set, otherwise iOS encoder may not encode the frames and
86+
//server side reports publishTimeout because server cannot get the video frames
8587
self.client.setTargetResolution(width: 1280, height: 720);
88+
self.client.setMaxVideoBps(videoBitratePerSecond: 2000000)
8689

8790
self.client.setExternalAudio(externalAudioEnabled: true)
91+
92+
//In some devices iphone version, frames are dropped due to encoder queue and it causes glitches in the playback
93+
//Decreasing the fps provides a better playback expeience.
94+
//Alternatively, target resolution can be decreased above to let encoder work faster
95+
self.client.setTargetFps(fps: 10)
8896

8997
self.client.publish(streamId: streamId as! String);
9098

0 commit comments

Comments
 (0)