amazonka-kinesis-video-media-1.6.0: Amazon Kinesis Video Streams Media SDK.

Copyright(c) 2013-2018 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Network.AWS.KinesisVideoMedia.GetMedia

Contents

Description

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

Creating a Request

getMedia Source #

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 the streamARN , you must specify the streamName .
  • gmStreamName - 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 - Identifies the starting chunk to get from the specified stream.

data GetMedia Source #

See: getMedia smart constructor.

Instances

Eq GetMedia Source # 
Data GetMedia Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> GetMedia -> c GetMedia #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c GetMedia #

toConstr :: GetMedia -> Constr #

dataTypeOf :: GetMedia -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c GetMedia) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c GetMedia) #

gmapT :: (forall b. Data b => b -> b) -> GetMedia -> GetMedia #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> GetMedia -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> GetMedia -> r #

gmapQ :: (forall d. Data d => d -> u) -> GetMedia -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> GetMedia -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> GetMedia -> m GetMedia #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> GetMedia -> m GetMedia #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> GetMedia -> m GetMedia #

Read GetMedia Source # 
Show GetMedia Source # 
Generic GetMedia Source # 

Associated Types

type Rep GetMedia :: * -> * #

Methods

from :: GetMedia -> Rep GetMedia x #

to :: Rep GetMedia x -> GetMedia #

Hashable GetMedia Source # 

Methods

hashWithSalt :: Int -> GetMedia -> Int #

hash :: GetMedia -> Int #

ToJSON GetMedia Source # 
NFData GetMedia Source # 

Methods

rnf :: GetMedia -> () #

AWSRequest GetMedia Source # 
ToHeaders GetMedia Source # 

Methods

toHeaders :: GetMedia -> [Header] #

ToPath GetMedia Source # 
ToQuery GetMedia Source # 
type Rep GetMedia Source # 
type Rep GetMedia = D1 * (MetaData "GetMedia" "Network.AWS.KinesisVideoMedia.GetMedia" "amazonka-kinesis-video-media-1.6.0-5IbPEhFZvoxFr4q8Nts0ML" False) (C1 * (MetaCons "GetMedia'" PrefixI True) ((:*:) * (S1 * (MetaSel (Just Symbol "_gmStreamARN") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe Text))) ((:*:) * (S1 * (MetaSel (Just Symbol "_gmStreamName") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe Text))) (S1 * (MetaSel (Just Symbol "_gmStartSelector") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * StartSelector)))))
type Rs GetMedia Source # 

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

getMediaResponse Source #

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 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

data GetMediaResponse Source #

See: getMediaResponse smart constructor.

Instances

Show GetMediaResponse Source # 
Generic GetMediaResponse Source # 
type Rep GetMediaResponse Source # 
type Rep GetMediaResponse = D1 * (MetaData "GetMediaResponse" "Network.AWS.KinesisVideoMedia.GetMedia" "amazonka-kinesis-video-media-1.6.0-5IbPEhFZvoxFr4q8Nts0ML" False) (C1 * (MetaCons "GetMediaResponse'" PrefixI True) ((:*:) * (S1 * (MetaSel (Just Symbol "_gmrsContentType") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe Text))) ((:*:) * (S1 * (MetaSel (Just Symbol "_gmrsResponseStatus") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Int)) (S1 * (MetaSel (Just Symbol "_gmrsPayload") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * RsBody)))))

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