User Tools

Site Tools


script-hdr-gopro-fusion-night

GoPro Fusion Night Mode HDR

This example shows how to capture exposure series (e.g. for HDR) using different exposure times in photo night mode. The following steps are executed:

  1. Connect the script to a camera.
  2. Set the camera mode to photo night mode.
  3. Enable protune.
  4. Set the exposure time.
  5. Capture image.
/**
 * 6 picture HDR night mode capturing example for GoPro Fusion.
 * Author: Camera Controller
 * Web: http://www.tequnique.com/cameracontroller
 * Description: This example shows how to capture exposure series (e.g. for HDR).
 */
 
// Helper function for capturing an image with a specific exposure
function captureImage(cameraName, exposureCommand) {
    // Set exposure
    var result = sendCustomCameraCommand(cameraName, exposureCommand);
    if (!result.ok) {
        logMessage("Error setting exposure: " + result.message, true);
    }
 
    // Capture photo
    result = startRecording(cameraName);
    if (!result.ok) {
        logMessage("Error capturing photo: " + result.message, true);
    }
}
 
// Information
logMessage("This example captures 6 differently exposed pictures in photo night mode with GoPro Hero 4, 5, 6, and Fusion cameras.");
 
// Use the currently connected camera:
var connectResult = connectToCamera();
if (connectResult.ok) {
    var cameraName = connectResult.message;
 
    var result = changeCameraMode(cameraName, 6);
    if (!result.ok) {
        logMessage("Error changing camera mode to photo night: " + result.message, true);
    }
 
    // Give the camera some time for changing the mode
    waitMilliseconds(500);
 
    // Log the current camera mode
    var cameraModeIndex = getCurrentCameraMode(cameraName);
    logMessage("The current camera mode is: " + cameraModeIndex);
 
    // Enable Protune
    result = sendCustomCameraCommand(cameraName, "/setting/21/1");
    if (!result.ok) {
        logMessage("Error enabling Protune: " + result.message, true);
    }
 
 
    for (var i=1; i<7; i++) {
        logMessage("Capturing image " + i);
        captureImage(cameraName, "/setting/19/" + i);
        waitForCameraRecordingState(cameraName, 1000, "recording");
        waitForCameraRecordingState(cameraName, 0, "idle");
        waitMilliseconds(1000); // give the camera some time for capturing.
    }
    logMessage("Done");
}
else showMessageDialog("Error", "No camera found");
script-hdr-gopro-fusion-night.txt · Last modified: 2018/04/10 13:56 by teq