Copyright | (c) 2013-2018 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Language | Haskell2010 |
Use this API to retrieve media content from a Kinesis video stream. In the request, you identify 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.
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 . The GetMedia
API returns a stream of these chunks starting from the chunk that you specify in the request.
The following limits apply when using the GetMedia
API:
- A client can call
GetMedia
up to five times per second per stream. - Kinesis Video Streams sends media data at a rate of up to 25 megabytes per second (or 200 megabits per second) during a
GetMedia
session.
Synopsis
- getMedia :: StartSelector -> GetMedia
- data GetMedia
- gmStreamARN :: Lens' GetMedia (Maybe Text)
- gmStreamName :: Lens' GetMedia (Maybe Text)
- gmStartSelector :: Lens' GetMedia StartSelector
- getMediaResponse :: Int -> RsBody -> GetMediaResponse
- data GetMediaResponse
- gmrsContentType :: Lens' GetMediaResponse (Maybe Text)
- gmrsResponseStatus :: Lens' GetMediaResponse Int
- gmrsPayload :: Lens' GetMediaResponse RsBody
Creating a Request
Creates a value of GetMedia
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
gmStreamARN
- The ARN of the stream from where you want to get the media content. If you don't specify thestreamARN
, you must specify thestreamName
.gmStreamName
- The Kinesis video stream name from where you want to get the media content. If you don't specify thestreamName
, you must specify thestreamARN
.gmStartSelector
- Identifies the starting chunk to get from the specified stream.
See: getMedia
smart constructor.
Instances
Request Lenses
gmStreamARN :: Lens' GetMedia (Maybe Text) Source #
The ARN of the stream from where you want to get the media content. If you don't specify the streamARN
, you must specify the streamName
.
gmStreamName :: Lens' GetMedia (Maybe Text) Source #
The Kinesis video stream name from where you want to get the media content. If you don't specify the streamName
, you must specify the streamARN
.
gmStartSelector :: Lens' GetMedia StartSelector Source #
Identifies the starting chunk to get from the specified stream.
Destructuring the Response
Creates a value of GetMediaResponse
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
gmrsContentType
- The content type of the requested media.gmrsResponseStatus
- -- | The response status code.gmrsPayload
- 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 theGetMedia
call also include the following additional Matroska (MKV) tags: * AWS_KINESISVIDEO_CONTINUATION_TOKEN (UTF-8 string) - In the event yourGetMedia
call terminates, you can use this continuation token in your next request to get the next chunk where the last request terminated. * 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. * AWS_KINESISVIDEO_FRAGMENT_NUMBER - Fragment number returned in the chunk. * AWS_KINESISVIDEO_SERVER_TIMESTAMP - Server time stamp of the fragment. * AWS_KINESISVIDEO_PRODUCER_TIMESTAMP - Producer time stamp of the fragment. The following tags will be present if an error occurs: * AWS_KINESISVIDEO_ERROR_CODE - String description of an error that caused GetMedia to stop. * AWS_KINESISVIDEO_ERROR_ID: Integer code of the error. The error codes are as follows: * 3002 - Error writing to the stream * 4000 - Requested fragment is not found * 4500 - Access denied for the stream's KMS key * 4501 - Stream's KMS key is disabled * 4502 - Validation error on the Stream's KMS key * 4503 - KMS key specified in the stream is unavailable * 4504 - Invalid usage of the KMS key specified in the stream * 4505 - Invalid state of the KMS key specified in the stream * 4506 - Unable to find the KMS key specified in the stream * 5000 - Internal error
data GetMediaResponse Source #
See: getMediaResponse
smart constructor.
Instances
Response Lenses
gmrsContentType :: Lens' GetMediaResponse (Maybe Text) Source #
The content type of the requested media.
gmrsResponseStatus :: Lens' GetMediaResponse Int Source #
- - | The response status code.
gmrsPayload :: Lens' GetMediaResponse RsBody Source #
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 GetMedia
call also include the following additional Matroska (MKV) tags: * AWS_KINESISVIDEO_CONTINUATION_TOKEN (UTF-8 string) - In the event your GetMedia
call terminates, you can use this continuation token in your next request to get the next chunk where the last request terminated. * 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. * AWS_KINESISVIDEO_FRAGMENT_NUMBER - Fragment number returned in the chunk. * AWS_KINESISVIDEO_SERVER_TIMESTAMP - Server time stamp of the fragment. * AWS_KINESISVIDEO_PRODUCER_TIMESTAMP - Producer time stamp of the fragment. The following tags will be present if an error occurs: * AWS_KINESISVIDEO_ERROR_CODE - String description of an error that caused GetMedia to stop. * AWS_KINESISVIDEO_ERROR_ID: Integer code of the error. The error codes are as follows: * 3002 - Error writing to the stream * 4000 - Requested fragment is not found * 4500 - Access denied for the stream's KMS key * 4501 - Stream's KMS key is disabled * 4502 - Validation error on the Stream's KMS key * 4503 - KMS key specified in the stream is unavailable * 4504 - Invalid usage of the KMS key specified in the stream * 4505 - Invalid state of the KMS key specified in the stream * 4506 - Unable to find the KMS key specified in the stream * 5000 - Internal error