13 Commits

Author SHA1 Message Date
Ahmed Bekhit eddae7758c Update README.md 2019-03-06 10:38:52 -05:00
Ahmed Bekhit 08ad254271 Update README.md 2019-03-06 10:38:28 -05:00
Ahmed Bekhit 720c1af699 Update README.md 2019-03-06 10:36:55 -05:00
Ahmed Bekhit e134ab9792 Update README.md 2019-03-06 10:35:40 -05:00
Ahmed Bekhit e9c7cfaaca Update README.md 2019-03-01 17:07:27 -05:00
Ahmed Bekhit 2f40c3d9f0 Update README.md 2019-03-01 17:06:33 -05:00
Ahmed Bekhit de62d34b9e Update README.md 2019-02-20 14:23:55 -05:00
Ahmed Bekhit fe093e65d6 Update README.md 2019-02-20 14:23:07 -05:00
AFathi b05e744dc6 minor performance improvements 2019-01-12 21:32:35 -05:00
AFathi c51fc0db85 iPhone X+ fixes 2018-12-17 12:02:01 -05:00
AFathi 61415aa9aa iPhone X+ fixes 2018-12-17 12:01:35 -05:00
AFathi b89bd27d59 few changes 2018-12-17 11:58:01 -05:00
Ahmed Bekhit 6037aa9619 Update README.md 2018-09-20 12:03:54 -04:00
5 changed files with 26 additions and 16 deletions
+2
View File
@@ -93,7 +93,9 @@ struct RenderAR {
} else {
renderedFrame = renderEngine.snapshot(atTime: time, with: size, antialiasingMode: .none)
}
guard let buffer = renderedFrame!.buffer else { return nil }
return buffer
} else if view is ARSKView {
guard let size = bufferSize else { return nil }
+9 -8
View File
@@ -33,9 +33,9 @@ class WritAR: NSObject, AVCaptureAudioDataOutputSampleBufferDelegate {
do {
assetWriter = try AVAssetWriter(outputURL: output, fileType: AVFileType.mp4)
} catch {
// FIXME: handle when failed to allocate AVAssetWriter.
return
fatalError("An error occurred while intializing an AVAssetWriter")
}
if audioEnabled {
if allowMix {
let audioOptions: AVAudioSessionCategoryOptions = [.mixWithOthers , .allowBluetooth, .defaultToSpeaker, .interruptSpokenAudioAndMixWithOthers]
@@ -57,15 +57,15 @@ class WritAR: NSObject, AVCaptureAudioDataOutputSampleBufferDelegate {
AVVideoHeightKey: height as AnyObject
]
let attributes: [String: Bool] = [
kCVPixelBufferCGImageCompatibilityKey as String: true,
kCVPixelBufferCGBitmapContextCompatibilityKey as String: true
]
// let attributes: [String: Bool] = [
// kCVPixelBufferCGImageCompatibilityKey as String: true,
// kCVPixelBufferCGBitmapContextCompatibilityKey as String: true
// ]
videoInput = AVAssetWriterInput(mediaType: .video, outputSettings: videoOutputSettings)
videoInput.expectsMediaDataInRealTime = true
pixelBufferInput = AVAssetWriterInputPixelBufferAdaptor(assetWriterInput: videoInput, sourcePixelBufferAttributes: attributes)
pixelBufferInput = AVAssetWriterInputPixelBufferAdaptor(assetWriterInput: videoInput, sourcePixelBufferAttributes: nil)
var angleEnabled: Bool {
for v in orientaions {
if UIDevice.current.orientation.rawValue == v.rawValue {
@@ -141,6 +141,7 @@ class WritAR: NSObject, AVCaptureAudioDataOutputSampleBufferDelegate {
if session.canAddInput(audioDeviceInput!) {
session.addInput(audioDeviceInput!)
}
if session.canAddOutput(audioDataOutput) {
session.addOutput(audioDataOutput)
}
+2 -2
View File
@@ -34,11 +34,11 @@ private var renderer: RenderAR!
/**
An object that passes the AR recorder errors and status in the protocol methods.
*/
@objc public var delegate: RecordARDelegate?
@objc public weak var delegate: RecordARDelegate?
/**
An object that passes the AR rendered content in the protocol method.
*/
@objc public var renderAR: RenderARDelegate?
@objc public weak var renderAR: RenderARDelegate?
/**
An object that returns the AR recorder current status.
*/
@@ -418,7 +418,7 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = P5DZ3XQ9FJ;
DEVELOPMENT_TEAM = LXD85S9DW4;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
@@ -440,7 +440,7 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = P5DZ3XQ9FJ;
DEVELOPMENT_TEAM = LXD85S9DW4;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
+11 -4
View File
@@ -1,4 +1,7 @@
> An update for Swift 4.2 is coming soon :) -Ahmed
# Swift 4.0 Branch
> Use [swift_4_2](https://github.com/AFathi/ARVideoKit/tree/swift_4_2) branch for projects written in Swift 4.2
> [swift_4_2](https://github.com/AFathi/ARVideoKit/tree/swift_4_2) branch has been set as the default branch for `ARVideoKit` as of March 6th, 2019.
![intro image](http://www.ahmedbekhit.com/projects/repo-header-arvideokit.png)
@@ -71,11 +74,15 @@ github "AFathi/ARVideoKit" ~> 1.31
$ carthage update
```
### Manual
Drag the `ARVideoKit.framework` file as an embedded binary of your project targets. `ARVideoKit.framework` can be found in the `/Framework Build/` folder of this repository.
### ~Manual~ _Deprecated_
**If you're currently using the `.framework` file, I recommend to re-install the framework using one of the other installation options.**
~Drag the `ARVideoKit.framework` file as an embedded binary of your project targets. `ARVideoKit.framework` can be found in the `/Framework Build/` folder of this repository.~
![Tutorial](http://www.ahmedbekhit.com/arvideokit_install_new.gif)
Or you may drag `ARVideoKit.xcodeproj` into your project and click the **+** button in the embedded binaries section of your project's target.
### Manual (Supported)
Drag `ARVideoKit.xcodeproj` into your project and click the **+** button in the embedded binaries section of your project's target.
![example embed framework](http://www.ahmedbekhit.com/embeddedBinary.png)
## Implementation
### Swift