{"id":1217,"url":"https://github.com/remirobert/CameraEngine","last_synced_at":"2025-07-30T20:32:46.432Z","repository":{"id":56905586,"uuid":"42300503","full_name":"remirobert/CameraEngine","owner":"remirobert","description":":monkey::camera: Camera engine for iOS, written in Swift, above AVFoundation. :monkey:","archived":true,"fork":false,"pushed_at":"2019-01-16T01:36:38.000Z","size":186,"stargazers_count":585,"open_issues_count":42,"forks_count":106,"subscribers_count":22,"default_branch":"master","last_synced_at":"2024-11-14T16:26:41.131Z","etag":null,"topics":["camera","capture","detection","image","photo-capture","video"],"latest_commit_sha":null,"homepage":"https://github.com/remirobert/CameraEngine","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/remirobert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-11T09:43:46.000Z","updated_at":"2024-11-07T05:28:17.000Z","dependencies_parsed_at":"2022-08-21T02:20:48.849Z","dependency_job_id":null,"html_url":"https://github.com/remirobert/CameraEngine","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remirobert%2FCameraEngine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remirobert%2FCameraEngine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remirobert%2FCameraEngine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remirobert%2FCameraEngine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remirobert","download_url":"https://codeload.github.com/remirobert/CameraEngine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228187578,"owners_count":17882328,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["camera","capture","detection","image","photo-capture","video"],"created_at":"2024-01-05T20:15:41.494Z","updated_at":"2024-12-04T20:31:06.465Z","avatar_url":"https://github.com/remirobert.png","language":"Swift","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=2MUNQRB8KTSM8"],"categories":["Hardware"],"sub_categories":["Camera","Other free courses"],"readme":"![cameraenginelogo](https://cloud.githubusercontent.com/assets/3276768/13000720/df3ec444-d1b1-11e5-9312-e70dabafa2f1.png)\n\n\u003ch3 align=\"center\"\u003e🌟 The most advanced Camera framework in \u003cstrong\u003eSwift\u003c/strong\u003e 🌟\u003c/h1\u003e\n\n[![License MIT](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://raw.githubusercontent.com/remirobert/CameraEngine/master/LICENSE)\u0026nbsp;\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\u0026nbsp;\n[![CocoaPods](http://img.shields.io/cocoapods/v/CameraEngine.svg?style=flat)](http://cocoapods.org/?q=CameraEngine)\u0026nbsp;\n[![Build Status](https://travis-ci.org/remirobert/CameraEngine.svg?branch=master)](https://travis-ci.org/remirobert/CameraEngine)\n[![CocoaPods](http://img.shields.io/cocoapods/p/CameraEngine.svg?style=flat)](http://cocoapods.org/?q=CameraEngine)\u0026nbsp;\n[![Support](https://img.shields.io/badge/support-iOS%208%2B%20-blue.svg?style=flat)](https://www.apple.com/nl/ios/)\u0026nbsp;\n[![codebeat badge](https://codebeat.co/badges/fcf16e2f-fe4e-4d4d-abb4-968e71c7d9f2)](https://codebeat.co/projects/github-com-remirobert-cameraengine)\u0026nbsp;\n[![Donate](http://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=2MUNQRB8KTSM8 \"Donate\")\n\n**CameraEngine** *is an iOS camera engine library that allows easy integration of special capture features and camera customization in your iOS app.*\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src =\"https://cloud.githubusercontent.com/assets/3276768/14136235/579a1a2c-f694-11e5-8bce-f784884da8ea.png\"/\u003e\n\u003c/p\u003e\n\n## :fire: Features\n\n|         | CameraEngine  |\n----------|-----------------\n:relaxed: | Support iOS8 - iOS9\n:triangular_ruler: | Support orientation device\n:checkered_flag: | Fast capture\n:camera: | Photo capture\n:movie_camera: | Video capture\n:chart_with_upwards_trend: | quality settings presset video / photo capture\n:raising_hand: | switch device (front, back)\n:bulb: | flash mode management\n:flashlight: | torch mode management\n:mag_right: | focus mode management\n:bowtie: | detection face, barecode, and qrcode\n:rocket: | GIF encoder\n\n## 🔨 Installation\n\n#### CocoaPods\n\n- Add `pod \"CameraEngine\"` to your Podfile.\n- Run `pod install` or `pod update`.\n- import CameraEngine\n\n\n#### Carthage\n\n- Add `github \"remirobert/CameraEngine\"` to your Cartfile.\n- Run `carthage update` and add the framework to your project.\n- import CameraEngine\n\n\n#### Manually\n\n- Download all the files in the CameraEngine subdirectory.\n- Add the source files to your Xcode project.\n- import CameraEngine\n\n\nTo 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.\n\n**CameraEngine** supports *swift3*, see the development branch for a swift 3 integration.\n\n## :rocket: Quick start\n\n\u003e First let's init and start the camera session. You can call that in viewDidLoad, or in appDelegate.\n\n```Swift\noverride func viewDidLoad() {\n  super.viewDidLoad()\n  self.cameraEngine.startSession()\n}\n```\n\u003e Next time to display the preview layer\n\n```Swift\noverride func viewDidLayoutSubviews() {\n  let layer = self.cameraEngine.previewLayer\n        \n  layer.frame = self.view.bounds\n  self.view.layer.insertSublayer(layer, atIndex: 0)\n  self.view.layer.masksToBounds = true\n}\n```\n\n\u003e Capture a photo\n\n```Swift\nself.cameraEngine.capturePhoto { (image: UIImage?, error: NSError?) -\u003e (Void) in\n  //get the picture tooked in the 👉 image\n}\n```\n\n\u003e Capture a video\n\n```Swift\nprivate func startRecording() {\n  guard let url = CameraEngineFileManager.documentPath(\"video.mp4\") else {\n    return\n  }\n            \n  self.cameraEngine.startRecordingVideo(url, blockCompletion: { (url, error) -\u003e (Void) in\n  })\n}\n\nprivate func stopRecording() {\n  self.cameraEngine.stopRecordingVideo()\n}\n```\n\n\u003e Generate animated image GIF\n\n```swift\nguard let url = CameraEngineFileManager.documentPath(\"animated.gif\") else {\n  return\n}\nself.cameraEngine.createGif(url, frames: self.frames, delayTime: 0.1, completionGif: { (success, url) -\u003e (Void) in\n  //Do some crazy stuff here\n})\n```\n\n## :wrench: configurations\n\nCameraEngine, 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. \n\n\u003e Flash\n\n```swift\nself.cameraEngine.flashMode = .On\nself.cameraEngine.flashMode = .Off\nself.cameraEngine.flashMode = .Auto\n```\n\n\u003e Torch\n\n```swift\nself.cameraEngine.torchMode = .On\nself.cameraEngine.torchMode = .Off\nself.cameraEngine.torchMode = .Auto\n```\n\n\u003e Focus\n\n              |  CameraEngine focus\n--------------------------|------------------------------------------------------------\n.Locked | means the lens is at a fixed position\n.AutoFocus | means setting this will cause the camera to focus once automatically, and then return back to Locked\n.ContinuousAutoFocus | means the camera will automatically refocus on the center of the frame when the scene changes\n\n```swift\nself.cameraEngine.cameraFocus = .Locked\nself.cameraEngine.cameraFocus = .AutoFocus\nself.cameraEngine.cameraFocus = .ContinuousAutoFocus\n```\n\n\u003e Camera presset Photo\n\n```swift\nself.cameraEngine.sessionPresset = .Low\nself.cameraEngine.sessionPresset = .Medium\nself.cameraEngine.sessionPresset = .High\n...\n```\n\n\u003e Camera presset Video\n\n```swift\nself.cameraEngine.videoEncoderPresset = .Preset640x480\nself.cameraEngine.videoEncoderPresset = .Preset960x540\nself.cameraEngine.videoEncoderPresset = .Preset1280x720\nself.cameraEngine.videoEncoderPresset = .Preset1920x1080\nself.cameraEngine.videoEncoderPresset = .Preset3840x2160\n```\n\n## :eyes: Object detection\n\nCameraEngine 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.\n\n\u003e Set the detection mode\n\n```swift\nself.cameraEngine.metadataDetection = .Face\nself.cameraEngine.metadataDetection = .QRCode\nself.cameraEngine.metadataDetection = .BareCode\nself.cameraEngine.metadataDetection = .None //disable the detection\n```\n\u003e exploiting face detection\n\n```swift\nself.cameraEngine.blockCompletionFaceDetection = { faceObject in\n  let frameFace = (faceObject as AVMetadataObject).bounds\n  self.displayLayerDetection(frame: frameFace)\n}\n```\n\n\u003e exploiting code detection (barecode and QRCode)\n\n```swift\nself.cameraEngine.blockCompletionCodeDetection = { codeObject in\n  let valueCode = codeObject.stringValue\n  let frameCode = (codeObject as AVMetadataObject).bounds\n  self.displayLayerDetection(frame: frameCode)\n}\n```\n\n## :car::dash: Example\n\nYou 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.\nTo run the example projet, run `pod install`, because it uses the current prod version of CameraEngine.\n\n\u003cimg src=\"http://i.giphy.com/mMkiMqylxW2bK.gif\" /\u003e\n\n## Contributors 🍻\n\n - [eyaldar](https://github.com/eyaldar)\n - [davidlondono](https://github.com/davidlondono)\n - [patthehuman](https://github.com/patthehuman)\n - [jnoh](https://github.com/jnoh)\n\n## License\nThis project is licensed under the terms of the MIT license. See the LICENSE file.\n\n\u003e 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.\n\nIf you want to support the development of this library, feel free to\n[![Donate](http://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=2MUNQRB8KTSM8 \"Donate\"). Thanks to all contributors so far!\n\n![bannabot](https://cloud.githubusercontent.com/assets/3276768/13000776/da960a14-d1b2-11e5-849f-d0f0703b8aa2.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremirobert%2FCameraEngine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremirobert%2FCameraEngine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremirobert%2FCameraEngine/lists"}