swift - Quality: Custom AVFoundation Camera App VS. iOS standard Camera App -


i have performed number of tests using various subjects , lighting. each test shows standard ios camera app quality being superior (colors not washed out, better focus, better lighting, less grainy) custom avfoundation based app. cannot account huge differences. below example screen capture video taken both methods (using front camera).

ios standard camera app enter image description here

custom avfoundation recorded video enter image description here

code custom implementation:

let chosencameratype = avcapturedeviceposition.front  //get camera let devices = avcapturedevice.devices() device in devices {     if (!device.hasmediatype(avmediatypevideo))     {         continue     }      if (device.position != chosencameratype)     {         continue     }      camera = (device as? avcapturedevice)! }  {     capturesession = avcapturesession()     capturesession!.sessionpreset = avcapturesessionpresethigh            let video = try avcapturedeviceinput(device: camera) avcapturedeviceinput     capturesession!.addinput(video)      let audio = try avcapturedeviceinput(device: avcapturedevice.defaultdevicewithmediatype(avmediatypeaudio)) avcapturedeviceinput     capturesession!.addinput(audio)      fileoutput = avcapturemoviefileoutput()     capturesession?.addoutput(fileoutput)      capturesession!.startrunning()      let documentspath = nssearchpathfordirectoriesindomains(.documentdirectory, .userdomainmask, true)[0] nsstring      let name = string(uint64(nsdate().timeintervalsince1970 * 1000))     fileoutput?.startrecordingtooutputfileurl(nsurl(fileurlwithpath: "\(documentspath)/" + name + ".mov"), recordingdelegate: self) } catch let error nserror {     print(error) } 

please try! see difference, too...


Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

Swift game error message -