Skip to content

Process Videos

HTTP Request

POST /api/v1/videos:process

Request Body

Fields
inputUri
Required
string
Input URI which either points to a single video or a storage bucket
features
Required
Items Enum: MEDIA_PREPARE, PERSON_DETECTION, FACE_DETECTION, VEHICLE_DETECTION, LICENSE_PLATE_DETECTION, MEDIA_RENDERING
String array of the desired processing features
  • MEDIA_PREPARE - Prepare media for use with embedded editor
  • PERSON_DETECTION - Detect people
  • FACE_DETECTION - Detect faces
  • VEHICLE_DETECTION - Detect vehicles
  • LICENSE_PLATE_DETECTION - Detect vehicle license plates
  • MEDIA_RENDERING - Render processed media. Required if output desired
outputUri
Required
string
The storage bucket URI to use for output.
notifications Array of objects (NotificationConfig)
Notification webhook descriptor. Users can enable webhooks to receive messages for their operation.
videoContext object (VideoContext)
Additional configuration options. All optional.
tag object
User-defined object that is returned in every notification.
acl
v4.4.5+
Array of strings
Optional list of one or more Redactor usernames that will have access to the video in the standard Redactor UI. E.g. ["user1", "user3"]

Types

NotificationConfig

Fields
method string
Value: "HTTP_POST"
uri string
The storage bucket URI to use for output.
events Array of string
Items Enum: "START" "PROGRESS" "COMPLETION"

VideoContext

Fields
renderConfig object (RenderConfig)
processConfig object (ProcessConfig)

RenderConfig

Fields
redactionStyle string
Default: "MOSAIC"
Enum: "OUTLINE" "FILL" "PIXELATE" "BLUR" "SMOOTH_BLUR" "MOSAIC"
redactionShape string
Default: "RECTANGLE"
Enum: "RECTANGLE" "ELLIPSE"
redactionIntensity string
Default: "MEDIUM"
Enum: "LOW" "MEDIUM" "HIGH"
redactionColor string
Default: "#9F0500"
The color used for OUTLINE and FILL redaction styles. Not used for other styles.
maskAudio string
Enum: "SILENCE" "BEEP" "SCRAMBLE"
If defined, all audio in the video will be masked using the method/type provided.
maskAudioParams Array of numbers 2 items
Default: [0.32,-0.24]
Only applicable when using SCRAMBLE maskAudio. Adjust the 2 values to modify the scramble strength and quality. Allowed values are between -1.0 and 1.0.
videoQuality number [ 0 .. 1 ]
Default: 0.65
Video encoding quality which impacts the size of output. 0 is the lowest quality, 1 is highest, and 0.65 is the default.
videoPreset string
Default: "ULTRAFAST"
Enum: "ULTRAFAST" "SUPERFAST" "VERYFAST" "FASTER" "FAST" "MEDIUM" "SLOW" "SLOWER" "VERYSLOW"
Controls the speed versus compression ratio. Reduce the preset to receive better compression.

ProcessConfig

Fields
confidenceThreshold number
Default: 0.3
Confidence threshold for detection of all primary objects (people & vehicles). Value should be between 0 and 1.
confidenceThresholdSub number
Default: 0.05
Confidence threshold for detection of all sub objects (faces & license plates). Value should be between 0 and 1.
faceboxExpand number
Default: 1.5
Scales the face detection bounding box size returned after auto-redaction. Value should be between 1 and 5. The default value was 2.0 in releases v4.3.0 and earlier.

Response Body

A success response returns an object with an Operation name in the format:
projects/{project-id}/locations/{location-id}/operations/{operation-id}

RESPONSE SCHEMA: application/json
name string<operationName>

Samples

Request

{
  "inputUri": "http://example.com/path/to/video.mp4",
  "features": [
    "FACE_DETECTION",
    "LICENSE_PLATE_DETECTION",
    "MEDIA_RENDERING"
  ],
  "outputUri": "s3://bucket-name/keyname/",
  "notifications": [
    {
      "method": "HTTP_POST",
      "uri": "https://example.com/mywebhook/endpoint",
      "events": [
        "START",
        "PROGRESS",
        "COMPLETION"
      ]
    }
  ],
  "videoContext": {
    "renderConfig": {
      "redactionStyle": "MOSAIC",
      "redactionShape": "ELLIPSE",
      "redactionIntensity": "HIGH",
      "redactionColor": "#CC3399",
      "maskAudio": "SCRAMBLE"
    },
    "processConfig": {
      "confidenceThreshold": 0.3,
      "confidenceThresholdSub": 0.05,
      "faceboxExpand": 2
    }
  },
  "tag": {
    "city": "Mountain View",
    "state": "CA",
    "validUntil": 1607111026726
  }
}

Response

{
  "name": "projects/{project-id}/locations/{location-id}/operations/{operation-id}"
}