AckEventType ackEventType
Long fragmentTimecode
String fragmentNumber
AckErrorCode errorCode
Integer errorId
String deviceName
The name of the device that is writing to the stream.
In the current implementation, Kinesis Video Streams does not use this name.
String streamName
A name for the stream that you are creating.
The stream name is an identifier for the stream, and must be unique for each account and region.
String mediaType
The media type of the stream. Consumers of the stream can use this information when processing the stream. For
more information about media types, see Media Types. If you choose to specify
the MediaType
, see Naming Requirements
for guidelines.
To play video on the console, the media must be H.264 encoded, and you need to specify this video type in this
parameter as video/h264
.
This parameter is optional; the default value is null
(or empty in JSON).
String kmsKeyId
The ID of the AWS Key Management Service (AWS KMS) key that you want Kinesis Video Streams to use to encrypt stream data.
If no key ID is specified, the default, Kinesis Video-managed key (aws/kinesisvideo
) is used.
For more information, see DescribeKey.
Integer dataRetentionInHours
The number of hours that you want to retain the data in the stream. Kinesis Video Streams retains the data in a data store that is associated with the stream.
The default value is 0, indicating that the stream does not persist data.
When the DataRetentionInHours
value is 0, consumers can still consume the fragments that remain in
the service host buffer, which has a retention time limit of 5 minutes and a retention memory limit of 200 MB.
Fragments are removed from the buffer when either limit is reached.
String streamARN
The Amazon Resource Name (ARN) of the stream.
String streamARN
The Amazon Resource Name (ARN) of the stream that you want to delete.
String currentVersion
Optional: The version of the stream that you want to delete.
Specify the version as a safeguard to ensure that your are deleting the correct stream. To get the stream
version, use the DescribeStream
API.
If not specified, only the CreationTime
is checked before deleting the stream.
StreamInfo streamInfo
An object that describes the stream.
String fragmentNumber
The index value of the fragment.
Long fragmentSizeInBytes
The total fragment size, including information about the fragment and contained media data.
Date producerTimestamp
The time stamp from the producer corresponding to the fragment.
Date serverTimestamp
The time stamp from the AWS server corresponding to the fragment.
Long fragmentLengthInMilliseconds
The playback duration or other time value associated with the fragment.
String fragmentSelectorType
The origin of the time stamps to use (Server or Producer).
TimestampRange timestampRange
The range of time stamps to return.
String streamName
The name of the stream that you want to get the endpoint for. You must specify either this parameter or a
StreamARN
in the request.
String streamARN
The Amazon Resource Name (ARN) of the stream that you want to get the endpoint for. You must specify either this
parameter or a StreamName
in the request.
String aPIName
The name of the API action for which to get an endpoint.
String dataEndpoint
The endpoint value. To read data from the stream or to write data to it, specify this endpoint in your application.
String streamName
The name of the stream for which to retrieve the HLS master playlist URL.
You must specify either the StreamName
or the StreamARN
.
String streamARN
The Amazon Resource Name (ARN) of the stream for which to retrieve the HLS master playlist URL.
You must specify either the StreamName
or the StreamARN
.
String playbackMode
Whether to retrieve live or archived, on-demand data.
Features of the two types of session include the following:
LIVE
: For sessions of this type, the HLS media playlist is continually updated with the
latest fragments as they become available. We recommend that the media player retrieve a new playlist on a
one-second interval. When this type of session is played in a media player, the user interface typically displays
a "live" notification, with no scrubber control for choosing the position in the playback window to display.
In LIVE
mode, the newest available fragments are included in an HLS media playlist, even if there is
a gap between fragments (that is, if a fragment is missing). A gap like this might cause a media player to halt
or cause a jump in playback. In this mode, fragments are not added to the HLS media playlist if they are older
than the newest fragment in the playlist. If the missing fragment becomes available after a subsequent fragment
is added to the playlist, the older fragment is not added, and the gap is not filled.
ON_DEMAND
: For sessions of this type, the HLS media playlist contains all the fragments for
the session, up to the number that is specified in MaxMediaPlaylistFragmentResults
. The playlist
must be retrieved only once for each session. When this type of session is played in a media player, the user
interface typically displays a scrubber control for choosing the position in the playback window to display.
In both playback modes, if FragmentSelectorType
is PRODUCER_TIMESTAMP
, and if there are
multiple fragments with the same start time stamp, the fragment that has the larger fragment number (that is, the
newer fragment) is included in the HLS media playlist. The other fragments are not included. Fragments that have
different time stamps but have overlapping durations are still included in the HLS media playlist. This can lead
to unexpected behavior in the media player.
The default is LIVE
.
HLSFragmentSelector hLSFragmentSelector
The time range of the requested fragment, and the source of the time stamps.
This parameter is required if PlaybackMode
is ON_DEMAND
. This parameter is optional if
PlaybackMode
is LIVE
. If PlaybackMode
is LIVE
, the
FragmentSelectorType
can be set, but the TimestampRange
should not be set. If
PlaybackMode
is ON_DEMAND
, both FragmentSelectorType
and
TimestampRange
must be set.
String discontinuityMode
Specifies when flags marking discontinuities between fragments will be added to the media playlists. The default
is ALWAYS
when HLSFragmentSelector is SERVER_TIMESTAMP
, and NEVER
when it is PRODUCER_TIMESTAMP
.
Media players typically build a timeline of media content to play, based on the time stamps of each fragment.
This means that if there is any overlap between fragments (as is typical if HLSFragmentSelector is
SERVER_TIMESTAMP
), the media player timeline has small gaps between fragments in some places, and
overwrites frames in other places. When there are discontinuity flags between fragments, the media player is
expected to reset the timeline, resulting in the fragment being played immediately after the previous fragment.
We recommend that you always have discontinuity flags between fragments if the fragment time stamps are not
accurate or if fragments might be missing. You should not place discontinuity flags between fragments for the
player timeline to accurately map to the producer time stamps.
Integer expires
The time in seconds until the requested session expires. This value can be between 300 (5 minutes) and 43200 (12 hours).
When a session expires, no new calls to GetHLSMasterPlaylist
, GetHLSMediaPlaylist
,
GetMP4InitFragment
, or GetMP4MediaFragment
can be made for that session.
The default is 300 (5 minutes).
Long maxMediaPlaylistFragmentResults
The maximum number of fragments that are returned in the HLS media playlists.
When the PlaybackMode
is LIVE
, the most recent fragments are returned up to this value.
When the PlaybackMode
is ON_DEMAND
, the oldest fragments are returned, up to this
maximum number.
When there are a higher number of fragments available in a live HLS media playlist, video players often buffer content before starting playback. Increasing the buffer size increases the playback latency, but it decreases the likelihood that rebuffering will occur during playback. We recommend that a live HLS media playlist have a minimum of 3 fragments and a maximum of 10 fragments.
The default is 5 fragments if PlaybackMode
is LIVE
, and 1,000 if
PlaybackMode
is ON_DEMAND
.
The maximum value of 1,000 fragments corresponds to more than 16 minutes of video on streams with 1-second fragments, and more than 2 1/2 hours of video on streams with 10-second fragments.
String hLSStreamingSessionURL
The URL (containing the session token) that a media player can use to retrieve the HLS master playlist.
String streamName
The name of the stream from which to retrieve fragment media.
List<E> fragments
A list of the numbers of fragments for which to retrieve media. You retrieve these values with ListFragments.
String contentType
The content type of the requested media.
InputStream payload
The payload that Kinesis Video Streams returns is a sequence of chunks from the specified stream. For information
about the chunks, see PutMedia. The
chunks that Kinesis Video Streams returns in the GetMediaForFragmentList
call also include the
following additional Matroska (MKV) tags:
AWS_KINESISVIDEO_FRAGMENT_NUMBER - Fragment number returned in the chunk.
AWS_KINESISVIDEO_SERVER_SIDE_TIMESTAMP - Server-side time stamp of the fragment.
AWS_KINESISVIDEO_PRODUCER_SIDE_TIMESTAMP - Producer-side time stamp of the fragment.
The following tags will be included if an exception occurs:
AWS_KINESISVIDEO_FRAGMENT_NUMBER - The number of the fragment that threw the exception
AWS_KINESISVIDEO_EXCEPTION_ERROR_CODE - The integer code of the exception
AWS_KINESISVIDEO_EXCEPTION_MESSAGE - A text description of the exception
String streamName
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
.
String streamARN
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
.
StartSelector startSelector
Identifies the starting chunk to get from the specified stream.
String contentType
The content type of the requested media.
InputStream payload
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
String fragmentSelectorType
The source of the time stamps for the requested media.
When FragmentSelectorType
is set to PRODUCER_TIMESTAMP
and
GetHLSStreamingSessionURLInput$PlaybackMode is ON_DEMAND
, the first fragment ingested with a
producer time stamp within the specified FragmentSelector$TimestampRange is included in the media
playlist. In addition, the fragments with producer time stamps within the TimestampRange
ingested
immediately following the first fragment (up to the
GetHLSStreamingSessionURLInput$MaxMediaPlaylistFragmentResults value) are included.
Fragments that have duplicate producer time stamps are deduplicated. This means that if producers are producing a stream of fragments with producer time stamps that are approximately equal to the true clock time, the HLS media playlists will contain all of the fragments within the requested time stamp range. If some fragments are ingested within the same time range and very different points in time, only the oldest ingested collection of fragments are returned.
When FragmentSelectorType
is set to PRODUCER_TIMESTAMP
and
GetHLSStreamingSessionURLInput$PlaybackMode is LIVE
, the producer time stamps are used in the
MP4 fragments and for deduplication. But the most recently ingested fragments based on server time stamps are
included in the HLS media playlist. This means that even if fragments ingested in the past have producer time
stamps with values now, they are not included in the HLS media playlist.
The default is SERVER_TIMESTAMP
.
HLSTimestampRange timestampRange
The start and end of the time stamp range for the requested media.
This value should not be present if PlaybackType
is LIVE
.
Date startTimestamp
The start of the time stamp range for the requested media.
If the HLSTimestampRange
value is specified, the StartTimestamp
value is required.
This value is inclusive. Fragments that start before the StartTimestamp
and continue past it are
included in the session. If FragmentSelectorType
is SERVER_TIMESTAMP
, the
StartTimestamp
must be later than the stream head.
Date endTimestamp
The end of the time stamp range for the requested media. This value must be within 3 hours of the specified
StartTimestamp
, and it must be later than the StartTimestamp
value.
If FragmentSelectorType
for the request is SERVER_TIMESTAMP
, this value must be in the
past.
If the HLSTimestampRange
value is specified, the EndTimestamp
value is required.
This value is inclusive. The EndTimestamp
is compared to the (starting) time stamp of the fragment.
Fragments that start before the EndTimestamp
value and continue past it are included in the session.
String streamName
The name of the stream from which to retrieve a fragment list.
Long maxResults
The total number of fragments to return. If the total number of fragments available is more than the value
specified in max-results
, then a ListFragmentsOutput$NextToken is provided in the output that
you can use to resume pagination.
String nextToken
A token to specify where to start paginating. This is the ListFragmentsOutput$NextToken from a previously truncated response.
FragmentSelector fragmentSelector
Describes the time stamp range and time stamp origin for the range of fragments to return.
List<E> fragments
A list of fragment numbers that correspond to the time stamp range provided.
String nextToken
If the returned list is truncated, the operation returns this token to use to retrieve the next page of results.
This value is null
when there are no more results to return.
Integer maxResults
The maximum number of streams to return in the response. The default is 10,000.
String nextToken
If you specify this parameter, when the result of a ListStreams
operation is truncated, the call
returns the NextToken
in the response. To get another batch of streams, provide this token in your
next request.
StreamNameCondition streamNameCondition
Optional: Returns only streams that satisfy a specific condition. Currently, you can specify only the prefix of a stream name as a condition.
String nextToken
If you specify this parameter and the result of a ListTagsForStream
call is truncated, the response
includes a token that you can use in the next request to fetch the next batch of tags.
String streamARN
The Amazon Resource Name (ARN) of the stream that you want to list tags for.
String streamName
The name of the stream that you want to list tags for.
String streamName
You pass this value as the x-amzn-stream-name
HTTP header.
Name of the Kinesis video stream where you want to write the media content. If you don't specify the
streamName
, you must specify the streamARN
.
String streamARN
You pass this value as the x-amzn-stream-arn
HTTP header.
Amazon Resource Name (ARN) of the Kinesis video stream where you want to write the media content. If you don't
specify the streamARN
, you must specify the streamName
.
String fragmentTimecodeType
You pass this value as the x-amzn-fragment-timecode-type
HTTP header.
Indicates whether timecodes in the fragments (payload, HTTP request body) are absolute or relative to
producerStartTimestamp
. Kinesis Video Streams uses this information to compute the
producer_timestamp
for the fragment received in the request, as described in the API overview.
Date producerStartTimestamp
You pass this value as the x-amzn-producer-start-timestamp
HTTP header.
This is the producer time stamp at which the producer started recording the media (not the time stamp of the specific fragments in the request).
InputStream payload
The media content to write to the Kinesis video stream. In the current implementation, Kinesis Video Streams supports only the Matroska (MKV) container format with a single MKV segment. A segment can contain one or more clusters.
Each MKV cluster maps to a Kinesis video stream fragment. Whatever cluster duration you choose becomes the fragment duration.
InputStream payload
After Kinesis Video Streams successfully receives a PutMedia
request, the service validates the
request headers. The service then starts reading the payload and first sends an HTTP 200 response.
The service then returns a stream containing a series of JSON objects (Acknowledgement
objects)
separated by newlines. The acknowledgements are received on the same connection on which the media data is sent.
There can be many acknowledgements for a PutMedia
request. Each Acknowledgement
consists of the following key-value pairs:
AckEventType
- Event type the acknowledgement represents.
Buffering: Kinesis Video Streams has started receiving the fragment. Kinesis Video Streams sends the first Buffering acknowledgement when the first byte of fragment data is received.
Received: Kinesis Video Streams received the entire fragment. If you did not configure the stream to persist the data, the producer can stop buffering the fragment upon receiving this acknowledgement.
Persisted: Kinesis Video Streams has persisted the fragment (for example, to Amazon S3). You get this acknowledgement if you configured the stream to persist the data. After you receive this acknowledgement, the producer can stop buffering the fragment.
Error: Kinesis Video Streams ran into an error while processing the fragment. You can review the error code and determine the next course of action.
Idle: The PutMedia
session is in-progress. However, Kinesis Video Streams is currently not
receiving data. Kinesis Video Streams sends this acknowledgement periodically for up to 30 seconds after the last
received data. If no data is received within the 30 seconds, Kinesis Video Streams closes the request.
This acknowledgement can help a producer determine if the PutMedia
connection is alive, even if it
is not sending any data.
FragmentTimeCode
- Fragment timecode for which acknowledgement is sent.
The element can be missing if the AckEventType
is Idle.
FragmentNumber
- Kinesis Video Streams-generated fragment number for which the acknowledgement is
sent.
ErrorId
and ErrorCode
- If the AckEventType
is ErrorId, this field
provides corresponding error code. The following is the list of error codes:
4000 - Error reading the data stream.
4001 - Fragment size is greater than maximum limit, 50 MB, allowed.
4002 - Fragment duration is greater than maximum limit, 10 seconds, allowed.
4003 - Connection duration is greater than maximum allowed threshold.
4004 - Fragment timecode is less than the timecode previous time code (within a PutMedia
call, you
cannot send fragments out of order).
4005 - More than one track is found in MKV.
4006 - Failed to parse the input stream as valid MKV format.
4007 - Invalid producer timestamp.
4008 - Stream no longer exists (deleted).
4500 - Access to the stream's specified KMS key is denied.
4501 - The stream's specified KMS key is disabled.
4502 - The stream's specified KMS key failed validation.
4503 - The stream's specified KMS key is unavailable.
4504 - Invalid usage of the stream's specified KMS key.
4505 - The stream's specified KMS key is in an invalid state.
4506 - The stream's specified KMS key is not found.
5000 - Internal service error
5001 - Kinesis Video Streams failed to persist fragments to the data store.
The producer, while sending the payload for a long running PutMedia
request, should read the
response for acknowledgements. A producer might receive chunks of acknowledgements at the same time, due to
buffering on an intermediate proxy server. A producer that wants to receive timely acknowledgements can send
fewer fragments in each PutMedia
request.
String startSelectorType
Identifies the fragment on the Kinesis video stream where you want to start getting the data from.
NOW - Start with the latest chunk on the stream.
EARLIEST - Start with earliest available chunk on the stream.
FRAGMENT_NUMBER - Start with the chunk containing the specific fragment. You must also specify the
StartFragmentNumber
.
PRODUCER_TIMESTAMP or SERVER_TIMESTAMP - Start with the chunk containing a fragment with the specified producer
or server time stamp. You specify the time stamp by adding StartTimestamp
.
CONTINUATION_TOKEN - Read using the specified continuation token.
If you choose the NOW, EARLIEST, or CONTINUATION_TOKEN as the startSelectorType
, you don't provide
any additional information in the startSelector
.
String afterFragmentNumber
Specifies the fragment number from where you want the GetMedia
API to start returning the fragments.
Date startTimestamp
A time stamp value. This value is required if you choose the PRODUCER_TIMESTAMP or the SERVER_TIMESTAMP as the
startSelectorType
. The GetMedia
API then starts with the chunk containing the fragment
that has the specified time stamp.
String continuationToken
Continuation token that Kinesis Video Streams returned in the previous GetMedia
response. The
GetMedia
API then starts with the chunk identified by the continuation token.
String deviceName
The name of the device that is associated with the stream.
String streamName
The name of the stream.
String streamARN
The Amazon Resource Name (ARN) of the stream.
String mediaType
The MediaType
of the stream.
String kmsKeyId
The ID of the AWS Key Management Service (AWS KMS) key that Kinesis Video Streams uses to encrypt data on the stream.
String version
The version of the stream.
String status
The status of the stream.
Date creationTime
A time stamp that indicates when the stream was created.
Integer dataRetentionInHours
How long the stream retains data, in hours.
String streamARN
The Amazon Resource Name (ARN) of the resource that you want to add the tag or tags to.
String streamName
The name of the stream that you want to add the tag or tags to.
Map<K,V> tags
A list of tags to associate with the specified stream. Each tag is a key-value pair (the value is optional).
String streamName
The name of the stream whose retention period you want to change.
String streamARN
The Amazon Resource Name (ARN) of the stream whose retention period you want to change.
String currentVersion
The version of the stream whose retention period you want to change. To get the version, call either the
DescribeStream
or the ListStreams
API.
String operation
Indicates whether you want to increase or decrease the retention period.
Integer dataRetentionChangeInHours
The retention period, in hours. The value you specify replaces the current value.
String streamName
The name of the stream whose metadata you want to update.
The stream name is an identifier for the stream, and must be unique for each account and region.
String streamARN
The ARN of the stream whose metadata you want to update.
String currentVersion
The version of the stream whose metadata you want to update.
String deviceName
The name of the device that is writing to the stream.
In the current implementation, Kinesis Video Streams does not use this name.
String mediaType
The stream's media type. Use MediaType
to specify the type of content that the stream contains to
the consumers of the stream. For more information about media types, see Media Types. If you choose to specify
the MediaType
, see Naming
Requirements.
To play video on the console, you must specify the correct video type. For example, if the video in the stream is
H.264, specify video/h264
as the MediaType
.
Copyright © 2019. All rights reserved.