使用 EDSDK 进行高速(连拍)拍摄

High speed (burst) shooting with EDSDK

我正在尝试使用 EOS 40D 进行高速拍摄。在 UI 中将驱动模式设置为 "high speed continuous" 进行手动操作时,此相机可维持约 6 fps。

如何使用 EDSDK 复制它?

下面的代码选择"high speed continuous"驱动模式(0x4)并尽快发送kEdsCameraCommand_TakePicture。每次拍摄后相机保持 "busy" 约 1 秒。这与单张拍摄的速度相同。我测试了每种可用的驱动模式,虽然有些速度较慢,但​​ none 比 1 fps 快。

注意EOS 40D不支持kEdsCameraCommand_PressShutterButton。使用它可以得到 EDS_ERR_INVALID_PARAMETER。 EDSDK 文档说:"This command is supported by the EOS 50D or EOS 5D Mark II or later cameras" 所以 40D 太旧了。

printf("============= Testing drive mode %08X\n", drive_mode);

result = EdsSetPropertyData(m_CameraRef, kEdsPropID_DriveMode, 0, sizeof(EdsUInt32), &drive_mode);
assert(result == EDS_ERR_OK);

EdsUInt32 new_drive_mode;
result = EdsGetPropertyData(m_CameraRef, kEdsPropID_DriveMode, 0, sizeof(EdsUInt32), &new_drive_mode);
assert(result == EDS_ERR_OK);
assert(new_drive_mode == drive_mode);

int n_captured = 0;
for (int i = 0; i < count; i++)
{
    do
    {
        result = EdsSendCommand(m_CameraRef, kEdsCameraCommand_TakePicture, 3);
        printf("  %d", result);
        Wait(1); // Process Windows messages for a few ms
    } while (result == EDS_ERR_DEVICE_BUSY);
    printf("\n");
    if (result == EDS_ERR_OK)
        n_captured++;
    else
        printf(" Burst capture error code for frame %d: %d!\n", i, result);
}
printf(" Burst capture end!\n");

典型输出如下:

============= Testing drive mode 00000004
  0
  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129
  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129
  129  129  129  129  129  129  129  129  129  129  0
  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129
  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129  129
  129  129  129  129  129  129  129  129  129  129  129  0
 Burst capture end!

代码 129 是 EDS_ERR_DEVICE_BUSY

40D 不可能,因为正如您已经指出的,PressShutterButton 命令不受支持。

您可以通过将 SaveTo 设置为 Host 并在收到 DownloadReady 对象事件后立即拍摄照片来使用 TakePicture 命令稍微加快速度。
您需要保存该事件的指针,完成后,下载所有图像。
请注意,缓冲区大小是有限的,并且取决于图像质量(jpg/raw、large/small 大小)可能只适合三张或四张图像。

或者,使用更快的 CF 卡,这样当您将图像保存在相机上时,它可以更快地再次准备就绪。