简体   繁体   中英

Ios Screen Capture Yosemite

I have developed a mac application for Yosemite for IOS screen recording.The application mirrors the devices with MediaType Muxed like iPod and iphones to the Mac screen for recording along with a preview.The application works fine except that whenever I open the camera based applications on IOS device the preview starts lagging.

These are the frameworks that are used to implement the application:
AVFoundation
CoreMediaIO
Cocoa

To Implement the application:

1.Initially I had set the CoreMediaIO System Object's Property(Allow Screen capture devices) to 1 as specified in WWDC Video session 508 Camera Capture:Manual Controls in track media.This shows device with media type Muxed in the list of screen capture devices.

2.Than I have created a session along with the preview layer to show the preview and provided interfaces for recording.

Can anyone please help me to find a solution.

When you create a capture session using AVFoundation the payload coming out of the device is transcoded, assuming recent iOS device, the resolution is high and so is the CPU consumption req for transcoding, having high CPU consumption while transcoding can certainly cause the lagging, assuming that is the case, I would receommend you to Avoid transcoding al-together by directly using CoreMediaIO to intercept incoming h264 payload from the device, directly save it to the file when recording, and, devode it using eg. VideoToolBox for preview, this will req substantially less CPU and might resolve your problem.

  • See this link for details regarding VideoToolBox decoding
  • Check my Blog for CoreMediaIO capture examples

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM