flopr
flopr

Reputation: 450

Record iPhone/iPad screen from a OS X App just like QuickTime Player

I know it is possible to record iOS screen using QuickTime player. (iOS device appears as a camera)

Can I record the iOS screen using AVFoundation for Mac OS X?

I want to create an OS X app which can record iOS device screen.

Upvotes: 3

Views: 1164

Answers (1)

Marek H
Marek H

Reputation: 5576

Credit goes to NadavRub

Quoting from p28 of the PDF transcript for WWDC 2014 session #508 “Camera Capture: Manual Controls”:

iOS devices are presented as CoreMedia IO “DAL” plug-ins

You must opt in to see iOS screen devices in your OS X app

CMIOObjectPropertyAddress prop =
                           { kCMIOHardwarePropertyAllowScreenCaptureDevices,
                             kCMIOObjectPropertyScopeGlobal,
                             kCMIOObjectPropertyElementMaster };
UInt32 allow = 1;
CMIOObjectSetPropertyData( kCMIOObjectSystemObject,
                           &prop, 0, NULL,
                           sizeof(allow), &allow );

Also, see my blog for CoreMediaIO capture sample to directly intercept the raw compressed payload sent out from the device

Upvotes: 5

Related Questions