Fortinet white logo
Fortinet white logo

CameraProfile

CameraProfile

Camera profiles.

Permissions required include Camera configuration.

HTTP Methods
  • GET

  • POST

  • PUT

  • DELETE

URL

For HTTP GET, use either:

  • https://HOST_OR_IP/api/v1/CameraVideoProfile/
  • https://HOST_OR_IP/api/v1/CameraVideoProfile/PROFILE_NAME/

For HTTPPOST, PUT, and DELETE, use:

  • https://HOST_OR_IP/api/v1/CameraVideoProfile/PROFILE_NAME/

where variables are:

  • PROFILE_NAME — Unique identifier of a specific resource, such as the video profile high-resolution

Request JSON

For HTTP GET or DELETE, leave the request body empty.

For HTTP POST, configure all required settings. For a list of available settings, use HTTP GET.

For HTTP PUT, configure only settings that you want to change. Omit others.

Response JSON

Responses vary by HTTP method and URL (collection vs. individual resource). For example, if you get the list of camera profiles, you may receive a response like this:

{
    "objectID": "CameraProfileCollection:",
    "reqAction": 1,
    "totalRemoteCount": 12,
    "subCount": 12,
    "remoteSorting": true,
    "nextPage": false,
    "nodePermission": 3,
    "nodeAccessDetails": 1,
    "collection": [
        {
            "mkey": "CloudCameraProfile-0001",
            "management_mode": 1,
            "continuous_retention_disposition": 0,
            "continuous_retention_period": 1,
            "continuous_retention_period_units": 2,
            "detection_retention_disposition": 0,
            "detection_retention_period": 1,
            "detection_retention_period_units": 2,
            "compression": false,
            "compression_period": 1,
            "compression_period_units": 2,
            "viewing_stream": "Always:CloudCameraVideoViewingProfile",
            "recording_stream": "Always:CloudCameraVideoRecordingProfile-0001",
            "recording_type": "Always:3",
            "isReferenced": 1},
            ...
        }]
    }
}

where attributes are:

  • continuous_retention_disposition — Storage strategy for recordings when recording_type includes continuous recording.

    • 0 — Keep until overwritten. Retain video until all available disk space, both local and remote, is almost full. Then the oldest video will be overwritten.

    • 1 — Delete. Remove video when it exceeds the maximum age in continuous_retention_period, or if the disk is full. Recordings are stored on the hard disk as multiple video files. The oldest part of the recording is deleted or moved first. If remote storage is configured, video is first stored on the local disk, then transferred to remote storage when the local disk needs space for newer video. When the remote disk is full too, the video will finally be deleted from it.

    • 2 — Move video to external storage when it exceeds the maximum age, or if the disk is full. This option has no effect if remote storage is disabled.

  • continuous_retention_period — If continuous_retention_disposition is 1 or 2, remove continuous recording files after this amount of time. Also configure continuous_retention_units.

  • continuous_retention_period_units — Unit of time for continuous_retention_period. Valid values are:

    • 0 — Days.

    • 1 — Weeks.

    • 2 — Months.

    • 3 — Years.

  • detection_retention_disposition — Storage strategy for recordings triggered when recording_type includes any non-continuous trigger, such as motion detection. Options are the same as continuous_retention_disposition, except that valid values also include:

    • 3 — Use continuous recordings if available. Marks the time ranges of motion detection inside of continuous recordings on the timeline instead of storing them as separate copies of the video files (sometimes also called "zero penalty" because the NVR system resources are not spent on copies). This reduces CPU load, but does not allow continuous recordings to be deleted, and FortiRecorder only keeps the section of video that was marked by motion detection for an amount of time that varies by, for example, whether or not the live video stream is currently being used.

  • detection_retention_period — If detection_retention_disposition is 1 or 2, remove detection-triggered recording files after this amount of time. Also configure detection_retention_units.

  • detection_retention_period_units — Unit of time for detection_retention_period. Valid values are:

    • 0 — Days.

    • 1 — Weeks.

    • 2 — Months.

    • 3 — Years.

  • compression — Whether or not to reduce the disk space usage of continuous recordings by removing P-frames. This can reduce video frame rate. It can also increase CPU and disk space usage. Valid values are:

    • 0 — Do not compress.

    • 1 — Compress.

  • compression_period — If compression is 1, remove P-frames after this amount of time. Also configure compression_period_units.

  • compression_period_units — Unit of time for compression_period. Valid values are:

    • 0 — Days.

    • 1 — Weeks.

    • 2 — Months.

    • 3 — Years.

  • viewing_stream — Video profile used by live view video streams, at each scheduled time. Separate each part of the tuple with a colon and separate each tuple with a comma, such as "Away:high-resolution,BusinessHours:med-resolution". See CameraVideoProfile and ScheduleObject.

  • recording_stream — Video profile used by recording video streams, at each scheduled time. Formatting is the same as viewing_stream.

  • recording_type — When to use the specified recording triggers, where to store the recordings, and which triggers cause the camera to begin recording, expressed as a bit mask, such as "Always:17". See Recording type and ScheduleObject.

Recording type

Multiple bits can be active at the same time.

  • 1 << 0 — Store on FortiRecorder.

  • 1 << 1 — Store on the camera's SD card ("edge recording").

  • 1 << 4 — Continuous recording.

  • 1 << 5 — Motion detection recording.

  • 1 << 6 — Digital input.

  • 1 << 7 — Audio detection.

  • 1 << 8 — Passive infrared (PIR) detection.

  • 1 << 9 — Tamper detection.

Example: Change to high resolution for recordings

Updates the recording stream (but not the live view stream) to use high resolution.

curl -X PUT -b cookie.txt -H "Content-Type: application/json" -d "{\"recording_stream\":\"high-resolution\"}" https://HOST_OR_IP/api/v1/CameraProfile/PROFILE_NAME/CameraProfileVideoSchedule/SCHEDULE_NAME/
Tooltip

On Microsoft Windows with Command Prompt, inside the JSON data, you must put a backslash before each double straight quote ( \" ). For example (highlighted in bold):

-d "{\"recording_stream\":\"high-resolution\"}"

Alternatively, you can input a JSON stream from another command.

If you do not, the command line may interpret each JSON attribute as CLI commands or arguments, resulting in various error messages depending on the sequential order of arguments and attributes.

Reserved characters and escape sequences vary by operating system and command line environment; Linux and Mac terminals often do not require this, and Microsoft PowerShell uses different escape sequences.

CameraProfile

CameraProfile

Camera profiles.

Permissions required include Camera configuration.

HTTP Methods
  • GET

  • POST

  • PUT

  • DELETE

URL

For HTTP GET, use either:

  • https://HOST_OR_IP/api/v1/CameraVideoProfile/
  • https://HOST_OR_IP/api/v1/CameraVideoProfile/PROFILE_NAME/

For HTTPPOST, PUT, and DELETE, use:

  • https://HOST_OR_IP/api/v1/CameraVideoProfile/PROFILE_NAME/

where variables are:

  • PROFILE_NAME — Unique identifier of a specific resource, such as the video profile high-resolution

Request JSON

For HTTP GET or DELETE, leave the request body empty.

For HTTP POST, configure all required settings. For a list of available settings, use HTTP GET.

For HTTP PUT, configure only settings that you want to change. Omit others.

Response JSON

Responses vary by HTTP method and URL (collection vs. individual resource). For example, if you get the list of camera profiles, you may receive a response like this:

{
    "objectID": "CameraProfileCollection:",
    "reqAction": 1,
    "totalRemoteCount": 12,
    "subCount": 12,
    "remoteSorting": true,
    "nextPage": false,
    "nodePermission": 3,
    "nodeAccessDetails": 1,
    "collection": [
        {
            "mkey": "CloudCameraProfile-0001",
            "management_mode": 1,
            "continuous_retention_disposition": 0,
            "continuous_retention_period": 1,
            "continuous_retention_period_units": 2,
            "detection_retention_disposition": 0,
            "detection_retention_period": 1,
            "detection_retention_period_units": 2,
            "compression": false,
            "compression_period": 1,
            "compression_period_units": 2,
            "viewing_stream": "Always:CloudCameraVideoViewingProfile",
            "recording_stream": "Always:CloudCameraVideoRecordingProfile-0001",
            "recording_type": "Always:3",
            "isReferenced": 1},
            ...
        }]
    }
}

where attributes are:

  • continuous_retention_disposition — Storage strategy for recordings when recording_type includes continuous recording.

    • 0 — Keep until overwritten. Retain video until all available disk space, both local and remote, is almost full. Then the oldest video will be overwritten.

    • 1 — Delete. Remove video when it exceeds the maximum age in continuous_retention_period, or if the disk is full. Recordings are stored on the hard disk as multiple video files. The oldest part of the recording is deleted or moved first. If remote storage is configured, video is first stored on the local disk, then transferred to remote storage when the local disk needs space for newer video. When the remote disk is full too, the video will finally be deleted from it.

    • 2 — Move video to external storage when it exceeds the maximum age, or if the disk is full. This option has no effect if remote storage is disabled.

  • continuous_retention_period — If continuous_retention_disposition is 1 or 2, remove continuous recording files after this amount of time. Also configure continuous_retention_units.

  • continuous_retention_period_units — Unit of time for continuous_retention_period. Valid values are:

    • 0 — Days.

    • 1 — Weeks.

    • 2 — Months.

    • 3 — Years.

  • detection_retention_disposition — Storage strategy for recordings triggered when recording_type includes any non-continuous trigger, such as motion detection. Options are the same as continuous_retention_disposition, except that valid values also include:

    • 3 — Use continuous recordings if available. Marks the time ranges of motion detection inside of continuous recordings on the timeline instead of storing them as separate copies of the video files (sometimes also called "zero penalty" because the NVR system resources are not spent on copies). This reduces CPU load, but does not allow continuous recordings to be deleted, and FortiRecorder only keeps the section of video that was marked by motion detection for an amount of time that varies by, for example, whether or not the live video stream is currently being used.

  • detection_retention_period — If detection_retention_disposition is 1 or 2, remove detection-triggered recording files after this amount of time. Also configure detection_retention_units.

  • detection_retention_period_units — Unit of time for detection_retention_period. Valid values are:

    • 0 — Days.

    • 1 — Weeks.

    • 2 — Months.

    • 3 — Years.

  • compression — Whether or not to reduce the disk space usage of continuous recordings by removing P-frames. This can reduce video frame rate. It can also increase CPU and disk space usage. Valid values are:

    • 0 — Do not compress.

    • 1 — Compress.

  • compression_period — If compression is 1, remove P-frames after this amount of time. Also configure compression_period_units.

  • compression_period_units — Unit of time for compression_period. Valid values are:

    • 0 — Days.

    • 1 — Weeks.

    • 2 — Months.

    • 3 — Years.

  • viewing_stream — Video profile used by live view video streams, at each scheduled time. Separate each part of the tuple with a colon and separate each tuple with a comma, such as "Away:high-resolution,BusinessHours:med-resolution". See CameraVideoProfile and ScheduleObject.

  • recording_stream — Video profile used by recording video streams, at each scheduled time. Formatting is the same as viewing_stream.

  • recording_type — When to use the specified recording triggers, where to store the recordings, and which triggers cause the camera to begin recording, expressed as a bit mask, such as "Always:17". See Recording type and ScheduleObject.

Recording type

Multiple bits can be active at the same time.

  • 1 << 0 — Store on FortiRecorder.

  • 1 << 1 — Store on the camera's SD card ("edge recording").

  • 1 << 4 — Continuous recording.

  • 1 << 5 — Motion detection recording.

  • 1 << 6 — Digital input.

  • 1 << 7 — Audio detection.

  • 1 << 8 — Passive infrared (PIR) detection.

  • 1 << 9 — Tamper detection.

Example: Change to high resolution for recordings

Updates the recording stream (but not the live view stream) to use high resolution.

curl -X PUT -b cookie.txt -H "Content-Type: application/json" -d "{\"recording_stream\":\"high-resolution\"}" https://HOST_OR_IP/api/v1/CameraProfile/PROFILE_NAME/CameraProfileVideoSchedule/SCHEDULE_NAME/
Tooltip

On Microsoft Windows with Command Prompt, inside the JSON data, you must put a backslash before each double straight quote ( \" ). For example (highlighted in bold):

-d "{\"recording_stream\":\"high-resolution\"}"

Alternatively, you can input a JSON stream from another command.

If you do not, the command line may interpret each JSON attribute as CLI commands or arguments, resulting in various error messages depending on the sequential order of arguments and attributes.

Reserved characters and escape sequences vary by operating system and command line environment; Linux and Mac terminals often do not require this, and Microsoft PowerShell uses different escape sequences.