Save Clip

Save a clip and associated metadata when a specific condition is met

Overview

The node saves clips in mp4 format, along with the Pipeline metadata contained in those frames, as a files API object.
Files created by this node are also listed in the Console under the Deployment detail page when the save location is Lumeo cloud.

Format of output

This node creates 2 files for every clip it saves:

  1. Media file (MP4 format), named <node_name>-YYYY-MM-DDThhmmss.usZ.mp4. Ex. clip1-2023-01-20T083909.952Z.mp4. The timestamp in the file name is the creation timestamp. This file contains the media for the clip in mp4 format.

  2. Metadata file (JSON format) named <node_name>-YYYY-MM-DDThhmmss.usZ.mp4.json. Ex clip1-2023-01-20T083909.952Z.mp4.json. This file contains the metadata for all the frames contained in the media file in JSON format.

Inputs & Outputs

  • Inputs : 1, Media Format : Encoded Video
  • Outputs : 1, Media Format: Encoded Video
  • Output Metadata : None

Properties

PropertyDescriptionTypeDefaultRequired
locationSave location. Options: Lumeo Cloud (lumeo_cloud); Local disk (local); S3 bucket (s3_bucket).enumlumeo_cloudYes
pathUsed when save location is Local disk. Must be writable by the lumeod user. Conditional on location being local.string/var/lib/lumeo/mediaYes
max_edge_filesMaximum number of files to keep on local disk for this node. Conditional on location being local. Range: minimum 1.numbernullNo
max_durationOnce this duration is reached, a new clip is started. Range: minimum 1. Unit: seconds.numbernullNo
prebuffer_intervalDuration of video to record before the trigger condition is met. Range: minimum 0. Unit: seconds.number0No
max_sizeOnce this size is reached, a new clip is started. Range: minimum 1. Unit: bytes.numbernullNo
triggerStart recording a clip when this expression evaluates to True.trigger-conditionnullNo
trigger_modeControls how the clip is recorded when a trigger condition is configured. Options: Exact (exact); Fixed duration (fixed_duration).enumexactNo
endpointS3 endpoint. Conditional on location being s3_bucket.stringnullYes
regionS3 region. Conditional on location being s3_bucket.stringnullYes
bucketS3 bucket. Conditional on location being s3_bucket.stringnullYes
key_prefixFolder prefix within the bucket. Skip trailing "/". Conditional on location being s3_bucket.string""Yes
access_key_idS3 access key id. Conditional on location being s3_bucket.stringnullYes
secret_access_keyS3 secret access key. Conditional on location being s3_bucket.stringnullYes

Pre-buffer Interval

This diagram below explains how the pre-buffer interval changes how the video clip is recorded.

Max Edge Files

When location is local, if this property is not set, Lumeo will continue to save till the disk fills up.
If it is set, Lumeo will save to local disk in a round robin manner (overwrite the 1st file once max_edge_files have been written).

Key Prefix

This property supports custom folder / path configurations in the S3 bucket using dynamic keyword replacements by enclosing keywords in double curly braces {{keyword}}.
Available keywords: application_id, application_name, deployment_id, deployment_name, gateway_id, gateway_name, source_id, year, month, day, hour, min, sec.

ex. production/test or media/{{deployment_id}}/{{year}}-{{month}}-{{day}}/clips

Output Metadata

Node does not insert any output metadata; upstream metadata continues through the pipeline

Common Provider Configurations

Examples

PropertyAWSDigital OceanWasabiGCP
endpointhttps://s3.us-east-1.amazonaws.comhttps://nyc3.digitaloceanspaces.comhttps://s3.wasabisys.comhttps://storage.googleapis.com
regionus-east-1nyc3us-east-1us-central1
bucketmy-aws-bucketmy-do-bucketmy-wasabi-bucketmy-google-bucket
key_prefixmy-foldermy-foldermy-foldermy-folder
access_key_idAKIAIOSFODNN7EXAMPLEDO00QWERTYUIOPASDFGHJKLZXCVBNMWASABI00QWERTYUIOPASDFGHJKLZXCVBNMGOOG00QWERTYUIOPASDFGHJKLZXCVBNM
secret_access_keyxxxxxxxxxxxxxxxxxxxxxxx

AWS Credentials

Create user
aws iam create-user --user-name <username>

Attach policy

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "s3:PutObject"
      ],
      "Resource": "arn:aws:s3:::<bucket-name>/*"
    },
    {
      "Effect": "Allow",
      "Action": "s3:ListBucket",
      "Resource": "arn:aws:s3:::<bucket-name>"
    }
  ]
}

aws iam put-user-policy --user-name <username> --policy-name S3PutObjectPolicy --policy-document file://s3-put-policy.json

Create long lived access key for user and grab the credentials
aws iam create-access-key --user-name <username>


Did this page help you?