"documentation":"<p>Retrieves an HTTP Live Streaming (HLS) URL for the stream. You can then open the URL in a browser or media player to view the stream contents.</p> <p>You must specify either the <code>StreamName</code> or the <code>StreamARN</code>.</p> <p>An Amazon Kinesis video stream has the following requirements for providing data through HLS:</p> <ul> <li> <p>The media type must be <code>video/h264</code>.</p> </li> <li> <p>Data retention must be greater than 0.</p> </li> <li> <p>The fragments must contain codec private data in the AVC (Advanced Video Coding) for H.264 format (<a href=\"https://www.iso.org/standard/55980.html\">MPEG-4 specification ISO/IEC 14496-15</a>). For information about adapting stream data to a given format, see <a href=\"http://docs.aws.amazon.com/kinesisvideostreams/latest/dg/latest/dg/producer-reference-nal.html\">NAL Adaptation Flags</a>.</p> </li> </ul> <p>Kinesis Video Streams HLS sessions contain fragments in the fragmented MPEG-4 form (also called fMP4 or CMAF), rather than the MPEG-2 form (also called TS chunks, which the HLS specification also supports). For more information about HLS fragment types, see the <a href=\"https://tools.ietf.org/html/draft-pantos-http-live-streaming-23\">HLS specification</a>.</p> <p>The following procedure shows how to use HLS with Kinesis Video Streams:</p> <ol> <li> <p>Get an endpoint using <a href=\"http://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_GetDataEndpoint.html\">GetDataEndpoint</a>,specifying<code>GET_HLS_STREAMING_SESSION_URL</code>forthe<code>APIName</code>parameter.</p></li><li><p>RetrievetheHLSURLusing<code>GetHLSStreamingSessionURL</code>.KinesisVideoStreamscreatesanHLSstreamingsessiontobeusedforaccessingcontentinastreamusingtheHLSprotocol.<code>GetHLSStreamingSessionURL</code>returnsanauthenticatedURL(thatincludesanencryptedsessiontoken)forthesession'sHLS<i>masterplaylist</i>(therootresourceneededforstreamingwithHLS).</p><note><p>Don'tshareorstorethistokenwhereanunauthorizedentitycouldaccessit.Thetokenprovidesaccesstothecontentofthestream.SafeguardthetokenwiththesamemeasuresthatyouwouldusewithyourAWScredentials.</p></note><p>Themediathatismadeavailablethroughtheplaylistconsistsonlyoftherequestedstream,timerange,andformat.Noothermediadata(suchasframesoutsidetherequestedwindoworalternatebitrates)ismadeavailable.</p></li><li><p>ProvidetheURL(containingtheencryptedsessiontoken)fortheHLSmasterplaylisttoamediaplayerthatsupportstheHLSprotocol.KinesisVideoStreamsmakestheHLSmediaplaylist,initializationfragment,andmediafragmentsavailablethroughthemasterplaylistURL.Theinitializationfragmentcontainsthecodecprivatedataforthestream,andotherdataneededtosetupthevideodecoderandrenderer.ThemediafragmentscontainH.264-encodedvideoframesandtimestamps.</p></li><li><p>ThemediaplayerreceivestheauthenticatedURLandrequestsstreammetadataandmediadatanormally.Whenthemediaplayerrequestsdata,itcallsthefollowingactions:</p><ul><li><p><b>GetHLSMasterPlaylist:</b>RetrievesanHLSmasterplaylist,whichcontainsaURLforthe<code>GetHLSMediaPlaylist</code>action,andadditionalmetadataforthemediaplayer,includingestimatedbitrateandresolution.</p></li><li><p><b>GetHLSMediaPlaylist:</b>RetrievesanHLSmediaplaylist,whichcontainsaURLtoaccesstheMP4initializationfragmentwiththe<code>GetMP4InitFragment</code>action,andURLstoaccesstheMP4mediafragmentswiththe<code>GetMP4MediaFragment</code>actions.TheHLSmediaplaylistalsocontainsmetadataaboutthestreamthattheplayerneedstoplayit,suchaswhetherthe<code>PlaybackMode</code>is<code>LIVE</code>or<code>ON_DEMAND</code>.TheHLSmediaplaylististypicallystaticforsessionswitha<code>PlaybackType</code>of<code>ON_DEMAND</code>.TheHLSmediaplaylistiscontinuallyupdatedwithnewfragmentsforse
"documentation":"<p>Gets media for a list of fragments (specified by fragment number) from the archived data in an Amazon Kinesis video stream.</p> <p>The following limits apply when using the <code>GetMediaForFragmentList</code> API:</p> <ul> <li> <p>A client can call <code>GetMediaForFragmentList</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>GetMediaForFragmentList</code> session. </p> </li> </ul>"
"documentation":"<p>Returns a list of <a>Fragment</a> objects from the specified stream and start location within the archived data.</p>"
}
},
"shapes":{
"ClientLimitExceededException":{
"type":"structure",
"members":{
"Message":{"shape":"ErrorMessage"}
},
"documentation":"<p>Kinesis Video Streams has throttled the request because you have exceeded the limit of allowed client calls. Try making the call later.</p>",
"documentation":"<p>The name of the stream for which to retrieve the HLS master playlist URL.</p> <p>You must specify either the <code>StreamName</code> or the <code>StreamARN</code>.</p>"
},
"StreamARN":{
"shape":"ResourceARN",
"documentation":"<p>The Amazon Resource Name (ARN) of the stream for which to retrieve the HLS master playlist URL.</p> <p>You must specify either the <code>StreamName</code> or the <code>StreamARN</code>.</p>"
},
"PlaybackMode":{
"shape":"PlaybackMode",
"documentation":"<p>Whether to retrieve live or archived, on-demand data.</p> <p>Features of the two types of session include the following:</p> <ul> <li> <p> <b> <code>LIVE</code> </b>: 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.</p> <note> <p>In <code>LIVE</code> 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.</p> </note> </li> <li> <p> <b> <code>ON_DEMAND</code> </b>: For sessions of this type, the HLS media playlist contains all the fragments for the session, up to the number that is specified in <code>MaxMediaPlaylistFragmentResults</code>. 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.</p> </li> </ul> <p>In both playback modes, if <code>FragmentSelectorType</code> is <code>PRODUCER_TIMESTAMP</code>, 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.</p> <p>The default is <code>LIVE</code>.</p>"
},
"HLSFragmentSelector":{
"shape":"HLSFragmentSelector",
"documentation":"<p>The time range of the requested fragment, and the source of the time stamps.</p> <p>This parameter is required if <code>PlaybackMode</code> is <code>ON_DEMAND</code>. This parameter is optional if <code>PlaybackMode</code> is <code>LIVE</code>. If <code>PlaybackMode</code> is <code>LIVE</code>, the <code>FragmentSelectorType</code> can be set, but the <code>TimestampRange</code> should not be set. If <code>PlaybackMode</code> is <code>ON_DEMAND</code>, both <code>FragmentSelectorType</code> and <code>TimestampRange</code> must be set.</p>"
},
"DiscontinuityMode":{
"shape":"DiscontinuityMode",
"documentation":"<p>Specifies when flags marking discontinuities between fragments will be added to the media playlists. The default is <code>ALWAYS</code> when <a>HLSFragmentSelector</a> is <code>SERVER_TIMESTAMP</code>, and <code>NEVER</code> when it is <code>PRODUCER_TIMESTAMP</code>.</p> <p>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 <a>HLSFragmentSelector</a> is <code>SERVER_TIMESTAMP</code>), 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.</p>"
},
"Expires":{
"shape":"Expires",
"documentation":"<p>The time in seconds until the requested session expires. This value can be between 300 (5 minutes) and 43200 (12 hours).</p> <p>When a session expires, no new calls to <code>GetHLSMasterPlaylist</code>, <code>GetHLSMediaPlaylist</code>, <code>GetMP4InitFragment</code>, or <code>GetMP4MediaFragment</code> can be made for that session.</p> <p>The default is 300 (5 minutes).</p>"
},
"MaxMediaPlaylistFragmentResults":{
"shape":"PageLimit",
"documentation":"<p>The maximum number of fragments that are returned in the HLS media playlists.</p> <p>When the <code>PlaybackMode</code> is <code>LIVE</code>, the most recent fragments are returned up to this value. When the <code>PlaybackMode</code> is <code>ON_DEMAND</code>, the oldest fragments are returned, up to this maximum number.</p> <p>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.</p> <p>The default is 5 fragments if <code>PlaybackMode</code> is <code>LIVE</code>, and 1,000 if <code>PlaybackMode</code> is <code>ON_DEMAND</code>. </p> <p>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.</p>"
}
}
},
"GetHLSStreamingSessionURLOutput":{
"type":"structure",
"members":{
"HLSStreamingSessionURL":{
"shape":"HLSStreamingSessionURL",
"documentation":"<p>The URL (containing the session token) that a media player can use to retrieve the HLS master playlist.</p>"
"documentation":"<p>The payload that Kinesis Video Streams returns is a sequence of chunks from the specified stream. For information about the chunks, see <a href=\"http://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_dataplane_PutMedia.html\">PutMedia</a>. The chunks that Kinesis Video Streams returns in the <code>GetMediaForFragmentList</code> call also include the following additional Matroska (MKV) tags: </p> <ul> <li> <p>AWS_KINESISVIDEO_FRAGMENT_NUMBER - Fragment number returned in the chunk.</p> </li> <li> <p>AWS_KINESISVIDEO_SERVER_SIDE_TIMESTAMP - Server-side time stamp of the fragment.</p> </li> <li> <p>AWS_KINESISVIDEO_PRODUCER_SIDE_TIMESTAMP - Producer-side time stamp of the fragment.</p> </li> </ul> <p>The following tags will be included if an exception occurs:</p> <ul> <li> <p>AWS_KINESISVIDEO_FRAGMENT_NUMBER - The number of the fragment that threw the exception</p> </li> <li> <p>AWS_KINESISVIDEO_EXCEPTION_ERROR_CODE - The integer code of the exception</p> </li> <li> <p>AWS_KINESISVIDEO_EXCEPTION_MESSAGE - A text description of the exception</p> </li> </ul>"
"documentation":"<p>The source of the time stamps for the requested media.</p> <p>When <code>FragmentSelectorType</code> is set to <code>PRODUCER_TIMESTAMP</code> and <a>GetHLSStreamingSessionURLInput$PlaybackMode</a> is <code>ON_DEMAND</code>, the first fragment ingested with a producer time stamp within the specified <a>FragmentSelector$TimestampRange</a> is included in the media playlist. In addition, the fragments with producer time stamps within the <code>TimestampRange</code> ingested immediately following the first fragment (up to the <a>GetHLSStreamingSessionURLInput$MaxMediaPlaylistFragmentResults</a> value) are included. </p> <p>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.</p> <p>When <code>FragmentSelectorType</code> is set to <code>PRODUCER_TIMESTAMP</code> and <a>GetHLSStreamingSessionURLInput$PlaybackMode</a> is <code>LIVE</code>, 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.</p> <p>The default is <code>SERVER_TIMESTAMP</code>.</p>"
},
"TimestampRange":{
"shape":"HLSTimestampRange",
"documentation":"<p>The start and end of the time stamp range for the requested media.</p> <p>This value should not be present if <code>PlaybackType</code> is <code>LIVE</code>.</p>"
}
},
"documentation":"<p>Contains the range of time stamps for the requested media, and the source of the time stamps.</p>"
},
"HLSFragmentSelectorType":{
"type":"string",
"enum":[
"PRODUCER_TIMESTAMP",
"SERVER_TIMESTAMP"
]
},
"HLSStreamingSessionURL":{"type":"string"},
"HLSTimestampRange":{
"type":"structure",
"members":{
"StartTimestamp":{
"shape":"Timestamp",
"documentation":"<p>The start of the time stamp range for the requested media.</p> <p>If the <code>HLSTimestampRange</code> value is specified, the <code>StartTimestamp</code> value is required.</p> <note> <p>This value is inclusive. Fragments that start before the <code>StartTimestamp</code> and continue past it are included in the session. If <code>FragmentSelectorType</code> is <code>SERVER_TIMESTAMP</code>, the <code>StartTimestamp</code> must be later than the stream head.</p> </note>"
},
"EndTimestamp":{
"shape":"Timestamp",
"documentation":"<p>The end of the time stamp range for the requested media. This value must be within 3 hours of the specified <code>StartTimestamp</code>, and it must be later than the <code>StartTimestamp</code> value.</p> <p>If <code>FragmentSelectorType</code> for the request is <code>SERVER_TIMESTAMP</code>, this value must be in the past.</p> <p>If the <code>HLSTimestampRange</code> value is specified, the <code>EndTimestamp</code> value is required.</p> <note> <p>This value is inclusive. The <code>EndTimestamp</code> is compared to the (starting) time stamp of the fragment. Fragments that start before the <code>EndTimestamp</code> value and continue past it are included in the session.</p> </note>"
}
},
"documentation":"<p>The start and end of the time stamp range for the requested media.</p> <p>This value should not be present if <code>PlaybackType</code> is <code>LIVE</code>.</p> <note> <p>The values in the <code>HLSTimestampRange</code> are inclusive. Fragments that begin before the start time but continue past it, or fragments that begin before the end time but continue past it, are included in the session.</p> </note>"
"documentation":"<p>The name of the stream from which to retrieve a fragment list.</p>"
},
"MaxResults":{
"shape":"PageLimit",
"documentation":"<p>The total number of fragments to return. If the total number of fragments available is more than the value specified in <code>max-results</code>, then a <a>ListFragmentsOutput$NextToken</a> is provided in the output that you can use to resume pagination.</p>"
},
"NextToken":{
"shape":"String",
"documentation":"<p>A token to specify where to start paginating. This is the <a>ListFragmentsOutput$NextToken</a> from a previously truncated response.</p>"
},
"FragmentSelector":{
"shape":"FragmentSelector",
"documentation":"<p>Describes the time stamp range and time stamp origin for the range of fragments to return.</p>"
}
}
},
"ListFragmentsOutput":{
"type":"structure",
"members":{
"Fragments":{
"shape":"FragmentList",
"documentation":"<p>A list of fragment numbers that correspond to the time stamp range provided.</p>"
},
"NextToken":{
"shape":"String",
"documentation":"<p>If the returned list is truncated, the operation returns this token to use to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>"
"documentation":"<p>No Codec Private Data was found in the video stream.</p>",
"error":{"httpStatusCode":400},
"exception":true
},
"NoDataRetentionException":{
"type":"structure",
"members":{
"Message":{"shape":"ErrorMessage"}
},
"documentation":"<p>A <code>PlaybackMode</code> of <code>ON_DEMAND</code> was requested for a stream that does not retain data (that is, has a <code>DataRetentionInHours</code> of 0). </p>",
"documentation":"<p> <code>GetMedia</code> throws this error when Kinesis Video Streams can't find the stream that you specified.</p> <p> <code>GetHLSStreamingSessionURL</code> throws this error if a session with a <code>PlaybackMode</code> of <code>ON_DEMAND</code> is requested for a stream that has no fragments within the requested time range, or if a session with a <code>PlaybackMode</code> of <code>LIVE</code> is requested for a stream that has no fragments within the last 30 seconds.</p>",