Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/99.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios AVCaptureStillImageOutput中NSData的压缩比是多少?_Ios - Fatal编程技术网

Ios AVCaptureStillImageOutput中NSData的压缩比是多少?

Ios AVCaptureStillImageOutput中NSData的压缩比是多少?,ios,Ios,使用jpegstillimagesdatarepresentation:方法可以从avcapurestillimagesoutput获取NSData,然后我可以将数据写入文件 NSData * imageData = [AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageSampleBuffer]; 只需imageSampleBuffer转到NSData。我能用这种方法得到压缩比吗,或者有什么指标可以衡量吗 与UI

使用
jpegstillimagesdatarepresentation
:方法可以从
avcapurestillimagesoutput
获取
NSData
,然后我可以将数据写入文件

NSData * imageData = [AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageSampleBuffer];
只需
imageSampleBuffer
转到
NSData
。我能用这种方法得到压缩比吗,或者有什么指标可以衡量吗


与UIImageJPEGRepresentation(UIImage*image,1.0)类似,它有1.0来测量图像的压缩比。

您可以控制AVCaptureStillImageOutput使用的压缩(0-1)

[stillImageOutput setOutputSettings:@{AVVideoCodecKey : AVVideoCodecJPEG, AVVideoQualityKey:@1.0}];
请参阅AVCaptureOutput.h和AVVideoSettings.h: iOS 6.0及更高版本支持AVVideoQualityKey,仅当AVVideoCodeKey设置为AVVideoCodeJPEG时才能使用。AVVideoQualityKey NSNumber(0.0-1.0,仅限JPEG)


通过查看不同值的数据大小,可以快速验证该键是否有效。至于默认值,我不认为它是1.0,因为当我将其设置为1.0时,大小会有点增大,并且我没有设置三脚架来尝试拍摄完全相同的图片……

您可以控制AVCaptureStillImageOutput使用的压缩(0-1)

[stillImageOutput setOutputSettings:@{AVVideoCodecKey : AVVideoCodecJPEG, AVVideoQualityKey:@1.0}];
请参阅AVCaptureOutput.h和AVVideoSettings.h: iOS 6.0及更高版本支持AVVideoQualityKey,仅当AVVideoCodeKey设置为AVVideoCodeJPEG时才能使用。AVVideoQualityKey NSNumber(0.0-1.0,仅限JPEG)


通过查看不同值的数据大小,可以快速验证该键是否有效。至于默认值,我不认为它是1.0,因为当我将其设置为1.0时,大小会有点增大,并且我没有设置三脚架来尝试拍摄完全相同的图片……

您可以控制AVCaptureStillImageOutput使用的压缩(0-1)

[stillImageOutput setOutputSettings:@{AVVideoCodecKey : AVVideoCodecJPEG, AVVideoQualityKey:@1.0}];
请参阅AVCaptureOutput.h和AVVideoSettings.h: iOS 6.0及更高版本支持AVVideoQualityKey,仅当AVVideoCodeKey设置为AVVideoCodeJPEG时才能使用。AVVideoQualityKey NSNumber(0.0-1.0,仅限JPEG)


通过查看不同值的数据大小,可以快速验证该键是否有效。至于默认值,我不认为它是1.0,因为当我将其设置为1.0时,大小会有点增大,并且我没有设置三脚架来尝试拍摄完全相同的图片……

您可以控制AVCaptureStillImageOutput使用的压缩(0-1)

[stillImageOutput setOutputSettings:@{AVVideoCodecKey : AVVideoCodecJPEG, AVVideoQualityKey:@1.0}];
请参阅AVCaptureOutput.h和AVVideoSettings.h: iOS 6.0及更高版本支持AVVideoQualityKey,仅当AVVideoCodeKey设置为AVVideoCodeJPEG时才能使用。AVVideoQualityKey NSNumber(0.0-1.0,仅限JPEG)


通过查看不同值的数据大小,可以快速验证该键是否有效。至于默认值,我不认为它是1.0,因为当我将它设置为1.0时,大小会有点增大,而且我没有设置三脚架来尝试拍摄完全相同的图片……

我想文档会告诉你:如果你不压缩图像,我会假设它是1.0。我同意,但这不是一个好答案。只是一个假设。或者可能是当我使用jpegStillImageNSDataRepresentation时:方法可以从AVCapureStillImageOutput获取NSData,它已经压缩了。我只是做了一个假设。我想文档告诉你:如果你没有压缩图像,我会假设它是1.0。我同意,但不是一个好的答案。只是一个假设。或者可能是当我使用jpegStillImageNSDataRepresentation:方法可以从AVCapureStillImageOutput获取NSData时,它已经压缩了。我只是做了一个假设。我想文档告诉你:如果你没有压缩图像,我会假设它是1.0。我同意,但不是一个好的答案。只是一个假设。或者可能是当我使用jpegStillImageNSDataRepresentation:方法可以从AVCapureStillImageOutput获取NSData时,它已经压缩了。我只是做了一个假设。我想文档告诉你:如果你没有压缩图像,我会假设它是1.0。我同意,但不是一个好的答案。只是一个假设。或者可能是当我使用jpegStillImageNSDataRepresentation:方法可以从AVCapureStillImageOutput获取NSData时,它已经压缩了。我只是做了个假设。