24 Commits

Author SHA1 Message Date
AFathi 850198ed7d v. 1.12 2017-11-20 23:21:45 -05:00
Ahmed Fathi Bekhit aebc1e303d Update README.md 2017-11-15 01:47:21 -05:00
Ahmed Fathi Bekhit 33ddee03ed Update README.md 2017-11-14 20:54:24 -05:00
Ahmed Fathi Bekhit 9b6edaacd7 Update README.md 2017-11-14 20:53:16 -05:00
Ahmed Fathi Bekhit 2c93b1585d Update README.md 2017-11-14 20:52:44 -05:00
Ahmed Fathi Bekhit a3cca1ba5b Update README.md 2017-11-10 22:04:23 -05:00
Ahmed Fathi Bekhit afee84b1bb Update README.md 2017-11-10 13:53:29 -05:00
AFathi 1e6217fcac Example update 2017-11-07 16:54:36 -05:00
AFathi 01dd05ed25 GIF capture improvements 2017-11-07 16:49:49 -05:00
AFathi bb3732f32a GIF capture improvements 2017-11-07 16:49:16 -05:00
AFathi 57381fd1f6 Improved Performance 2017-11-07 14:21:29 -05:00
AFathi 5a1fbe1b9a Improved Performance 2017-11-07 13:49:24 -05:00
AFathi a4c8c8b0cc Improved Performance 2017-11-07 13:49:03 -05:00
Ahmed Fathi Bekhit d618b3a570 Update README.md 2017-11-07 11:24:53 -05:00
Ahmed Fathi Bekhit c3fef201d8 Update README.md 2017-11-06 23:55:09 -05:00
Ahmed Fathi Bekhit a75a1e0895 Update README.md 2017-11-06 19:21:53 -05:00
Ahmed Fathi Bekhit 1544362fda Update README.md 2017-11-06 12:51:27 -05:00
AFathi 382192ce36 Updated README 2017-11-06 12:49:45 -05:00
AFathi 0d493645df Updated README 2017-11-06 12:49:14 -05:00
Ahmed Fathi Bekhit 8b1148ca81 Update README.md 2017-11-05 21:40:50 -05:00
AFathi bb5c31bf7b v. 1.04 2017-11-05 21:22:16 -05:00
AFathi daa7bcd7b4 v. 1.04 2017-11-05 21:18:54 -05:00
Ahmed Fathi Bekhit c976195885 Update README.md 2017-11-05 21:15:55 -05:00
AFathi 3645199f11 v. 1.04 2017-11-05 21:12:24 -05:00
19 changed files with 65 additions and 29 deletions
-1
View File
@@ -1 +0,0 @@
echo "4.0" > .swift-version
+6 -6
View File
@@ -8,6 +8,8 @@
/* Begin PBXBuildFile section */
FB2E368C1FAE2A510035B8D6 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = FB2E368B1FAE2A510035B8D6 /* LICENSE */; };
FBD3F1E61FB260B000327054 /* ARVideoKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FBD3F1E51FB260B000327054 /* ARVideoKit.framework */; };
FBD3F1E71FB260B000327054 /* ARVideoKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = FBD3F1E51FB260B000327054 /* ARVideoKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
FBDCC5E71FABDFC600E3184D /* Scene.sks in Resources */ = {isa = PBXBuildFile; fileRef = FBDCC5E51FABDFC500E3184D /* Scene.sks */; };
FBDCC5E81FABDFC600E3184D /* Scene.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBDCC5E61FABDFC500E3184D /* Scene.swift */; };
FBDCC60D1FABFE6A00E3184D /* SKViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBDCC60C1FABFE6A00E3184D /* SKViewController.swift */; };
@@ -17,8 +19,6 @@
FBE134BF1FAAD3DD00BEC469 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FBE134BD1FAAD3DD00BEC469 /* Main.storyboard */; };
FBE134C11FAAD3DD00BEC469 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FBE134C01FAAD3DD00BEC469 /* Assets.xcassets */; };
FBE134C41FAAD3DD00BEC469 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FBE134C21FAAD3DD00BEC469 /* LaunchScreen.storyboard */; };
FBED19011FAFF8D300D810BF /* ARVideoKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FBED19001FAFF8D300D810BF /* ARVideoKit.framework */; };
FBED19021FAFF8D300D810BF /* ARVideoKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = FBED19001FAFF8D300D810BF /* ARVideoKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
@@ -28,7 +28,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
FBED19021FAFF8D300D810BF /* ARVideoKit.framework in Embed Frameworks */,
FBD3F1E71FB260B000327054 /* ARVideoKit.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
@@ -37,6 +37,7 @@
/* Begin PBXFileReference section */
FB2E368B1FAE2A510035B8D6 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
FBD3F1E51FB260B000327054 /* ARVideoKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ARVideoKit.framework; path = Framework/ARVideoKit.framework; sourceTree = "<group>"; };
FBDCC5E51FABDFC500E3184D /* Scene.sks */ = {isa = PBXFileReference; lastKnownFileType = file.sks; path = Scene.sks; sourceTree = "<group>"; };
FBDCC5E61FABDFC500E3184D /* Scene.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Scene.swift; sourceTree = "<group>"; };
FBDCC60C1FABFE6A00E3184D /* SKViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SKViewController.swift; sourceTree = "<group>"; };
@@ -48,7 +49,6 @@
FBE134C01FAAD3DD00BEC469 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
FBE134C31FAAD3DD00BEC469 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
FBE134C51FAAD3DD00BEC469 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
FBED19001FAFF8D300D810BF /* ARVideoKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ARVideoKit.framework; path = Framework/ARVideoKit.framework; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -56,7 +56,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FBED19011FAFF8D300D810BF /* ARVideoKit.framework in Frameworks */,
FBD3F1E61FB260B000327054 /* ARVideoKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -66,7 +66,7 @@
FB2E37781FAFD5C20035B8D6 /* Frameworks */ = {
isa = PBXGroup;
children = (
FBED19001FAFF8D300D810BF /* ARVideoKit.framework */,
FBD3F1E51FB260B000327054 /* ARVideoKit.framework */,
);
name = Frameworks;
sourceTree = "<group>";
@@ -9,10 +9,10 @@
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<!--SCNViewController-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController storyboardIdentifier="scnView" useStoryboardIdentifierAsRestorationIdentifier="YES" id="BYZ-38-t0r" customClass="ViewController" customModule="ARVideoKit_Example" customModuleProvider="target" sceneMemberID="viewController">
<viewController storyboardIdentifier="scnView" title="SCNViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="BYZ-38-t0r" customClass="ViewController" customModule="ARVideoKit_Example" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -176,10 +176,10 @@
</objects>
<point key="canvasLocation" x="53.600000000000001" y="133.5832083958021"/>
</scene>
<!--View Controller-->
<!--SKViewController-->
<scene sceneID="emy-Ex-RPU">
<objects>
<viewController storyboardIdentifier="skView" useStoryboardIdentifierAsRestorationIdentifier="YES" id="7Ze-pj-Xqd" customClass="SKViewController" customModule="ARVideoKit_Example" customModuleProvider="target" sceneMemberID="viewController">
<viewController storyboardIdentifier="skView" title="SKViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="7Ze-pj-Xqd" customClass="SKViewController" customModule="ARVideoKit_Example" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="ChF-2c-u6U">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -341,7 +341,7 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="9if-am-XF6" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="836" y="134"/>
<point key="canvasLocation" x="730" y="134"/>
</scene>
</scenes>
</document>
@@ -45,6 +45,9 @@ class SKViewController: UIViewController, ARSKViewDelegate, RenderARDelegate, Re
// Set the renderer's delegate
recorder?.renderAR = self
// Configure the renderer to perform additional image & video processing 👁
//recorder?.onlyRenderWhileRecording = false
// Set the UIViewController orientations
recorder?.inputViewOrientations = [.landscapeLeft, .landscapeRight, .portrait]
@@ -41,9 +41,15 @@ class ViewController: UIViewController, ARSCNViewDelegate, RenderARDelegate, Rec
// Set the recorder's delegate
recorder?.delegate = self
// Set the renderer's delegate
recorder?.renderAR = self
// Configure the renderer to perform additional image & video processing 👁
//recorder?.onlyRenderWhileRecording = false
// Configure ARKit content mode. Default is .auto
//recorder?.contentMode = .aspectFit
// Set the UIViewController orientations
recorder?.inputViewOrientations = [.landscapeLeft, .landscapeRight, .portrait]
Binary file not shown.
@@ -204,7 +204,7 @@ SWIFT_MODULE_NAMESPACE_PUSH("ARVideoKit")
/// <a href="mailto:me@ahmedbekhit.com">Email</a>
/// </li>
/// </ul>
SWIFT_CLASS("_TtC10ARVideoKit15PHLivePhotoPlus")
SWIFT_CLASS("_TtC10ARVideoKit15PHLivePhotoPlus") SWIFT_AVAILABILITY(ios,introduced=9.1)
@interface PHLivePhotoPlus : PHLivePhoto
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
@@ -216,5 +216,7 @@ SWIFT_CLASS("_TtC10ARVideoKit15PHLivePhotoPlus")
SWIFT_MODULE_NAMESPACE_POP
#pragma clang diagnostic pop
@@ -2,7 +2,7 @@
// ARVideoKit.h
// ARVideoKit
//
// Created by Ahmed Bekhit on 11/5/17.
// Created by Ahmed Bekhit on 10/31/17.
// Copyright © 2017 Ahmed Fathi Bekhit. All rights reserved.
//
Binary file not shown.
+40 -14
View File
@@ -1,6 +1,8 @@
# ARVideoKit
An iOS Framework that enables developers to capture videos 📹, photos 🌄, Live Photos 🎇, and GIFs 🎆 with ARKit content.
In other words, you **NO LONGER** have to ~screen record~/~screenshot~ to capture videos 📹 and photos 🌄 of your awesome ARKit apps!
| Table of Contents | Description |
| ------------------ |:------------------:|
| [Documentation](https://github.com/AFathi/ARVideoKit/wiki) | Describes the configuration options `ARVideoKit` offers |
@@ -8,12 +10,13 @@ An iOS Framework that enables developers to capture videos 📹, photos 🌄, Li
| [Key Features](#key-features) | Lists the key features `ARVideoKit` offers |
| [Compatibility](#compatibility) | Describes the `ARVideoKit` device and iOS compatibality |
| [Example Project](#example-project) | Explains how to run the example project provided in this repository |
| [Installation](#installation) | Describes the [CocoaPods](#cocoapods) and [Manual](#manual) options to install `ARVideoKit` |
| [Installation](#installation) | Describes the [Manual](#manual) option to install `ARVideoKit` |
| [Implementation](#implementation) | Lists the [steps needed](#implementation), [notes](#note), and [reference](#youre-all-set-) for more options |
| [Publishing to the App Store](#publishing-to-the-app-store) | Describes the steps **required** before submitting an application using `ARVideoKit` to the App Store. |
| [License](#license) | Describes `ARVideoKit` license |
## Preview
|[Initialized with SpriteKit](https://github.com/AFathi/ARVideoKit/wiki/RecordAR#init-arspritekitarskview)👇 ‍‍‍‍‍‍ ‍‍ ‍‍ ‍‍‍‍‍‍ |[Initialized with SceneKit](https://github.com/AFathi/ARVideoKit/wiki/RecordAR#init-arscenekitarscnview) 👇 ‍‍‍‍‍‍ ‍‍ ‍‍ ‍‍‍‍‍‍ |
|👾 [Initialized with SpriteKit](https://github.com/AFathi/ARVideoKit/wiki/RecordAR#init-arspritekitarskview)👇 ‍‍‍‍‍‍ ‍‍ ‍‍ ‍‍‍‍‍‍ |🚀 [Initialized with SceneKit](https://github.com/AFathi/ARVideoKit/wiki/RecordAR#init-arscenekitarscnview) 👇 ‍‍‍‍‍‍ ‍‍ ‍‍ ‍‍‍‍‍‍ |
|--------------|--------------|
![SpriteKit Preview](http://www.ahmedbekhit.com/SK_PREV.gif) ![SceneKit Preview](http://www.ahmedbekhit.com/SCN_PREVIEW.gif)
@@ -30,7 +33,7 @@ An iOS Framework that enables developers to capture videos 📹, photos 🌄, Li
✅ [Returns](https://github.com/AFathi/ARVideoKit/wiki/RecordAR#var-onlyrenderwhilerecordingbool) rendered and raw buffers in a [protocol](https://github.com/AFathi/ARVideoKit/wiki/RecordAR#var-renderarrenderardelegate) [method](https://github.com/AFathi/ARVideoKit/wiki/RenderARDelegate#func-framedidrender-buffercvpixelbuffer-with-timecmtime-using-rawbuffercvpixelbuffer) for additional Image & Video processing
## Compatibility
`ARVideoKit` is compatible on iOS devices that support both [`ARKit`](https://developer.apple.com/documentation/arkit) and [`Metal`](https://developer.apple.com/documentation/metal). Check Apple's [iOS Device Compatibility Reference](#) for more information.
`ARVideoKit` is compatible on iOS devices that support both [`ARKit`](https://developer.apple.com/documentation/arkit) and [`Metal`](https://developer.apple.com/documentation/metal). Check Apple's [iOS Device Compatibility Reference](https://developer.apple.com/library/content/documentation/DeviceInformation/Reference/iOSDeviceCompatibility/DeviceCompatibilityMatrix/DeviceCompatibilityMatrix.html#//apple_ref/doc/uid/TP40013599-CH17-SW1) for more information.
`ARVideoKit` requires:
- iOS 11
@@ -39,16 +42,12 @@ An iOS Framework that enables developers to capture videos 📹, photos 🌄, Li
## Example Project
To try the example project, simply clone this repository and open `ARVideoKit-Example.xcodeproj` project file.
It's **recommended** to test `SKViewController` by assigning it as the initial view controller.
![is initial VC](http://ahmedbekhit.com/isinitialVC.png)
## Installation
### CocoaPods
Add this line to your `Podfile`
```
pod 'ARVideoKit'
```
_To install CocoaPods on your machine follow the [installation guide on their website](https://guides.cocoapods.org/using/getting-started.html)._
### Manual
Drag the `ARVideoKit.framework` file into your project then add ARVideoKit as an embedded binary of your targets.
Drag the `ARVideoKit.framework` file as an embedded binary of your project targets. `ARVideoKit.framework` can be found in the `/Framework/` folder of this repository.
![Tutorial](http://www.ahmedbekhit.com/arvideokit_install_new.gif)
## Implementation
1. `import ARVideoKit` in the application delegate `AppDelegate.swift` and a `UIViewController` with an `ARKit` scene.
@@ -87,14 +86,14 @@ recorder?.prepare(configuration)
recorder?.rest()
```
7. Call the [`record()`](https://github.com/AFathi/ARVideoKit/wiki/RecordAR#func-record) method in an appropriate method.
7. Call the [`record()`](https://github.com/AFathi/ARVideoKit/wiki/RecordAR#func-record) method in the proper method to start recording.
```
@IBAction func startRecording(_ sender: UIButton) {
recorder?.record()
}
```
8. Call the [`stopAndExport()`](https://github.com/AFathi/ARVideoKit/wiki/RecordAR#func-stopandexport_-finished-_-videopath-url-_-permissionstatusphauthorizationstatus-_-exportedbool---swiftvoid--nil) method in an appropriate method.
8. Call the [`stopAndExport()`](https://github.com/AFathi/ARVideoKit/wiki/RecordAR#func-stopandexport_-finished-_-videopath-url-_-permissionstatusphauthorizationstatus-_-exportedbool---swiftvoid--nil) method in the proper method to stop recording.
```
@IBAction func stopRecording(_ sender: UIButton) {
recorder?.stopAndExport()
@@ -114,10 +113,37 @@ Make sure you add the usage description of the `camera`, `microphone`, and `phot
<string>Audiovisual Recording</string>
```
![Info Plist Screenshot](http://www.ahmedbekhit.com/infoPlistUsage.png)
### You're all set. 🤓
Check [`RecordAR`](https://github.com/AFathi/ARVideoKit/wiki/RecordAR) documentation for more options!
## [License](#)
## Publishing to the App Store
Before publishing to the App Store make sure to add the [ARVideoKit License](#license) to your app licences list.
Additionally, you MUST **strip out the simulator architectures** from the framework before pushing an application to the App Store.
To do so, follow those steps:
1. Install Carthage
> Download `Carthage.pkg` [from here](https://github.com/Carthage/Carthage/releases)
> Or install with Homebrew using this command `brew install carthage`
2. Go to your project target's `Build Phase`
<img width="684" alt="screen shot 2017-11-14 at 8 21 44 pm" src="https://user-images.githubusercontent.com/4106695/32813978-e70ae5a0-c97a-11e7-9d19-3ef434e4c4f1.png">
3. Add a new `Run Script Phase`
<img width="686" alt="screen shot 2017-11-14 at 8 22 14 pm" src="https://user-images.githubusercontent.com/4106695/32814003-0ab4cffc-c97b-11e7-97d0-cf3143afec6d.png">
4. Add the following command to the `Run Script Phase`
```
/usr/local/bin/carthage copy-frameworks
```
<img width="676" alt="screen shot 2017-11-14 at 8 30 12 pm" src="https://user-images.githubusercontent.com/4106695/32814033-3302bece-c97b-11e7-867c-e8707ac7dd6b.png">
5. Finally, add `ARVideoKit.framework` file path as an `Input File`. In my case, I have it in a folder named `Frameworks` inside my project folder
<img width="672" alt="screen shot 2017-11-14 at 8 41 06 pm" src="https://user-images.githubusercontent.com/4106695/32814258-327bd048-c97c-11e7-8148-8d606d545214.png">
## [License](LICENSE)
Copyright 2017 Ahmed Fathi Bekhit
`ARVideoKit` is licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at