• This repository has been archived on 13/Jun/2019
  • Stars
    star
    583
  • Rank 76,663 (Top 2 %)
  • Language
    Swift
  • License
    MIT License
  • Created about 9 years ago
  • Updated almost 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🐒📷 Camera engine for iOS, written in Swift, above AVFoundation. 🐒

cameraenginelogo

🌟 The most advanced Camera framework in Swift 🌟

License MIT  Carthage compatible  CocoaPods  Build Status CocoaPods  Support  codebeat badge  Donate

CameraEngine is an iOS camera engine library that allows easy integration of special capture features and camera customization in your iOS app.

🔥 Features

CameraEngine
☺️ Support iOS8 - iOS9
📐 Support orientation device
🏁 Fast capture
📷 Photo capture
🎥 Video capture
📈 quality settings presset video / photo capture
🙋 switch device (front, back)
💡 flash mode management
🔦 torch mode management
🔎 focus mode management
:bowtie: detection face, barecode, and qrcode
🚀 GIF encoder

🔨 Installation

CocoaPods

  • Add pod "CameraEngine" to your Podfile.
  • Run pod install or pod update.
  • import CameraEngine

Carthage

  • Add github "remirobert/CameraEngine" to your Cartfile.
  • Run carthage update and add the framework to your project.
  • import CameraEngine

Manually

  • Download all the files in the CameraEngine subdirectory.
  • Add the source files to your Xcode project.
  • import CameraEngine

To add the Framework, you can also create a workspace for your project, then add the CameraEngine.xcodeproj, and the CameraEngine, then you should be able to compile the framework, and import it in your app project.

CameraEngine supports swift3, see the development branch for a swift 3 integration.

🚀 Quick start

First let's init and start the camera session. You can call that in viewDidLoad, or in appDelegate.

override func viewDidLoad() {
  super.viewDidLoad()
  self.cameraEngine.startSession()
}

Next time to display the preview layer

override func viewDidLayoutSubviews() {
  let layer = self.cameraEngine.previewLayer
        
  layer.frame = self.view.bounds
  self.view.layer.insertSublayer(layer, atIndex: 0)
  self.view.layer.masksToBounds = true
}

Capture a photo

self.cameraEngine.capturePhoto { (image: UIImage?, error: NSError?) -> (Void) in
  //get the picture tooked in the 👉 image
}

Capture a video

private func startRecording() {
  guard let url = CameraEngineFileManager.documentPath("video.mp4") else {
    return
  }
            
  self.cameraEngine.startRecordingVideo(url, blockCompletion: { (url, error) -> (Void) in
  })
}

private func stopRecording() {
  self.cameraEngine.stopRecordingVideo()
}

Generate animated image GIF

guard let url = CameraEngineFileManager.documentPath("animated.gif") else {
  return
}
self.cameraEngine.createGif(url, frames: self.frames, delayTime: 0.1, completionGif: { (success, url) -> (Void) in
  //Do some crazy stuff here
})

🔧 configurations

CameraEngine, allows you to set some parameters, such as management of flash, torch and focus. But also on the quality of the media, which also has an impact on the size of the output file.

Flash

self.cameraEngine.flashMode = .On
self.cameraEngine.flashMode = .Off
self.cameraEngine.flashMode = .Auto

Torch

self.cameraEngine.torchMode = .On
self.cameraEngine.torchMode = .Off
self.cameraEngine.torchMode = .Auto

Focus

          |  CameraEngine focus

--------------------------|------------------------------------------------------------ .Locked | means the lens is at a fixed position .AutoFocus | means setting this will cause the camera to focus once automatically, and then return back to Locked .ContinuousAutoFocus | means the camera will automatically refocus on the center of the frame when the scene changes

self.cameraEngine.cameraFocus = .Locked
self.cameraEngine.cameraFocus = .AutoFocus
self.cameraEngine.cameraFocus = .ContinuousAutoFocus

Camera presset Photo

self.cameraEngine.sessionPresset = .Low
self.cameraEngine.sessionPresset = .Medium
self.cameraEngine.sessionPresset = .High
...

Camera presset Video

self.cameraEngine.videoEncoderPresset = .Preset640x480
self.cameraEngine.videoEncoderPresset = .Preset960x540
self.cameraEngine.videoEncoderPresset = .Preset1280x720
self.cameraEngine.videoEncoderPresset = .Preset1920x1080
self.cameraEngine.videoEncoderPresset = .Preset3840x2160

👀 Object detection

CameraEngine can detect faces, QRcodes, or barcode. It will return all metadata on each frame, when it detects something. To exploit you whenever you want later.

Set the detection mode

self.cameraEngine.metadataDetection = .Face
self.cameraEngine.metadataDetection = .QRCode
self.cameraEngine.metadataDetection = .BareCode
self.cameraEngine.metadataDetection = .None //disable the detection

exploiting face detection

self.cameraEngine.blockCompletionFaceDetection = { faceObject in
  let frameFace = (faceObject as AVMetadataObject).bounds
  self.displayLayerDetection(frame: frameFace)
}

exploiting code detection (barecode and QRCode)

self.cameraEngine.blockCompletionCodeDetection = { codeObject in
  let valueCode = codeObject.stringValue
  let frameCode = (codeObject as AVMetadataObject).bounds
  self.displayLayerDetection(frame: frameCode)
}

🚗💨 Example

You will find a sample project, which implements all the features of CameraEngine, with an interface that allows you to test and play with the settings. To run the example projet, run pod install, because it uses the current prod version of CameraEngine.

Contributors 🍻

License

This project is licensed under the terms of the MIT license. See the LICENSE file.

This project is in no way affiliated with Apple Inc. This project is open source under the MIT license, which means you have full access to the source code and can modify it to fit your own needs.

If you want to support the development of this library, feel free to Donate. Thanks to all contributors so far!

bannabot

More Repositories

1

Dotzu

📱👀 In-App iOS Debugging Tool With Enhanced Logging, Networking Info, Crash reporting And More.
Swift
1,797
star
2

RRTagController

🔦 RRTagController allows user to select tag and create new one.
Swift
226
star
3

RRMessageController

📱📝 RRMessageController is a UIViewController, allows you to write a message with photos as attachment.
Objective-C
216
star
4

Facemotion

👀 Face detection and recognition iOS app with OpenCV
Objective-C++
173
star
5

Kinder

👫 🔥 The basics of a Tinder-like swipeable cards interface controller
Swift
171
star
6

Tempo

⌚ Date and time manager for iOS/OSX written in Swift
Swift
151
star
7

TextDrawer

TextDrawer, is a UIView allows you to add text, with gesture, on UIView, or UIImage
Swift
106
star
8

Anim

👀 Animation library, using Core Animation. Designed for iOS.
Swift
83
star
9

Github-contributions

🐱 GitHub contributions app, for iOS, WatchOS, and OSX
Swift
75
star
10

RRMaterialNavigationBar

Custom UINavigationBar with Google Material style, for iOS written on Swift.
Swift
75
star
11

ProducthuntOSX

Product hunt application for OS X
Swift
61
star
12

Camembert

Use sqlite3 for iOS and OS X simply.
Swift
51
star
13

gif-creator-ios

iOS Application for create animated gif with the library photos
Objective-C
36
star
14

MVVMBaseProject

Base project to start new app (extremely) quickly, with MVVM architecture. 项目(使用MVVM结构)基于App极速启动
Swift
33
star
15

Crackers

Simple network library in Swift, for iOS and OSX
Swift
31
star
16

Suitchi

Custom Switch for iOS.
Swift
31
star
17

Dotzu-Objective-c

Dotzu Objective-c example project
Objective-C
30
star
18

RRCamera

RRCamera is a camera handler for iOS with crop feature.
Objective-C
26
star
19

RRFreeShadowsocks

iOS application to grab free configuration from free shadowsocks. And generate configuration line for the Surge iOS app.
Swift
23
star
20

foursquare-kit-ios

Foursquare Kit is a native SDK to include Foursquare API inside mobile apps.
Swift
19
star
21

rocko

🐶 Small, and basic http server, written in full C 🐸
C
19
star
22

EchoBLE

BLE sniffer iOS app using CoreBluetooth.
Swift
17
star
23

RRCustomPageController

Custom PageViewController for iOS
Objective-C
14
star
24

Splime

Splime, is a tool, lets you to split a video into frames.
Swift
11
star
25

AppCoordinator-Segue

AppCoordinator architecture with support of segue.
Swift
11
star
26

BaoMonkey

iOS game.
Objective-C
10
star
27

digital-ocean-messenger-bot

🐬💦 Digital Ocean bot for Facebook Messenger platform :octocat:
JavaScript
10
star
28

giphy-OSX-client

OSX native application to search and visualise animated GIFs from http://giphy.com 🐶
Swift
7
star
29

LoginProvider

LoginProvider abstraction to login with services. RxSwift
Swift
7
star
30

RRDownloadFile

Download file from URL for iOS 7.X
Swift
6
star
31

Naruto-shippuden-iOS

Application iOS, for download and watch Naruto shippuden anime
Objective-C
6
star
32

RROLoadSwizzle

Method swizzling, change the implementation of an existing selector.
Objective-C
6
star
33

RRSoundStatic

Library to manage communication with ultra sound on iOS
Objective-C
6
star
34

CoffeeShopFinder

My very first React Native application iOS / Android
JavaScript
6
star
35

CoreLocationProvider

CoreLocation subscription provider.
Swift
6
star
36

venuesGenerator

Generator of venues, for random data (restaurant, bar, etc), provided by the foursquare API.
JavaScript
6
star
37

RRColorAverageBanner

Banner with color average of a UIImage, inside a UIImageView for display a title or something else.
Objective-C
6
star
38

MNIST-machine-learning

Mydrive hackday machine learning MNIST with data set, iOS client for drawing prediction
Swift
5
star
39

SignalAnalyser

Signal analyser Android application.
Java
5
star
40

LocationKit

Location wrapper around CoreLocation in swift.
Swift
5
star
41

Loop

Handle repetitive loop on iOS easily.
Swift
4
star
42

DigitalOcean

DigitalOcean for python3.4
Python
4
star
43

BlinkiOS

blink iOS app
Swift
4
star
44

SpeedBox

Dropbox, but faster. Written in Node.js
JavaScript
4
star
45

RRGIFAlertPanel

:shipit: Xcode plugin for replace the AlertPanel build succeeded and failed by an animated GIF of your choice !
Objective-C
4
star
46

ObjExporter

Export obj file from a SCNScene in SceneKit
Objective-C
3
star
47

emacs-config

Emacs 24 configuration
Emacs Lisp
3
star
48

RRVideoKit

Librairy, to create a video from UIImage list. With options like repeat frames, and mirroring
Objective-C
3
star
49

WaitBlock

Simple utility for only executing code when you want.
Swift
3
star
50

list

Static library list in C
C
3
star
51

Anime-scrapping

Node.js app to scrap anime download links.
JavaScript
3
star
52

MyMakefile

Makefile for Objective-C, C, C++
2
star
53

ImageDownloader

UIImage downloader from url with cache.
Swift
2
star
54

Fruity

Fruity, custom Xcode template theme.
2
star
55

corewar

Core War personal implementation
C
2
star
56

Color

Swift package to manage AINSI color on terminal
Swift
2
star
57

NotificationObserver

NotificationObserver
Swift
2
star
58

RRLocationManager

Helper Core location with geocoder Swift
Swift
1
star
59

FrogGame

frogGame iOS
Objective-C
1
star
60

MyCurrency

Currency app test
Swift
1
star
61

adok-iOS

iOS application for Adok.
Swift
1
star
62

remirobert.github.io

Personal web site
JavaScript
1
star
63

metasearch-engine

metasearch engine
Python
1
star
64

42sh

unix shell
C
1
star
65

AndroidApp

First android app
Java
1
star
66

TransitionViewController

TransitionViewController is the portage of RRCustomPageController for Swift.
Swift
1
star
67

Gifzat

media creation app
Objective-C
1
star
68

list-ocaml

Recode of the list in Ocaml
OCaml
1
star
69

WechatExample

Wechat SDK
Objective-C
1
star
70

randAlpha

My first iOS application.
Objective-C
1
star
71

go-mobile-twitter-stream

Golang mobile experimentation on iOS. Simple twitter stream client
Swift
1
star
72

EpiDroid

Android app
Java
1
star
73

test-restaurant

Swift
1
star
74

Rentster

iOS app
Objective-C
1
star
75

wegif

iOS app 🐸
Swift
1
star
76

CriminalIntent

:🤖: Android application.
Java
1
star
77

Guess-who

Web application for an educational HACKATON 2014.
JavaScript
1
star