Awalz / SwiftyCam

A Snapchat Inspired iOS Camera Framework written in Swift
BSD 2-Clause "Simplified" License
2.08k stars 326 forks source link

How to set Video capture Camera Frame #168

Open dheeraj9022 opened 6 years ago

dheeraj9022 commented 6 years ago

I am using swiftyCam on my iOS app . but my requirement is to add camera on the half of the screen . I am giving fix height width to camera controller it looks good but when I capture video it capture video in full screen.

ritikaEmilence commented 5 years ago

Any solution for this?

yangvz commented 5 years ago

AVFoundation only supports full-screen captures, so you must DIY.

  1. Add two opaque views on top of the preview view.
  2. Crop the captured image using the same dimensions of the opaque views.

Example: https://medium.com/@EldonChan/ios-creating-a-custom-camera-with-avfoundation-51cbcf548eed

AbdulRahman-Khursheed commented 3 years ago

https://github.com/Awalz/SwiftyCam/issues/143#issuecomment-377819982 solution provided here