Giter Site home page Giter Site logo

sajjon / arvideokit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from afathi/arvideokit

0.0 2.0 0.0 4.17 MB

Capture & record ARKit videos ๐Ÿ“น, photos ๐ŸŒ„, Live Photos ๐ŸŽ‡, and GIFs ๐ŸŽ†.

License: Apache License 2.0

Swift 75.93% Objective-C 24.07%

arvideokit's Introduction

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 Describes the configuration options ARVideoKit offers
Preview Displays 2 GIF images captured using the supported gif method in ARVideoKit
Key Features Lists the key features ARVideoKit offers
Compatibility Describes the ARVideoKit device and iOS compatibality
Example Project Explains how to run the example project provided in this repository
Installation Describes the Manual option to install ARVideoKit
Implementation Lists the steps needed, notes, and reference for more options
Publishing to the App Store Describes the steps required before submitting an application using ARVideoKit to the App Store.
License Describes ARVideoKit license

Preview

๐Ÿ‘พ Initialized with SpriteKit๐Ÿ‘‡ โ€โ€โ€โ€โ€โ€ โ€โ€ โ€โ€ โ€โ€โ€โ€โ€โ€ โ€โ€ โ€โ€โ€โ€โ€โ€ โ€โ€ โ€โ€โ€โ€โ€โ€ โ€โ€ โ€โ€โ€โ€โ€โ€ โ€โ€ โ€โ€โ€โ€โ€โ€ โ€โ€ โ€โ€โ€โ€โ€โ€ โ€โ€ โ€โ€โ€โ€โ€โ€ โ€โ€ โ€โ€โ€โ€โ€โ€ โ€โ€ โ€โ€โ€โ€โ€โ€ โ€โ€ โ€โ€โ€โ€โ€โ€ โ€โ€ โ€โ€โ€โ€โ€โ€ โ€โ€ โ€โ€โ€โ€โ€โ€ โ€โ€ ๐Ÿš€ Initialized with SceneKit ๐Ÿ‘‡ โ€โ€โ€โ€โ€โ€ โ€โ€ โ€โ€ โ€โ€โ€โ€โ€โ€ โ€โ€ โ€โ€โ€โ€โ€โ€ โ€โ€ โ€โ€โ€โ€โ€โ€ โ€โ€ โ€โ€โ€โ€โ€โ€ โ€โ€ โ€โ€โ€โ€โ€โ€ โ€โ€ โ€โ€โ€โ€โ€โ€ โ€โ€ โ€โ€โ€โ€โ€โ€ โ€โ€ โ€โ€โ€โ€โ€โ€ โ€โ€ โ€โ€โ€โ€โ€โ€ โ€โ€ โ€โ€โ€โ€โ€โ€ โ€โ€ โ€โ€ โ€โ€โ€โ€โ€โ€ โ€โ€

SpriteKit Preview SceneKit Preview

Key Features

โœ… Capture Photos from ARSCNView and ARSKView

โœ… Capture Live Photos & GIFs from ARSCNView and ARSKView

โœ… Record Videos from ARSCNView and ARSKView

โœ… Pause/Resume video

โœ… Allow device's Music playing in the background while recording a video

โœ… Returns rendered and raw buffers in a protocol method for additional Image & Video processing

Compatibility

ARVideoKit is compatible on iOS devices that support both ARKit and Metal. Check Apple's iOS Device Compatibility Reference for more information.

ARVideoKit requires:

  • iOS 11
  • Swift 3.2 or higher

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

Installation

Manual

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

Implementation

  1. import ARVideoKit in the application delegate AppDelegate.swift and a UIViewController with an ARKit scene.

  2. In the application delegate AppDelegate.swift, add this ๐Ÿ‘‡ in order to allow the framework access and identify the supported device orientations. Recommended if the application supports landscape orientations.

func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
return ViewAR.orientation
}
  1. In the selected UIViewController class, create an optional type RecordAR global variable.
var recorder:RecordAR?
  1. Initialize RecordAR with ARSCNView or ARSKView. Recommended to initialize in viewDidLoad().

Initializing RecordAR with ARSCNView

recorder = RecordAR(ARSceneKit: sceneView)

Initializing RecordAR with ARSKView

recorder = RecordAR(ARSpriteKit: SKSceneView)
  1. Call the prepare() method in viewWillAppear(_ animated: Bool)
let configuration = ARWorldTrackingConfiguration()
recorder?.prepare(configuration)
  1. Call the rest() method in viewWillDisappear(_ animated: Bool)
recorder?.rest()
  1. Call the record() method in the proper method to start recording.
@IBAction func startRecording(_ sender: UIButton) {
recorder?.record()
}
  1. Call the stopAndExport() method in the proper method to stop recording.
@IBAction func stopRecording(_ sender: UIButton) {
recorder?.stopAndExport()
}

NOTE

Make sure you add the usage description of the camera, microphone, and photo library in the app's Info.plist.

<key>NSCameraUsageDescription</key>
<string>AR Camera</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Export AR Media</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Export AR Media</string>
<key>NSMicrophoneUsageDescription</key>
<string>Audiovisual Recording</string>

Info Plist Screenshot

You're all set. ๐Ÿค“

Check RecordAR documentation for more options!

Publishing to the App Store

Before publishing to the App Store make sure to add the ARVideoKit 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

Or install with Homebrew using this command brew install carthage

  1. Go to your project target's Build Phase

screen shot 2017-11-14 at 8 21 44 pm

  1. Add a new Run Script Phase

screen shot 2017-11-14 at 8 22 14 pm

  1. Add the following command to the Run Script Phase
/usr/local/bin/carthage copy-frameworks

screen shot 2017-11-14 at 8 30 12 pm

  1. 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

screen shot 2017-11-14 at 8 41 06 pm

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

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.