Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decrease frame rate in screen sharing and add some comments #59

Merged
merged 1 commit into from
Dec 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ScreenShare/SampleHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,17 @@ class SampleHandler: RPBroadcastSampleHandler, AntMediaClientDelegate {
self.client.setExternalVideoCapture(externalVideoCapture: true);
}

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

self.client.setExternalAudio(externalAudioEnabled: true)

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

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

Expand Down