AI

Get AI task result

Changed on

This is the single method to check the execution status of an AI task, and obtain the result of any type of AI task.

Based on the results of processing, the “result” field will contain an answer corresponding to the type of the initially created task:

  • ASR: Transcribe video
  • ASR: Translate subtitles
  • CM: Sports detection
  • CM: Not Safe For Work (NSFW) content detection
  • CM: Soft nudity detection
  • CM: Hard nudity detection
  • CM: Objects recognition (soon)
  • etc... (see other methods from /ai/ domain)

A queue is used to process videos. The waiting time depends on the total number of requests in the system, so sometimes you will have to wait.

Statuses:

  • RECEIVED – the task is accepted by the system
  • PENDING – the task is received and it is pending for available resources
  • STARTED – processing has started
  • SUCCESS – processing has completed successfully
  • FAILURE – processing failed
  • REVOKED – processing was cancelled by the user (or the system)
  • RETRY – the task execution failed due to internal reasons, the task is queued for re-execution (up to 3 times)

Each task is processed in sub-stages, for example, original language is first determined in a video, and then transcription is performed. In such cases, the video processing status may change from "STARTED" to "PENDING", and back. This is due to waiting for resources for a specific processing sub-stage. In this case, the overall percentage "progress" of video processing will reflect the full picture.

The result data is stored for 1 month, after which it is deleted.

For billing conditions see the corresponding methods in /ai/ domain. The task is billed only after successful completion of the task and transition to "SUCCESS" status.

get/streaming/ai/tasks/{task_id}

Request

  • Base URL
    https://api.gcore.com
  • URL
    https://api.gcore.com/streaming/ai/tasks/{task_id}
  • Auth
    HTTP apikey

Path parameters

task_idstring required

ID of the task to get status of execution or result. This value is taken from the response of the initial AI task creation method.

Response

Result of AI task execution

task_idstring uuid required

ID of the AI task

status'PENDING' | 'STARTED' | 'SUCCESS' | 'FAILURE' | 'RECEIVED' | 'REVOKED' | 'RETRY' required

Status of processing the AI task. See GET /ai/tasks/{task_id} method for description.

progressinteger required

Percentage of task completed. A value greater than 0 means that it has been taken into operation and is being processed.

Example response

{
  "task_id": "aafe70c6-0000-0000-0000-327b65f7670f",
  "task_data": {
    "url": "https://demo-public.gvideo.io/videos/2675_TVKIqpTO7tEFoFg/qid5774v1_h264_450_360.mp4",
    "category": "sport",
    "client_id": 2675,
    "task_name": "content-moderation"
  },
  "progress": 100,
  "status": "SUCCESS",
  "processing_time": {
    "started_at": "2024-07-13T12:30:00.000Z",
    "completed_at": "2024-07-13T12:31:02.900Z",
    "total_time_sec": 62.901
  },
  "result": {
    "sport_detected": true,
    "detection_results": [
      "shooting goal (soccer)",
      "playing cricket"
    ],
    "frames": [
      {
        "label": "shooting goal (soccer)",
        "frame_number": 68,
        "confidence": 1
      },
      {
        "label": "playing cricket",
        "frame_number": 728,
        "confidence": 0.99
      }
    ]
  }
}

Changes

    • breaking

      the //////// response's property type changed from no type to object for status

    • breaking

      the //////// response's property type changed from no type to object for status

    • breaking

      the //////// response's property type changed from no type to object for status

    • breaking

      the //////// response's property type changed from no type to object for status

    • warning

      removed the optional property //// from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      added the new RECEIVED enum value to the //// response property for the response status

    • info

      added subschema #2 to the response body allOf list for the response status

    • info

      added the optional property ///////// to the response with the status

    • info

      added the optional property ///////// to the response with the status

    • info

      added the optional property ///////// to the response with the status

    • info

      added the optional property ///////// to the response with the status

    • info

      added the optional property ///////// to the response with the status

    • info

      added the optional property ///////// to the response with the status

    • info

      added the optional property ///////// to the response with the status

    • info

      added the optional property ///////// to the response with the status

    • info

      added the optional property ///////// to the response with the status

    • info

      added the optional property ///////// to the response with the status

    • info

      added the optional property ///////// to the response with the status

    • info

      added the optional property ///////// to the response with the status

    • info

      added the optional property ///////// to the response with the status

    • info

      removed from the //////// response property allOf list for the response status

    • info

      removed from the //////// response property allOf list for the response status

    • info

      removed from the //////// response property allOf list for the response status

    • info

      removed from the //////// response property allOf list for the response status

    • info

      the response property //// became required for the status

    • info

      the response property //// became required for the status

    • info

      the response property //// became required for the status

    • info

      the response property //// became required for the status

    • info

      added the required property //// to the response with the status

    • info

      added the required property ///////// to the response with the status

    • info

      added the required property ///////// to the response with the status

    • info

      added the required property ///////// to the response with the status

    • info

      added the required property ///////// to the response with the status

    • info

      added the required property ///////// to the response with the status

    • info

      added the required property ///////// to the response with the status

    • info

      added the required property ///////// to the response with the status

    • info

      added the required property ///////// to the response with the status