Amazon Kinesis Video Streams Media icon

Amazon Kinesis Video Streams Media

<p/>

COMMUNITYAPI KEY0 INSTALLS
API Docs
OpenAPI Specificationv3.0
{
  "openapi": "3.0.0",
  "info": {
    "version": "2017-09-30",
    "x-release": "v4",
    "title": "Amazon Kinesis Video Streams Media",
    "description": "<p/>",
    "x-logo": {
      "url": "https://api.apis.guru/v2/cache/logo/https_twitter.com_awscloud_profile_image.png",
      "backgroundColor": "#FFFFFF"
    },
    "termsOfService": "https://aws.amazon.com/service-terms/",
    "contact": {
      "name": "Mike Ralphson",
      "email": "mike.ralphson@gmail.com",
      "url": "https://github.com/mermade/aws2openapi",
      "x-twitter": "PermittedSoc"
    },
    "license": {
      "name": "Apache 2.0 License",
      "url": "http://www.apache.org/licenses/"
    },
    "x-providerName": "amazonaws.com",
    "x-serviceName": "kinesis-video-media",
    "x-origin": [
      {
        "contentType": "application/json",
        "url": "https://raw.githubusercontent.com/aws/aws-sdk-js/master/apis/kinesis-video-media-2017-09-30.normal.json",
        "converter": {
          "url": "https://github.com/mermade/aws2openapi",
          "version": "1.0.0"
        },
        "x-apisguru-driver": "external"
      }
    ],
    "x-apiClientRegistration": {
      "url": "https://portal.aws.amazon.com/gp/aws/developer/registration/index.html?nc2=h_ct"
    },
    "x-apisguru-categories": [
      "cloud"
    ],
    "x-preferred": true
  },
  "externalDocs": {
    "description": "Amazon Web Services documentation",
    "url": "https://docs.aws.amazon.com/kinesisvideo/"
  },
  "servers": [
    {
      "url": "http://kinesisvideo.{region}.amazonaws.com",
      "variables": {
        "region": {
          "description": "The AWS region",
          "enum": [
            "us-east-1",
            "us-east-2",
            "us-west-1",
            "us-west-2",
            "us-gov-west-1",
            "us-gov-east-1",
            "ca-central-1",
            "eu-north-1",
            "eu-west-1",
            "eu-west-2",
            "eu-west-3",
            "eu-central-1",
            "eu-south-1",
            "af-south-1",
            "ap-northeast-1",
            "ap-northeast-2",
            "ap-northeast-3",
            "ap-southeast-1",
            "ap-southeast-2",
            "ap-east-1",
            "ap-south-1",
            "sa-east-1",
            "me-south-1"
          ],
          "default": "us-east-1"
        }
      },
      "description": "The Kinesis Video Media multi-region endpoint"
    },
    {
      "url": "https://kinesisvideo.{region}.amazonaws.com",
      "variables": {
        "region": {
          "description": "The AWS region",
          "enum": [
            "us-east-1",
            "us-east-2",
            "us-west-1",
            "us-west-2",
            "us-gov-west-1",
            "us-gov-east-1",
            "ca-central-1",
            "eu-north-1",
            "eu-west-1",
            "eu-west-2",
            "eu-west-3",
            "eu-central-1",
            "eu-south-1",
            "af-south-1",
            "ap-northeast-1",
            "ap-northeast-2",
            "ap-northeast-3",
            "ap-southeast-1",
            "ap-southeast-2",
            "ap-east-1",
            "ap-south-1",
            "sa-east-1",
            "me-south-1"
          ],
          "default": "us-east-1"
        }
      },
      "description": "The Kinesis Video Media multi-region endpoint"
    },
    {
      "url": "http://kinesisvideo.{region}.amazonaws.com.cn",
      "variables": {
        "region": {
          "description": "The AWS region",
          "enum": [
            "cn-north-1",
            "cn-northwest-1"
          ],
          "default": "cn-north-1"
        }
      },
      "description": "The Kinesis Video Media endpoint for China (Beijing) and China (Ningxia)"
    },
    {
      "url": "https://kinesisvideo.{region}.amazonaws.com.cn",
      "variables": {
        "region": {
          "description": "The AWS region",
          "enum": [
            "cn-north-1",
            "cn-northwest-1"
          ],
          "default": "cn-north-1"
        }
      },
      "description": "The Kinesis Video Media endpoint for China (Beijing) and China (Ningxia)"
    }
  ],
  "paths": {
    "/getMedia": {
      "post": {
        "operationId": "GetMedia",
        "description": "<p> Use this API to retrieve media content from a Kinesis video stream. In the request, you identify the stream name or stream Amazon Resource Name (ARN), and the starting chunk. Kinesis Video Streams then returns a stream of chunks in order by fragment number.</p> <note> <p>You must first call the <code>GetDataEndpoint</code> API to get an endpoint. Then send the <code>GetMedia</code> requests to this endpoint using the <a href=\"https://docs.aws.amazon.com/cli/latest/reference/\">--endpoint-url parameter</a>. </p> </note> <p>When you put media data (fragments) on a stream, Kinesis Video Streams stores each incoming fragment and related metadata in what is called a \"chunk.\" For more information, see <a href=\"https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_dataplane_PutMedia.html\">PutMedia</a>. The <code>GetMedia</code> API returns a stream of these chunks starting from the chunk that you specify in the request. </p> <p>The following limits apply when using the <code>GetMedia</code> API:</p> <ul> <li> <p>A client can call <code>GetMedia</code> up to five times per second per stream. </p> </li> <li> <p>Kinesis Video Streams sends media data at a rate of up to 25 megabytes per second (or 200 megabits per second) during a <code>GetMedia</code> session. </p> </li> </ul> <note> <p>If an error is thrown after invoking a Kinesis Video Streams media API, in addition to the HTTP status code and the response body, it includes the following pieces of information: </p> <ul> <li> <p> <code>x-amz-ErrorType</code> HTTP header – contains a more specific error type in addition to what the HTTP status code provides. </p> </li> <li> <p> <code>x-amz-RequestId</code> HTTP header – if you want to report an issue to AWS, the support team can better diagnose the problem if given the Request Id.</p> </li> </ul> <p>Both the HTTP status code and the ErrorType header can be utilized to make programmatic decisions about whether errors are retry-able and under what conditions, as well as provide information on what actions the client programmer might need to take in order to successfully try again.</p> <p>For more information, see the <b>Errors</b> section at the bottom of this topic, as well as <a href=\"https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/CommonErrors.html\">Common Errors</a>. </p> </note>",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetMediaOutput"
                }
              }
            }
          },
          "480": {
            "description": "ResourceNotFoundException",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResourceNotFoundException"
                }
              }
            }
          },
          "481": {
            "description": "NotAuthorizedException",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotAuthorizedException"
                }
              }
            }
          },
          "482": {
            "description": "InvalidEndpointException",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidEndpointException"
                }
              }
            }
          },
          "483": {
            "description": "ClientLimitExceededException",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientLimitExceededException"
                }
              }
            }
          },
          "484": {
            "description": "ConnectionLimitExceededException",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionLimitExceededException"
                }
              }
            }
          },
          "485": {
            "description": "InvalidArgumentException",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidArgumentException"
                }
              }
            }
          }
        },
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "StartSelector"
                ],
                "properties": {
                  "StreamName": {
                    "description": "The Kinesis video stream name from where you want to get the media content. If you don't specify the <code>streamName</code>, you must specify the <code>streamARN</code>.",
                    "type": "string",
                    "pattern": "[a-zA-Z0-9_.-]+",
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "StreamARN": {
                    "description": "The ARN of the stream from where you want to get the media content. If you don't specify the <code>streamARN</code>, you must specify the <code>streamName</code>.",
                    "type": "string",
                    "pattern": "arn:aws:kinesisvideo:[a-z0-9-]+:[0-9]+:[a-z]+/[a-zA-Z0-9_.-]+/[0-9]+",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "StartSelector": {
                    "description": "<p>Identifies the chunk on the Kinesis video stream where you want the <code>GetMedia</code> API to start returning media data. You have the following options to identify the starting chunk: </p> <ul> <li> <p>Choose the latest (or oldest) chunk.</p> </li> <li> <p>Identify a specific chunk. You can identify a specific chunk either by providing a fragment number or timestamp (server or producer). </p> </li> <li> <p>Each chunk's metadata includes a continuation token as a Matroska (MKV) tag (<code>AWS_KINESISVIDEO_CONTINUATION_TOKEN</code>). If your previous <code>GetMedia</code> request terminated, you can use this tag value in your next <code>GetMedia</code> request. The API then starts returning chunks starting where the last API ended.</p> </li> </ul>",
                    "type": "object",
                    "properties": {
                      "StartSelectorType": {
                        "allOf": [
                          {
                            "$ref": "#/components/schemas/StartSelectorType"
                          },
                          {
                            "description": "<p>Identifies the fragment on the Kinesis video stream where you want to start getting the data from.</p> <ul> <li> <p>NOW - Start with the latest chunk on the stream.</p> </li> <li> <p>EARLIEST - Start with earliest available chunk on the stream.</p> </li> <li> <p>FRAGMENT_NUMBER - Start with the chunk after a specific fragment. You must also specify the <code>AfterFragmentNumber</code> parameter.</p> </li> <li> <p>PRODUCER_TIMESTAMP or SERVER_TIMESTAMP - Start with the chunk containing a fragment with the specified producer or server timestamp. You specify the timestamp by adding <code>StartTimestamp</code>.</p> </li> <li> <p> CONTINUATION_TOKEN - Read using the specified continuation token. </p> </li> </ul> <note> <p>If you choose the NOW, EARLIEST, or CONTINUATION_TOKEN as the <code>startSelectorType</code>, you don't provide any additional information in the <code>startSelector</code>.</p> </note>"
                          }
                        ]
                      },
                      "AfterFragmentNumber": {
                        "allOf": [
                          {
                            "$ref": "#/components/schemas/FragmentNumberString"
                          },
                          {
                            "description": "Specifies the fragment number from where you want the <code>GetMedia</code> API to start returning the fragments. "
                          }
                        ]
                      },
                      "StartTimestamp": {
                        "allOf": [
                          {
                            "$ref": "#/components/schemas/Timestamp"
                          },
                          {
                            "description": "A timestamp value. This value is required if you choose the PRODUCER_TIMESTAMP or the SERVER_TIMESTAMP as the <code>startSelectorType</code>. The <code>GetMedia</code> API then starts with the chunk containing the fragment that has the specified timestamp."
                          }
                        ]
                      },
                      "ContinuationToken": {
                        "allOf": [
                          {
                            "$ref": "#/components/schemas/ContinuationToken"
                          },
                          {
                            "description": "Continuation token that Kinesis Video Streams returned in the previous <code>GetMedia</code> response. The <code>GetMedia</code> API then starts with the chunk identified by the continuation token."
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/X-Amz-Content-Sha256"
        },
        {
          "$ref": "#/components/parameters/X-Amz-Date"
        },
        {
          "$ref": "#/components/parameters/X-Amz-Algorithm"
        },
        {
          "$ref": "#/components/parameters/X-Amz-Credential"
        },
        {
          "$ref": "#/components/parameters/X-Amz-Security-Token"
        },
        {
          "$ref": "#/components/parameters/X-Amz-Signature"
        },
        {
          "$ref": "#/components/parameters/X-Amz-SignedHeaders"
        }
      ]
    }
  },
  "components": {
    "parameters": {
      "X-Amz-Content-Sha256": {
        "name": "X-Amz-Content-Sha256",
        "in": "header",
        "schema": {
          "type": "string"
        },
        "required": false
      },
      "X-Amz-Date": {
        "name": "X-Amz-Date",
        "in": "header",
        "schema": {
          "type": "string"
        },
        "required": false
      },
      "X-Amz-Algorithm": {
        "name": "X-Amz-Algorithm",
        "in": "header",
        "schema": {
          "type": "string"
        },
        "required": false
      },
      "X-Amz-Credential": {
        "name": "X-Amz-Credential",
        "in": "header",
        "schema": {
          "type": "string"
        },
        "required": false
      },
      "X-Amz-Security-Token": {
        "name": "X-Amz-Security-Token",
        "in": "header",
        "schema": {
          "type": "string"
        },
        "required": false
      },
      "X-Amz-Signature": {
        "name": "X-Amz-Signature",
        "in": "header",
        "schema": {
          "type": "string"
        },
        "required": false
      },
      "X-Amz-SignedHeaders": {
        "name": "X-Amz-SignedHeaders",
        "in": "header",
        "schema": {
          "type": "string"
        },
        "required": false
      }
    },
    "securitySchemes": {
      "hmac": {
        "type": "apiKey",
        "name": "Authorization",
        "in": "header",
        "description": "Amazon Signature authorization v4",
        "x-amazon-apigateway-authtype": "awsSigv4"
      }
    },
    "schemas": {
      "GetMediaOutput": {
        "type": "object",
        "properties": {
          "Payload": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Payload"
              },
              {
                "description": "<p> The payload Kinesis Video Streams returns is a sequence of chunks from the specified stream. For information about the chunks, see . The chunks that Kinesis Video Streams returns in the <code>GetMedia</code> call also include the following additional Matroska (MKV) tags: </p> <ul> <li> <p>AWS_KINESISVIDEO_CONTINUATION_TOKEN (UTF-8 string) - In the event your <code>GetMedia</code> call terminates, you can use this continuation token in your next request to get the next chunk where the last request terminated.</p> </li> <li> <p>AWS_KINESISVIDEO_MILLIS_BEHIND_NOW (UTF-8 string) - Client applications can use this tag value to determine how far behind the chunk returned in the response is from the latest chunk on the stream. </p> </li> <li> <p>AWS_KINESISVIDEO_FRAGMENT_NUMBER - Fragment number returned in the chunk.</p> </li> <li> <p>AWS_KINESISVIDEO_SERVER_TIMESTAMP - Server timestamp of the fragment.</p> </li> <li> <p>AWS_KINESISVIDEO_PRODUCER_TIMESTAMP - Producer timestamp of the fragment.</p> </li> </ul> <p>The following tags will be present if an error occurs:</p> <ul> <li> <p>AWS_KINESISVIDEO_ERROR_CODE - String description of an error that caused GetMedia to stop.</p> </li> <li> <p>AWS_KINESISVIDEO_ERROR_ID: Integer code of the error.</p> </li> </ul> <p>The error codes are as follows:</p> <ul> <li> <p>3002 - Error writing to the stream</p> </li> <li> <p>4000 - Requested fragment is not found</p> </li> <li> <p>4500 - Access denied for the stream's KMS key</p> </li> <li> <p>4501 - Stream's KMS key is disabled</p> </li> <li> <p>4502 - Validation error on the stream's KMS key</p> </li> <li> <p>4503 - KMS key specified in the stream is unavailable</p> </li> <li> <p>4504 - Invalid usage of the KMS key specified in the stream</p> </li> <li> <p>4505 - Invalid state of the KMS key specified in the stream</p> </li> <li> <p>4506 - Unable to find the KMS key specified in the stream</p> </li> <li> <p>5000 - Internal error</p> </li> </ul>"
              }
            ]
          }
        }
      },
      "StartSelectorType": {
        "type": "string",
        "enum": [
          "FRAGMENT_NUMBER",
          "SERVER_TIMESTAMP",
          "PRODUCER_TIMESTAMP",
          "NOW",
          "EARLIEST",
          "CONTINUATION_TOKEN"
        ]
      },
      "FragmentNumberString": {
        "type": "string",
        "pattern": "^[0-9]+$",
        "minLength": 1,
        "maxLength": 128
      },
      "Timestamp": {
        "type": "string",
        "format": "date-time"
      },
      "ContinuationToken": {
        "type": "string",
        "pattern": "^[a-zA-Z0-9_\\.\\-]+$",
        "minLength": 1,
        "maxLength": 128
      },
      "ResourceNotFoundException": {},
      "NotAuthorizedException": {},
      "InvalidEndpointException": {},
      "ClientLimitExceededException": {},
      "ConnectionLimitExceededException": {},
      "InvalidArgumentException": {},
      "ContentType": {
        "type": "string",
        "pattern": "^[a-zA-Z0-9_\\.\\-]+$",
        "minLength": 1,
        "maxLength": 128
      },
      "StreamName": {
        "type": "string",
        "pattern": "[a-zA-Z0-9_.-]+",
        "minLength": 1,
        "maxLength": 256
      },
      "ResourceARN": {
        "type": "string",
        "pattern": "arn:aws:kinesisvideo:[a-z0-9-]+:[0-9]+:[a-z]+/[a-zA-Z0-9_.-]+/[0-9]+",
        "minLength": 1,
        "maxLength": 1024
      },
      "StartSelector": {
        "type": "object",
        "required": [
          "StartSelectorType"
        ],
        "properties": {
          "StartSelectorType": {
            "allOf": [
              {
                "$ref": "#/components/schemas/StartSelectorType"
              },
              {
                "description": "<p>Identifies the fragment on the Kinesis video stream where you want to start getting the data from.</p> <ul> <li> <p>NOW - Start with the latest chunk on the stream.</p> </li> <li> <p>EARLIEST - Start with earliest available chunk on the stream.</p> </li> <li> <p>FRAGMENT_NUMBER - Start with the chunk after a specific fragment. You must also specify the <code>AfterFragmentNumber</code> parameter.</p> </li> <li> <p>PRODUCER_TIMESTAMP or SERVER_TIMESTAMP - Start with the chunk containing a fragment with the specified producer or server timestamp. You specify the timestamp by adding <code>StartTimestamp</code>.</p> </li> <li> <p> CONTINUATION_TOKEN - Read using the specified continuation token. </p> </li> </ul> <note> <p>If you choose the NOW, EARLIEST, or CONTINUATION_TOKEN as the <code>startSelectorType</code>, you don't provide any additional information in the <code>startSelector</code>.</p> </note>"
              }
            ]
          },
          "AfterFragmentNumber": {
            "allOf": [
              {
                "$ref": "#/components/schemas/FragmentNumberString"
              },
              {
                "description": "Specifies the fragment number from where you want the <code>GetMedia</code> API to start returning the fragments. "
              }
            ]
          },
          "StartTimestamp": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Timestamp"
              },
              {
                "description": "A timestamp value. This value is required if you choose the PRODUCER_TIMESTAMP or the SERVER_TIMESTAMP as the <code>startSelectorType</code>. The <code>GetMedia</code> API then starts with the chunk containing the fragment that has the specified timestamp."
              }
            ]
          },
          "ContinuationToken": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ContinuationToken"
              },
              {
                "description": "Continuation token that Kinesis Video Streams returned in the previous <code>GetMedia</code> response. The <code>GetMedia</code> API then starts with the chunk identified by the continuation token."
              }
            ]
          }
        },
        "description": "<p>Identifies the chunk on the Kinesis video stream where you want the <code>GetMedia</code> API to start returning media data. You have the following options to identify the starting chunk: </p> <ul> <li> <p>Choose the latest (or oldest) chunk.</p> </li> <li> <p>Identify a specific chunk. You can identify a specific chunk either by providing a fragment number or timestamp (server or producer). </p> </li> <li> <p>Each chunk's metadata includes a continuation token as a Matroska (MKV) tag (<code>AWS_KINESISVIDEO_CONTINUATION_TOKEN</code>). If your previous <code>GetMedia</code> request terminated, you can use this tag value in your next <code>GetMedia</code> request. The API then starts returning chunks starting where the last API ended.</p> </li> </ul>"
      },
      "GetMediaInput": {
        "type": "object",
        "required": [
          "StartSelector"
        ],
        "title": "GetMediaInput",
        "properties": {
          "StreamName": {
            "allOf": [
              {
                "$ref": "#/components/schemas/StreamName"
              },
              {
                "description": "The Kinesis video stream name from where you want to get the media content. If you don't specify the <code>streamName</code>, you must specify the <code>streamARN</code>."
              }
            ]
          },
          "StreamARN": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ResourceARN"
              },
              {
                "description": "The ARN of the stream from where you want to get the media content. If you don't specify the <code>streamARN</code>, you must specify the <code>streamName</code>."
              }
            ]
          },
          "StartSelector": {
            "allOf": [
              {
                "$ref": "#/components/schemas/StartSelector"
              },
              {
                "description": "Identifies the starting chunk to get from the specified stream. "
              }
            ]
          }
        }
      },
      "Payload": {
        "type": "string"
      }
    }
  },
  "security": [
    {
      "hmac": []
    }
  ]
}