Camera's exposure was auto changed when I set custom mode - ios, objective-c -


i'm using avcapturedevice capture video frame image process , control exposure duration, iso using

setexposuremodecustomwithduration:(cmtime)duration iso:(float)iso completionhandler:(void (^)(cmtime synctime))handler 

and think keep exposure level setting.

when set mode avcaptureexposuremodecustom, can see preview image's brightness changed when move camera capture different position. (especially light dark side)

but when change exposure mode avcaptureexposuremodelocked, brightness fixed.

i have been check white-balance, focus, torchmode locked or disable, isadjustingexposure keeping false, , exposure duration , iso parameter not change during problem happening.

- (void) setcameraexposure:(cmtime)exposureduration iso:(int)iso {     [self.avsession beginconfiguration];      avcapturedevice *videodevice = [avcapturedevice defaultdevicewithmediatype:avmediatypevideo];      if (videodevice) {          [videodevice lockforconfiguration:nil];          // set exposure duration , iso in custom mode         if ([videodevice isexposuremodesupported:avcaptureexposuremodecustom]) {              [videodevice setexposuremodecustomwithduration:exposureduration                                                        iso:iso                                          completionhandler:nil];         }          // if use avcaptureexposuremodelocked, brightness fixed         //if ([videodevice isexposuremodesupported:avcaptureexposuremodelocked]) {         //    [videodevice setexposuremode:avcaptureexposuremodelocked];         //}          // lock white balance         if ([videodevice iswhitebalancemodesupported:avcapturewhitebalancemodelocked]) {             [videodevice setwhitebalancemode:avcapturewhitebalancemodelocked];         }          [videodevice unlockforconfiguration];     }      [self.avsession commitconfiguration]; } 

i want camera don't change brightness when using avcaptureexposuremodecustom, possible? i've tried multiple variations of this, none of them seem work. ideas?


Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -