低,中,高的AVCaptureSession设置,它们各自代表什么?

时间:2012-09-02 23:39:20

标签: iphone objective-c ios ipad

我的应用会录制视频,并使用设置来设置要录制的质量。 我想知道是否有人知道他们各自代表什么分辨率?

低似乎很小而且毫无价值。

虽然很高,但这些录音的文件大小非常高。

if (appDelegate.vidRes == 1)
{
    NSLog(@"******   >>>>> SETTING VIDEO RES TO LOW <<<<<   *******");
    [session setSessionPreset: AVCaptureSessionPresetLow];
}
else if (appDelegate.vidRes == 2)
{
    NSLog(@"******   >>>>> SETTING VIDEO RES TO MED <<<<<   *******");
    [session setSessionPreset: AVCaptureSessionPresetMedium];
}
else
{
    NSLog(@"******   >>>>> SETTING VIDEO RES TO HIGH <<<<<   *******");
    [session setSessionPreset: AVCaptureSessionPresetHigh];
}

我想找到Low的一些不错的替代品,它的质量太低了。而且质量太高了。

1 个答案:

答案 0 :(得分:23)

Preset                          3G       3GS    4 back      4 front

AVCaptureSessionPresetHigh    400x304  640x480  1280x720    640x480
AVCaptureSessionPresetMedium  400x304  480x360  480x360     480x360
AVCaptureSessionPresetLow     400x306  192x144  192x144     192x144
AVCaptureSessionPreset640x480   NA     640x480  640x480     640x480
AVCaptureSessionPreset1280x720  NA       NA     1280x720    NA
AVCaptureSessionPresetPhoto     NA       NA     NA          NA

来源:http://cmgresearch.blogspot.com/2010/10/augmented-reality-on-iphone-with-ios40.html

下表包含较新的设备,来源为Method to find device's camera resolution iOS

+-----------------------+--------------+---------------------------------+---------------+
|        Device         |    Camera    |     AVCaptureSessionPreset      |  Resolution   |
+-----------------------+--------------+---------------------------------+---------------+
| iPhone 4S             | FRONT        |                                 |               |
|                       |              | AVCaptureSessionPresetPhoto     | 640x480       |
|                       |              | AVCaptureSessionPresetHigh      | 640x480       |
|                       |              | AVCaptureSessionPresetMedium    | 480x360       |
|                       |              | AVCaptureSessionPresetLow       | 192x144       |
|                       |              | AVCaptureSessionPreset640x480   | 640x480       |
|                       |              | AVCaptureSessionPreset1280x720  | not supported |
|                       |              | AVCaptureSessionPreset1920x1080 | not supported |
|                       | BACK         |                                 |               |
|                       |              | AVCaptureSessionPresetPhoto     | 3264x2448     |
|                       |              | AVCaptureSessionPresetHigh      | 1920x1080     |
|                       |              | AVCaptureSessionPresetMedium    | 480x360       |
|                       |              | AVCaptureSessionPresetLow       | 192x144       |
|                       |              | AVCaptureSessionPreset640x480   | 640x480       |
|                       |              | AVCaptureSessionPreset1280x720  | 1280x720      |
|                       |              | AVCaptureSessionPreset1920x1080 | 1920x1080     |
+-----------------------+--------------+---------------------------------+---------------+
| iPhone 5/5C/5S/6/6+   |              |                                 |               |
|                       | FRONT        |                                 |               |
|                       |              | AVCaptureSessionPresetPhoto     | 1280x960      |
|                       |              | AVCaptureSessionPresetHigh      | 1280x720      |
|                       |              | AVCaptureSessionPresetMedium    | 480x360       |
|                       |              | AVCaptureSessionPresetLow       | 192x144       |
|                       |              | AVCaptureSessionPreset640x480   | 640x480       |
|                       |              | AVCaptureSessionPreset1280x720  | 1280x720      |
|                       |              | AVCaptureSessionPreset1920x1080 | not supported |
|                       | BACK         |                                 |               |
|                       |              | AVCaptureSessionPresetPhoto     | 3264x2448     |
|                       |              | AVCaptureSessionPresetHigh      | 1920x1080     |
|                       |              | AVCaptureSessionPresetMedium    | 480x360       |
|                       |              | AVCaptureSessionPresetLow       | 192x144       |
|                       |              | AVCaptureSessionPreset640x480   | 640x480       |
|                       |              | AVCaptureSessionPreset1280x720  | 1280x720      |
|                       |              | AVCaptureSessionPreset1920x1080 | 1920x1080     |
+-----------------------+--------------+---------------------------------+---------------+
| iPhone 6S/6S          |              |                                 |               |
|                       | FRONT camera |                                 |               |
|                       |              | AVCaptureSessionPresetPhoto     | 1280x960      |
|                       |              | AVCaptureSessionPresetHigh      | 1280x720      |
|                       |              | AVCaptureSessionPresetMedium    | 480x360       |
|                       |              | AVCaptureSessionPresetLow       | 192x144       |
|                       |              | AVCaptureSessionPreset640x480   | 640x480       |
|                       |              | AVCaptureSessionPreset1280x720  | 1280x720      |
|                       |              | AVCaptureSessionPreset1920x1080 | not supported |
|                       | BACK camera  |                                 |               |
|                       |              | AVCaptureSessionPresetPhoto     | 4032x3024     |
|                       |              | AVCaptureSessionPresetHigh      | 1920x1080     |
|                       |              | AVCaptureSessionPresetMedium    | 480x360       |
|                       |              | AVCaptureSessionPresetLow       | 192x144       |
|                       |              | AVCaptureSessionPreset640x480   | 640x480       |
|                       |              | AVCaptureSessionPreset1280x720  | 1280x720      |
|                       |              | AVCaptureSessionPreset1920x1080 | 1920x1080     |
+-----------------------+--------------+---------------------------------+---------------+
| iPad 2                |              |                                 |               |
|                       | FRONT        |                                 |               |
|                       |              | AVCaptureSessionPresetPhoto     | 640x480       |
|                       |              | AVCaptureSessionPresetHigh      | 640x480       |
|                       |              | AVCaptureSessionPresetMedium    | 480x360       |
|                       |              | AVCaptureSessionPresetLow       | 192x144       |
|                       |              | AVCaptureSessionPreset640x480   | 640x480       |
|                       |              | AVCaptureSessionPreset1280x720  | not supported |
|                       |              | AVCaptureSessionPreset1920x1080 | not supported |
|                       | BACK         |                                 |               |
|                       |              | AVCaptureSessionPresetPhoto     | 960x720       |
|                       |              | AVCaptureSessionPresetHigh      | 1280x720      |
|                       |              | AVCaptureSessionPresetMedium    | 480x360       |
|                       |              | AVCaptureSessionPresetLow       | 192x144       |
|                       |              | AVCaptureSessionPreset640x480   | 640x480       |
|                       |              | AVCaptureSessionPreset1280x720  | 1280x720      |
|                       |              | AVCaptureSessionPreset1920x1080 | not supported |
+-----------------------+--------------+---------------------------------+---------------+
| iPad 3                |              |                                 |               |
|                       | FRONT        |                                 |               |
|                       |              | AVCaptureSessionPresetPhoto     | 640x480       |
|                       |              | AVCaptureSessionPresetHigh      | 640x480       |
|                       |              | AVCaptureSessionPresetMedium    | 480x360       |
|                       |              | AVCaptureSessionPresetLow       | 192x144       |
|                       |              | AVCaptureSessionPreset640x480   | 640x480       |
|                       |              | AVCaptureSessionPreset1280x720  | not supported |
|                       |              | AVCaptureSessionPreset1920x1080 | not supported |
|                       | BACK         |                                 |               |
|                       |              | AVCaptureSessionPresetPhoto     | 2592x1936     |
|                       |              | AVCaptureSessionPresetHigh      | 1920x1080     |
|                       |              | AVCaptureSessionPresetMedium    | 480x360       |
|                       |              | AVCaptureSessionPresetLow       | 192x144       |
|                       |              | AVCaptureSessionPreset640x480   | 640x480       |
|                       |              | AVCaptureSessionPreset1280x720  | 1280x720      |
|                       |              | AVCaptureSessionPreset1920x1080 | 1920x1080     |
+-----------------------+--------------+---------------------------------+---------------+
| iPad 4/Air            |              |                                 |               |
| iPad Mini 1/2/3       |              |                                 |               |
| iPod 5G               |              |                                 |               |
|                       | FRONT        |                                 |               |
|                       |              | AVCaptureSessionPresetPhoto     | 1280x960      |
|                       |              | AVCaptureSessionPresetHigh      | 1280x720      |
|                       |              | AVCaptureSessionPresetMedium    | 480x360       |
|                       |              | AVCaptureSessionPresetLow       | 192x144       |
|                       |              | AVCaptureSessionPreset640x480   | 640x480       |
|                       |              | AVCaptureSessionPreset1280x720  | 1280x720      |
|                       |              | AVCaptureSessionPreset1920x1080 | not supported |
|                       | BACK         |                                 |               |
|                       |              | AVCaptureSessionPresetPhoto     | 2592x1936     |
|                       |              | AVCaptureSessionPresetHigh      | 1920x1080     |
|                       |              | AVCaptureSessionPresetMedium    | 480x360       |
|                       |              | AVCaptureSessionPresetLow       | 192x144       |
|                       |              | AVCaptureSessionPreset640x480   | 640x480       |
|                       |              | AVCaptureSessionPreset1280x720  | 1280x720      |
|                       |              | AVCaptureSessionPreset1920x1080 | 1920x1080     |
+-----------------------+--------------+---------------------------------+---------------+
| iPad Air 2            |              |                                 |               |
| iPad Mini 4           |              |                                 |               |
| iPad Pro              |              |                                 |               |
|                       | FRONT        |                                 |               |
|                       |              | AVCaptureSessionPresetPhoto     | 1280x960      |
|                       |              | AVCaptureSessionPresetHigh      | 1280x720      |
|                       |              | AVCaptureSessionPresetMedium    | 480x360       |
|                       |              | AVCaptureSessionPresetLow       | 192x144       |
|                       |              | AVCaptureSessionPreset640x480   | 640x480       |
|                       |              | AVCaptureSessionPreset1280x720  | 1280x720      |
|                       |              | AVCaptureSessionPreset1920x1080 | not supported |
|                       | BACK         |                                 |               |
|                       |              | AVCaptureSessionPresetPhoto     | 3264x2448     |
|                       |              | AVCaptureSessionPresetHigh      | 1920x1080     |
|                       |              | AVCaptureSessionPresetMedium    | 480x360       |
|                       |              | AVCaptureSessionPresetLow       | 192x144       |
|                       |              | AVCaptureSessionPreset640x480   | 640x480       |
|                       |              | AVCaptureSessionPreset1280x720  | 1280x720      |
|                       |              | AVCaptureSessionPreset1920x1080 | 1920x1080     |
+-----------------------+--------------+---------------------------------+---------------+
| iPod Touch 5          |              |                                 |               |
|                       | FRONT        |                                 |               |
|                       |              | AVCaptureSessionPresetPhoto     | 1280x960      |
|                       |              | AVCaptureSessionPresetHigh      | 1280x720      |
|                       |              | AVCaptureSessionPresetMedium    | 480x360       |
|                       |              | AVCaptureSessionPresetLow       | 192x144       |
|                       |              | AVCaptureSessionPreset640x480   | 640x480       |
|                       |              | AVCaptureSessionPreset1280x720  | 1280x720      |
|                       |              | AVCaptureSessionPreset1920x1080 | not supported |
|                       | BACK         |                                 |               |
|                       |              | AVCaptureSessionPresetPhoto     | 2592x1936     |
|                       |              | AVCaptureSessionPresetHigh      | 1920x1080     |
|                       |              | AVCaptureSessionPresetMedium    | 480x360       |
|                       |              | AVCaptureSessionPresetLow       | 192x144       |
|                       |              | AVCaptureSessionPreset640x480   | 640x480       |
|                       |              | AVCaptureSessionPreset1280x720  | 1280x720      |
|                       |              | AVCaptureSessionPreset1920x1080 | 1920x1080     |
+-----------------------+--------------+---------------------------------+---------------+
| iPod Touch 6          |              |                                 |               |
|                       | FRONT        |                                 |               |
|                       |              | AVCaptureSessionPresetPhoto     | 1280x960      |
|                       |              | AVCaptureSessionPresetHigh      | 1280x720      |
|                       |              | AVCaptureSessionPresetMedium    | 480x360       |
|                       |              | AVCaptureSessionPresetLow       | 192x144       |
|                       |              | AVCaptureSessionPreset640x480   | 640x480       |
|                       |              | AVCaptureSessionPreset1280x720  | 1280x720      |
|                       |              | AVCaptureSessionPreset1920x1080 | not supported |
|                       | BACK         |                                 |               |
|                       |              | AVCaptureSessionPresetPhoto     | 3264x2448     |
|                       |              | AVCaptureSessionPresetHigh      | 1920x1080     |
|                       |              | AVCaptureSessionPresetMedium    | 480x360       |
|                       |              | AVCaptureSessionPresetLow       | 192x144       |
|                       |              | AVCaptureSessionPreset640x480   | 640x480       |
|                       |              | AVCaptureSessionPreset1280x720  | 1280x720      |
|                       |              | AVCaptureSessionPreset1920x1080 | 1920x1080     |
+-----------------------+--------------+---------------------------------+---------------+

要设置自己的分辨率,您必须在AVCaptureSessionPreset中记录数据,检查它是什么类以及如何模拟这些数据,然后自己输入数据。