objective c - captureOutput:didOutputSampleBuffer:fromConnection: image buffer size is always 360x480 even on iPad -
I am using Is there any reason why the image buffer will be so small even on the iPad? quality If you want a capture resolution to match the screen resolution more closely, you will need to change the captureOutput: didOutputSampleBuffer: from connection: delegate
AVCaptureVideoDataOutput . While testing on the iPad, the image buffer size is always 360x480 which looks really awkward, I think it will be the size of the iPad screen. Capture Optical: (AVCaptureOutput *) Capture output output sample buffer: (CMSampleBufferRef) connection to sampleBuffer: (AVCaptureConnection *) connection {@autoreleasepool {CVImageBufferRef imageBuffer = CMSampleBufferGetImageBuffer (sampleBuffer); / * Image Buffer Lock * / CVPixelBufferLockBaseAddress (imageBuffer, 0); / * Get information about image * / uint8_t * baseAddress = (uint8_t *) CVPixelBufferGetBaseAddress (imageBuffer); Size_t byte paro = cvpx bufferget bitsprar (image buffer); Size_t width = CVPixelBufferGetWidth (imageBuffer); Size_t height = cvpxbuffergatehit (image buffer); Create a CGImageRef from / * CVImageBufferRef * / CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB (); CGContextRef newContext = CGBitmapContextCreate (baseadder, width, height, 8, byteper, colorspace, kCGITMAPbite order 32little; KCGImage olffectmilteploidfest); CGImageRef newImage = CGBitmapContextCreateImage (newContext); NSLog (@ "Image Size: H% Zoo, W% Zoo", Height, Width); / * We unlock image buffer * / CVPixelBufferUnlockBaseAddress (imageBuffer, 0); CGRcat zoom = CGRKMake (Self Touches Point I, Cetatouch Point.X, 120, 120); CGImageRef newImage2 = CGImageCreateWithImageInRect (newizes, zoom); / * We release some components * / CGT Tactical (New Contex); CGColorSpaceRelease (colorspace); UIImage * Zoom Image = [[UIImage alloc] initWithCGImage: newImage2 scale: 1.0 orientation: UIImageOrientationUp]; [Self. Zoomed view. Display PlayerInmineTrade: @Select Contents with Object: (__Bull ID) Zoom Image. CGI ImageUnitedDon: Yes]; CGImageRelease (newImage); CGImageRelease (newImage2); }} // And
sessionPreset is determined by the property, which is
AVCaptureSessionPresetHigh is the default for . There is no cure at the resolution of the screen on the capturing device; Capture quality is a function of the device's camera.
sessionPreset just note that any of the presents are made directly to any screen resolution Not compatible, but they are analogous to general video formats like VGA, 720p, 1080p:
NSString * const AVCaptureSessionPresetPhoto; NSSTING * CONST AVCaptureSessionPresetHigh; NSSTING * CONSTORE A VECTOR SURE PROCESS MEDIA; NSString * const AVCaptureSessionPresetLow; NSSTING * CONST AVCaptureSessionPreset352x288; NSSTING * CONSTORE A WEEKCHACHESCESS PRESETAT 640x480; NSSTING * CONST AVCaptureSessionPreset1280x720; NSSTING * CONST AVCaptureSessionPreset1920x1080; NSSTING * Constant receptacle display frame 960x540; NSSTING * CONSTE A WEEKING APPROVERSATION PROPATETIFF 1280x720;
Comments
Post a Comment