Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Can I Record the Screen with Acceptable Performance While Keeping the UI Responsive?

I'm looking for help with a performance issue in an Objective-C based iOS app.

I have an iOS application that captures the screen's contents using CALayer's renderInContext method. It attempts to capture enough screen frames to create a video using AVFoundation. The screen recording is then combined with other elements for research purposes on usability. While the screen is being captured, the app may also be displaying the contents of a UIWebView, going out over the network to fetch data, etc... The content of the Web view is not under my control - it is arbitrary content from the Web.

This setup is working but as you might imagine, it's not buttery smooth. Since the layer must be rendered on the main thread, there's more UI contention than I'd like. What I'd like to do is to have a setup where the responsiveness of the UI is prioritized over the screen capture. For instance, if the user is scrolling the Web view, I'd rather drop frames on the recording than have a terrible scrolling experience.

I've experimented with several techniques, from dispatch_source coalescing to submitting the frame capture requests as blocks to the main queue to CADisplayLink. So far they all seem to perform about the same. The frame capture is currently being triggered in the drawRect of the screen's main view.

What I'm asking here is: given the above, what techniques would you suggest I try to achieve my goals? I realize the answer may be that there is no great answer... but I'd like to try anything, however wacky it might sound.

NOTE: Whatever techniques need to be App Store friendly. Can't use something like the CoreSurface hack that Display Recorder used/uses.

Thanks for your help!

like image 803
Hunter Avatar asked Jan 15 '13 17:01

Hunter


People also ask

How do I turn on the ability to screen record?

To record your screen on Android, swipe down on your display to show your Quick Settings, tap Screen Record, and hit the Screen Record option.

How do I record my screen on pull up menu?

Start by tapping on the Settings icon, then on Control Center to make sure that “Access Within Apps” is turned on. Next, tap on Customize Controls to see the list of available controls. Scroll down to the Screen Recording option and tap the green plus sign to add it to your Control Center.

How do you record your screen on Android with sound?

Android Screen RecorderPull down the notification shade from the top of the screen to view your quick settings options. Tap the Screen Recorder icon and give permission to the device to record the screen (you might have to edit the default icons that appear). Determine what sound, if any, you want recorded.


1 Answers

"Since the layer must be rendered on the main thread" this is not true, as long as you don't touch UIKit.

Please see https://stackoverflow.com/a/12844171/136305

like image 101
Deniz Mert Edincik Avatar answered Oct 16 '22 06:10

Deniz Mert Edincik