| 1 | package Paws::KinesisVideoArchivedMedia; | ||
| 2 | use Moose; | ||
| 3 | sub service { 'kinesisvideo' } | ||
| 4 | sub signing_name { 'kinesisvideo' } | ||
| 5 | sub version { '2017-09-30' } | ||
| 6 | sub flattened_arrays { 0 } | ||
| 7 | has max_attempts => (is => 'ro', isa => 'Int', default => 5); | ||
| 8 | has retry => (is => 'ro', isa => 'HashRef', default => sub { | ||
| 9 | { base => 'rand', type => 'exponential', growth_factor => 2 } | ||
| 10 | }); | ||
| 11 | has retriables => (is => 'ro', isa => 'ArrayRef', default => sub { [ | ||
| 12 | ] }); | ||
| 13 | |||
| 14 | with 'Paws::API::Caller', 'Paws::API::EndpointResolver', 'Paws::Net::V4Signature', 'Paws::Net::RestJsonCaller'; | ||
| 15 | |||
| 16 | |||
| 17 | sub GetClip { | ||
| 18 | my $self = shift; | ||
| 19 | my $call_object = $self->new_with_coercions('Paws::KinesisVideoArchivedMedia::GetClip', @_); | ||
| 20 | return $self->caller->do_call($self, $call_object); | ||
| 21 | } | ||
| 22 | sub GetDASHStreamingSessionURL { | ||
| 23 | my $self = shift; | ||
| 24 | my $call_object = $self->new_with_coercions('Paws::KinesisVideoArchivedMedia::GetDASHStreamingSessionURL', @_); | ||
| 25 | return $self->caller->do_call($self, $call_object); | ||
| 26 | } | ||
| 27 | sub GetHLSStreamingSessionURL { | ||
| 28 | my $self = shift; | ||
| 29 | my $call_object = $self->new_with_coercions('Paws::KinesisVideoArchivedMedia::GetHLSStreamingSessionURL', @_); | ||
| 30 | return $self->caller->do_call($self, $call_object); | ||
| 31 | } | ||
| 32 | sub GetMediaForFragmentList { | ||
| 33 | my $self = shift; | ||
| 34 | my $call_object = $self->new_with_coercions('Paws::KinesisVideoArchivedMedia::GetMediaForFragmentList', @_); | ||
| 35 | return $self->caller->do_call($self, $call_object); | ||
| 36 | } | ||
| 37 | sub ListFragments { | ||
| 38 | my $self = shift; | ||
| 39 | my $call_object = $self->new_with_coercions('Paws::KinesisVideoArchivedMedia::ListFragments', @_); | ||
| 40 | return $self->caller->do_call($self, $call_object); | ||
| 41 | } | ||
| 42 | |||
| 43 | sub ListAllFragments { | ||
| 44 | my $self = shift; | ||
| 45 | |||
| 46 | my $callback = shift @_ if (ref($_[0]) eq 'CODE'); | ||
| 47 | my $result = $self->ListFragments(@_); | ||
| 48 | my $next_result = $result; | ||
| 49 | |||
| 50 | if (not defined $callback) { | ||
| 51 | while ($next_result->NextToken) { | ||
| 52 | $next_result = $self->ListFragments(@_, NextToken => $next_result->NextToken); | ||
| 53 | push @{ $result->Fragments }, @{ $next_result->Fragments }; | ||
| 54 | } | ||
| 55 | return $result; | ||
| 56 | } else { | ||
| 57 | while ($result->NextToken) { | ||
| 58 | $callback->($_ => 'Fragments') foreach (@{ $result->Fragments }); | ||
| 59 | $result = $self->ListFragments(@_, NextToken => $result->NextToken); | ||
| 60 | } | ||
| 61 | $callback->($_ => 'Fragments') foreach (@{ $result->Fragments }); | ||
| 62 | } | ||
| 63 | |||
| 64 | return undef | ||
| 65 | } | ||
| 66 | |||
| 67 | |||
| 68 | sub operations { qw/GetClip GetDASHStreamingSessionURL GetHLSStreamingSessionURL GetMediaForFragmentList ListFragments / } | ||
| 69 | |||
| 70 | 1; | ||
| 71 | |||
| 72 | ### main pod documentation begin ### | ||
| 73 | |||
| 74 | =head1 NAME | ||
| 75 | |||
| 76 | Paws::KinesisVideoArchivedMedia - Perl Interface to AWS Amazon Kinesis Video Streams Archived Media | ||
| 77 | |||
| 78 | =head1 SYNOPSIS | ||
| 79 | |||
| 80 | use Paws; | ||
| 81 | |||
| 82 | my $obj = Paws->service('KinesisVideoArchivedMedia'); | ||
| 83 | my $res = $obj->Method( | ||
| 84 | Arg1 => $val1, | ||
| 85 | Arg2 => [ 'V1', 'V2' ], | ||
| 86 | # if Arg3 is an object, the HashRef will be used as arguments to the constructor | ||
| 87 | # of the arguments type | ||
| 88 | Arg3 => { Att1 => 'Val1' }, | ||
| 89 | # if Arg4 is an array of objects, the HashRefs will be passed as arguments to | ||
| 90 | # the constructor of the arguments type | ||
| 91 | Arg4 => [ { Att1 => 'Val1' }, { Att1 => 'Val2' } ], | ||
| 92 | ); | ||
| 93 | |||
| 94 | =head1 DESCRIPTION | ||
| 95 | |||
| 96 | |||
| 97 | |||
| 98 | For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30> | ||
| 99 | |||
| 100 | |||
| 101 | =head1 METHODS | ||
| 102 | |||
| 103 | =head2 GetClip | ||
| 104 | |||
| 105 | =over | ||
| 106 | |||
| 107 | =item ClipFragmentSelector => L<Paws::KinesisVideoArchivedMedia::ClipFragmentSelector> | ||
| 108 | |||
| 109 | =item [StreamARN => Str] | ||
| 110 | |||
| 111 | =item [StreamName => Str] | ||
| 112 | |||
| 113 | |||
| 114 | =back | ||
| 115 | |||
| 116 | Each argument is described in detail in: L<Paws::KinesisVideoArchivedMedia::GetClip> | ||
| 117 | |||
| 118 | Returns: a L<Paws::KinesisVideoArchivedMedia::GetClipOutput> instance | ||
| 119 | |||
| 120 | Downloads an MP4 file (clip) containing the archived, on-demand media | ||
| 121 | from the specified video stream over the specified time range. | ||
| 122 | |||
| 123 | Both the StreamName and the StreamARN parameters are optional, but you | ||
| 124 | must specify either the StreamName or the StreamARN when invoking this | ||
| 125 | API operation. | ||
| 126 | |||
| 127 | As a prerequisite to using GetCLip API, you must obtain an endpoint | ||
| 128 | using C<GetDataEndpoint>, specifying GET_CLIP forC< the C<APIName> | ||
| 129 | parameter.> | ||
| 130 | |||
| 131 | An Amazon Kinesis video stream has the following requirements for | ||
| 132 | providing data through MP4: | ||
| 133 | |||
| 134 | =over | ||
| 135 | |||
| 136 | =item * | ||
| 137 | |||
| 138 | The media must contain h.264 or h.265 encoded video and, optionally, | ||
| 139 | AAC or G.711 encoded audio. Specifically, the codec ID of track 1 | ||
| 140 | should be C<V_MPEG/ISO/AVC> (for h.264) or V_MPEGH/ISO/HEVC (for | ||
| 141 | H.265). Optionally, the codec ID of track 2 should be C<A_AAC> (for | ||
| 142 | AAC) or A_MS/ACM (for G.711). | ||
| 143 | |||
| 144 | =item * | ||
| 145 | |||
| 146 | Data retention must be greater than 0. | ||
| 147 | |||
| 148 | =item * | ||
| 149 | |||
| 150 | The video track of each fragment must contain codec private data in the | ||
| 151 | Advanced Video Coding (AVC) for H.264 format and HEVC for H.265 format. | ||
| 152 | For more information, see MPEG-4 specification ISO/IEC 14496-15 | ||
| 153 | (https://www.iso.org/standard/55980.html). For information about | ||
| 154 | adapting stream data to a given format, see NAL Adaptation Flags | ||
| 155 | (http://docs.aws.amazon.com/kinesisvideostreams/latest/dg/producer-reference-nal.html). | ||
| 156 | |||
| 157 | =item * | ||
| 158 | |||
| 159 | The audio track (if present) of each fragment must contain codec | ||
| 160 | private data in the AAC format (AAC specification ISO/IEC 13818-7 | ||
| 161 | (https://www.iso.org/standard/43345.html)) or the MS Wave format | ||
| 162 | (http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html). | ||
| 163 | |||
| 164 | =back | ||
| 165 | |||
| 166 | You can monitor the amount of outgoing data by monitoring the | ||
| 167 | C<GetClip.OutgoingBytes> Amazon CloudWatch metric. For information | ||
| 168 | about using CloudWatch to monitor Kinesis Video Streams, see Monitoring | ||
| 169 | Kinesis Video Streams | ||
| 170 | (http://docs.aws.amazon.com/kinesisvideostreams/latest/dg/monitoring.html). | ||
| 171 | For pricing information, see Amazon Kinesis Video Streams Pricing | ||
| 172 | (https://aws.amazon.com/kinesis/video-streams/pricing/) and AWS Pricing | ||
| 173 | (https://aws.amazon.com/pricing/). Charges for outgoing AWS data apply. | ||
| 174 | |||
| 175 | |||
| 176 | =head2 GetDASHStreamingSessionURL | ||
| 177 | |||
| 178 | =over | ||
| 179 | |||
| 180 | =item [DASHFragmentSelector => L<Paws::KinesisVideoArchivedMedia::DASHFragmentSelector>] | ||
| 181 | |||
| 182 | =item [DisplayFragmentNumber => Str] | ||
| 183 | |||
| 184 | =item [DisplayFragmentTimestamp => Str] | ||
| 185 | |||
| 186 | =item [Expires => Int] | ||
| 187 | |||
| 188 | =item [MaxManifestFragmentResults => Int] | ||
| 189 | |||
| 190 | =item [PlaybackMode => Str] | ||
| 191 | |||
| 192 | =item [StreamARN => Str] | ||
| 193 | |||
| 194 | =item [StreamName => Str] | ||
| 195 | |||
| 196 | |||
| 197 | =back | ||
| 198 | |||
| 199 | Each argument is described in detail in: L<Paws::KinesisVideoArchivedMedia::GetDASHStreamingSessionURL> | ||
| 200 | |||
| 201 | Returns: a L<Paws::KinesisVideoArchivedMedia::GetDASHStreamingSessionURLOutput> instance | ||
| 202 | |||
| 203 | Retrieves an MPEG Dynamic Adaptive Streaming over HTTP (DASH) URL for | ||
| 204 | the stream. You can then open the URL in a media player to view the | ||
| 205 | stream contents. | ||
| 206 | |||
| 207 | Both the C<StreamName> and the C<StreamARN> parameters are optional, | ||
| 208 | but you must specify either the C<StreamName> or the C<StreamARN> when | ||
| 209 | invoking this API operation. | ||
| 210 | |||
| 211 | An Amazon Kinesis video stream has the following requirements for | ||
| 212 | providing data through MPEG-DASH: | ||
| 213 | |||
| 214 | =over | ||
| 215 | |||
| 216 | =item * | ||
| 217 | |||
| 218 | The media must contain h.264 or h.265 encoded video and, optionally, | ||
| 219 | AAC or G.711 encoded audio. Specifically, the codec ID of track 1 | ||
| 220 | should be C<V_MPEG/ISO/AVC> (for h.264) or V_MPEGH/ISO/HEVC (for | ||
| 221 | H.265). Optionally, the codec ID of track 2 should be C<A_AAC> (for | ||
| 222 | AAC) or A_MS/ACM (for G.711). | ||
| 223 | |||
| 224 | =item * | ||
| 225 | |||
| 226 | Data retention must be greater than 0. | ||
| 227 | |||
| 228 | =item * | ||
| 229 | |||
| 230 | The video track of each fragment must contain codec private data in the | ||
| 231 | Advanced Video Coding (AVC) for H.264 format and HEVC for H.265 format. | ||
| 232 | For more information, see MPEG-4 specification ISO/IEC 14496-15 | ||
| 233 | (https://www.iso.org/standard/55980.html). For information about | ||
| 234 | adapting stream data to a given format, see NAL Adaptation Flags | ||
| 235 | (http://docs.aws.amazon.com/kinesisvideostreams/latest/dg/producer-reference-nal.html). | ||
| 236 | |||
| 237 | =item * | ||
| 238 | |||
| 239 | The audio track (if present) of each fragment must contain codec | ||
| 240 | private data in the AAC format (AAC specification ISO/IEC 13818-7 | ||
| 241 | (https://www.iso.org/standard/43345.html)) or the MS Wave format | ||
| 242 | (http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html). | ||
| 243 | |||
| 244 | =back | ||
| 245 | |||
| 246 | The following procedure shows how to use MPEG-DASH with Kinesis Video | ||
| 247 | Streams: | ||
| 248 | |||
| 249 | =over | ||
| 250 | |||
| 251 | =item 1. | ||
| 252 | |||
| 253 | Get an endpoint using GetDataEndpoint | ||
| 254 | (http://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_GetDataEndpoint.html), | ||
| 255 | specifying C<GET_DASH_STREAMING_SESSION_URL> for the C<APIName> | ||
| 256 | parameter. | ||
| 257 | |||
| 258 | =item 2. | ||
| 259 | |||
| 260 | Retrieve the MPEG-DASH URL using C<GetDASHStreamingSessionURL>. Kinesis | ||
| 261 | Video Streams creates an MPEG-DASH streaming session to be used for | ||
| 262 | accessing content in a stream using the MPEG-DASH protocol. | ||
| 263 | C<GetDASHStreamingSessionURL> returns an authenticated URL (that | ||
| 264 | includes an encrypted session token) for the session's MPEG-DASH | ||
| 265 | I<manifest> (the root resource needed for streaming with MPEG-DASH). | ||
| 266 | |||
| 267 | Don't share or store this token where an unauthorized entity can access | ||
| 268 | it. The token provides access to the content of the stream. Safeguard | ||
| 269 | the token with the same measures that you use with your AWS | ||
| 270 | credentials. | ||
| 271 | |||
| 272 | The media that is made available through the manifest consists only of | ||
| 273 | the requested stream, time range, and format. No other media data (such | ||
| 274 | as frames outside the requested window or alternate bitrates) is made | ||
| 275 | available. | ||
| 276 | |||
| 277 | =item 3. | ||
| 278 | |||
| 279 | Provide the URL (containing the encrypted session token) for the | ||
| 280 | MPEG-DASH manifest to a media player that supports the MPEG-DASH | ||
| 281 | protocol. Kinesis Video Streams makes the initialization fragment and | ||
| 282 | media fragments available through the manifest URL. The initialization | ||
| 283 | fragment contains the codec private data for the stream, and other data | ||
| 284 | needed to set up the video or audio decoder and renderer. The media | ||
| 285 | fragments contain encoded video frames or encoded audio samples. | ||
| 286 | |||
| 287 | =item 4. | ||
| 288 | |||
| 289 | The media player receives the authenticated URL and requests stream | ||
| 290 | metadata and media data normally. When the media player requests data, | ||
| 291 | it calls the following actions: | ||
| 292 | |||
| 293 | =over | ||
| 294 | |||
| 295 | =item * | ||
| 296 | |||
| 297 | B<GetDASHManifest:> Retrieves an MPEG DASH manifest, which contains the | ||
| 298 | metadata for the media that you want to playback. | ||
| 299 | |||
| 300 | =item * | ||
| 301 | |||
| 302 | B<GetMP4InitFragment:> Retrieves the MP4 initialization fragment. The | ||
| 303 | media player typically loads the initialization fragment before loading | ||
| 304 | any media fragments. This fragment contains the "C<fytp>" and "C<moov>" | ||
| 305 | MP4 atoms, and the child atoms that are needed to initialize the media | ||
| 306 | player decoder. | ||
| 307 | |||
| 308 | The initialization fragment does not correspond to a fragment in a | ||
| 309 | Kinesis video stream. It contains only the codec private data for the | ||
| 310 | stream and respective track, which the media player needs to decode the | ||
| 311 | media frames. | ||
| 312 | |||
| 313 | =item * | ||
| 314 | |||
| 315 | B<GetMP4MediaFragment:> Retrieves MP4 media fragments. These fragments | ||
| 316 | contain the "C<moof>" and "C<mdat>" MP4 atoms and their child atoms, | ||
| 317 | containing the encoded fragment's media frames and their timestamps. | ||
| 318 | |||
| 319 | After the first media fragment is made available in a streaming | ||
| 320 | session, any fragments that don't contain the same codec private data | ||
| 321 | cause an error to be returned when those different media fragments are | ||
| 322 | loaded. Therefore, the codec private data should not change between | ||
| 323 | fragments in a session. This also means that the session fails if the | ||
| 324 | fragments in a stream change from having only video to having both | ||
| 325 | audio and video. | ||
| 326 | |||
| 327 | Data retrieved with this action is billable. See Pricing | ||
| 328 | (https://aws.amazon.com/kinesis/video-streams/pricing/) for details. | ||
| 329 | |||
| 330 | =back | ||
| 331 | |||
| 332 | =back | ||
| 333 | |||
| 334 | For restrictions that apply to MPEG-DASH sessions, see Kinesis Video | ||
| 335 | Streams Limits | ||
| 336 | (http://docs.aws.amazon.com/kinesisvideostreams/latest/dg/limits.html). | ||
| 337 | |||
| 338 | You can monitor the amount of data that the media player consumes by | ||
| 339 | monitoring the C<GetMP4MediaFragment.OutgoingBytes> Amazon CloudWatch | ||
| 340 | metric. For information about using CloudWatch to monitor Kinesis Video | ||
| 341 | Streams, see Monitoring Kinesis Video Streams | ||
| 342 | (http://docs.aws.amazon.com/kinesisvideostreams/latest/dg/monitoring.html). | ||
| 343 | For pricing information, see Amazon Kinesis Video Streams Pricing | ||
| 344 | (https://aws.amazon.com/kinesis/video-streams/pricing/) and AWS Pricing | ||
| 345 | (https://aws.amazon.com/pricing/). Charges for both HLS sessions and | ||
| 346 | outgoing AWS data apply. | ||
| 347 | |||
| 348 | For more information about HLS, see HTTP Live Streaming | ||
| 349 | (https://developer.apple.com/streaming/) on the Apple Developer site | ||
| 350 | (https://developer.apple.com). | ||
| 351 | |||
| 352 | If an error is thrown after invoking a Kinesis Video Streams archived | ||
| 353 | media API, in addition to the HTTP status code and the response body, | ||
| 354 | it includes the following pieces of information: | ||
| 355 | |||
| 356 | =over | ||
| 357 | |||
| 358 | =item * | ||
| 359 | |||
| 360 | C<x-amz-ErrorType> HTTP header E<ndash> contains a more specific error | ||
| 361 | type in addition to what the HTTP status code provides. | ||
| 362 | |||
| 363 | =item * | ||
| 364 | |||
| 365 | C<x-amz-RequestId> HTTP header E<ndash> if you want to report an issue | ||
| 366 | to AWS, the support team can better diagnose the problem if given the | ||
| 367 | Request Id. | ||
| 368 | |||
| 369 | =back | ||
| 370 | |||
| 371 | Both the HTTP status code and the ErrorType header can be utilized to | ||
| 372 | make programmatic decisions about whether errors are retry-able and | ||
| 373 | under what conditions, as well as provide information on what actions | ||
| 374 | the client programmer might need to take in order to successfully try | ||
| 375 | again. | ||
| 376 | |||
| 377 | For more information, see the B<Errors> section at the bottom of this | ||
| 378 | topic, as well as Common Errors | ||
| 379 | (https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/CommonErrors.html). | ||
| 380 | |||
| 381 | |||
| 382 | =head2 GetHLSStreamingSessionURL | ||
| 383 | |||
| 384 | =over | ||
| 385 | |||
| 386 | =item [ContainerFormat => Str] | ||
| 387 | |||
| 388 | =item [DiscontinuityMode => Str] | ||
| 389 | |||
| 390 | =item [DisplayFragmentTimestamp => Str] | ||
| 391 | |||
| 392 | =item [Expires => Int] | ||
| 393 | |||
| 394 | =item [HLSFragmentSelector => L<Paws::KinesisVideoArchivedMedia::HLSFragmentSelector>] | ||
| 395 | |||
| 396 | =item [MaxMediaPlaylistFragmentResults => Int] | ||
| 397 | |||
| 398 | =item [PlaybackMode => Str] | ||
| 399 | |||
| 400 | =item [StreamARN => Str] | ||
| 401 | |||
| 402 | =item [StreamName => Str] | ||
| 403 | |||
| 404 | |||
| 405 | =back | ||
| 406 | |||
| 407 | Each argument is described in detail in: L<Paws::KinesisVideoArchivedMedia::GetHLSStreamingSessionURL> | ||
| 408 | |||
| 409 | Returns: a L<Paws::KinesisVideoArchivedMedia::GetHLSStreamingSessionURLOutput> instance | ||
| 410 | |||
| 411 | Retrieves an HTTP Live Streaming (HLS) URL for the stream. You can then | ||
| 412 | open the URL in a browser or media player to view the stream contents. | ||
| 413 | |||
| 414 | Both the C<StreamName> and the C<StreamARN> parameters are optional, | ||
| 415 | but you must specify either the C<StreamName> or the C<StreamARN> when | ||
| 416 | invoking this API operation. | ||
| 417 | |||
| 418 | An Amazon Kinesis video stream has the following requirements for | ||
| 419 | providing data through HLS: | ||
| 420 | |||
| 421 | =over | ||
| 422 | |||
| 423 | =item * | ||
| 424 | |||
| 425 | The media must contain h.264 or h.265 encoded video and, optionally, | ||
| 426 | AAC encoded audio. Specifically, the codec ID of track 1 should be | ||
| 427 | C<V_MPEG/ISO/AVC> (for h.264) or C<V_MPEG/ISO/HEVC> (for h.265). | ||
| 428 | Optionally, the codec ID of track 2 should be C<A_AAC>. | ||
| 429 | |||
| 430 | =item * | ||
| 431 | |||
| 432 | Data retention must be greater than 0. | ||
| 433 | |||
| 434 | =item * | ||
| 435 | |||
| 436 | The video track of each fragment must contain codec private data in the | ||
| 437 | Advanced Video Coding (AVC) for H.264 format or HEVC for H.265 format | ||
| 438 | (MPEG-4 specification ISO/IEC 14496-15 | ||
| 439 | (https://www.iso.org/standard/55980.html)). For information about | ||
| 440 | adapting stream data to a given format, see NAL Adaptation Flags | ||
| 441 | (http://docs.aws.amazon.com/kinesisvideostreams/latest/dg/producer-reference-nal.html). | ||
| 442 | |||
| 443 | =item * | ||
| 444 | |||
| 445 | The audio track (if present) of each fragment must contain codec | ||
| 446 | private data in the AAC format (AAC specification ISO/IEC 13818-7 | ||
| 447 | (https://www.iso.org/standard/43345.html)). | ||
| 448 | |||
| 449 | =back | ||
| 450 | |||
| 451 | Kinesis Video Streams HLS sessions contain fragments in the fragmented | ||
| 452 | MPEG-4 form (also called fMP4 or CMAF) or the MPEG-2 form (also called | ||
| 453 | TS chunks, which the HLS specification also supports). For more | ||
| 454 | information about HLS fragment types, see the HLS specification | ||
| 455 | (https://tools.ietf.org/html/draft-pantos-http-live-streaming-23). | ||
| 456 | |||
| 457 | The following procedure shows how to use HLS with Kinesis Video | ||
| 458 | Streams: | ||
| 459 | |||
| 460 | =over | ||
| 461 | |||
| 462 | =item 1. | ||
| 463 | |||
| 464 | Get an endpoint using GetDataEndpoint | ||
| 465 | (http://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_GetDataEndpoint.html), | ||
| 466 | specifying C<GET_HLS_STREAMING_SESSION_URL> for the C<APIName> | ||
| 467 | parameter. | ||
| 468 | |||
| 469 | =item 2. | ||
| 470 | |||
| 471 | Retrieve the HLS URL using C<GetHLSStreamingSessionURL>. Kinesis Video | ||
| 472 | Streams creates an HLS streaming session to be used for accessing | ||
| 473 | content in a stream using the HLS protocol. | ||
| 474 | C<GetHLSStreamingSessionURL> returns an authenticated URL (that | ||
| 475 | includes an encrypted session token) for the session's HLS I<master | ||
| 476 | playlist> (the root resource needed for streaming with HLS). | ||
| 477 | |||
| 478 | Don't share or store this token where an unauthorized entity could | ||
| 479 | access it. The token provides access to the content of the stream. | ||
| 480 | Safeguard the token with the same measures that you would use with your | ||
| 481 | AWS credentials. | ||
| 482 | |||
| 483 | The media that is made available through the playlist consists only of | ||
| 484 | the requested stream, time range, and format. No other media data (such | ||
| 485 | as frames outside the requested window or alternate bitrates) is made | ||
| 486 | available. | ||
| 487 | |||
| 488 | =item 3. | ||
| 489 | |||
| 490 | Provide the URL (containing the encrypted session token) for the HLS | ||
| 491 | master playlist to a media player that supports the HLS protocol. | ||
| 492 | Kinesis Video Streams makes the HLS media playlist, initialization | ||
| 493 | fragment, and media fragments available through the master playlist | ||
| 494 | URL. The initialization fragment contains the codec private data for | ||
| 495 | the stream, and other data needed to set up the video or audio decoder | ||
| 496 | and renderer. The media fragments contain H.264-encoded video frames or | ||
| 497 | AAC-encoded audio samples. | ||
| 498 | |||
| 499 | =item 4. | ||
| 500 | |||
| 501 | The media player receives the authenticated URL and requests stream | ||
| 502 | metadata and media data normally. When the media player requests data, | ||
| 503 | it calls the following actions: | ||
| 504 | |||
| 505 | =over | ||
| 506 | |||
| 507 | =item * | ||
| 508 | |||
| 509 | B<GetHLSMasterPlaylist:> Retrieves an HLS master playlist, which | ||
| 510 | contains a URL for the C<GetHLSMediaPlaylist> action for each track, | ||
| 511 | and additional metadata for the media player, including estimated | ||
| 512 | bitrate and resolution. | ||
| 513 | |||
| 514 | =item * | ||
| 515 | |||
| 516 | B<GetHLSMediaPlaylist:> Retrieves an HLS media playlist, which contains | ||
| 517 | a URL to access the MP4 initialization fragment with the | ||
| 518 | C<GetMP4InitFragment> action, and URLs to access the MP4 media | ||
| 519 | fragments with the C<GetMP4MediaFragment> actions. The HLS media | ||
| 520 | playlist also contains metadata about the stream that the player needs | ||
| 521 | to play it, such as whether the C<PlaybackMode> is C<LIVE> or | ||
| 522 | C<ON_DEMAND>. The HLS media playlist is typically static for sessions | ||
| 523 | with a C<PlaybackType> of C<ON_DEMAND>. The HLS media playlist is | ||
| 524 | continually updated with new fragments for sessions with a | ||
| 525 | C<PlaybackType> of C<LIVE>. There is a distinct HLS media playlist for | ||
| 526 | the video track and the audio track (if applicable) that contains MP4 | ||
| 527 | media URLs for the specific track. | ||
| 528 | |||
| 529 | =item * | ||
| 530 | |||
| 531 | B<GetMP4InitFragment:> Retrieves the MP4 initialization fragment. The | ||
| 532 | media player typically loads the initialization fragment before loading | ||
| 533 | any media fragments. This fragment contains the "C<fytp>" and "C<moov>" | ||
| 534 | MP4 atoms, and the child atoms that are needed to initialize the media | ||
| 535 | player decoder. | ||
| 536 | |||
| 537 | The initialization fragment does not correspond to a fragment in a | ||
| 538 | Kinesis video stream. It contains only the codec private data for the | ||
| 539 | stream and respective track, which the media player needs to decode the | ||
| 540 | media frames. | ||
| 541 | |||
| 542 | =item * | ||
| 543 | |||
| 544 | B<GetMP4MediaFragment:> Retrieves MP4 media fragments. These fragments | ||
| 545 | contain the "C<moof>" and "C<mdat>" MP4 atoms and their child atoms, | ||
| 546 | containing the encoded fragment's media frames and their timestamps. | ||
| 547 | |||
| 548 | After the first media fragment is made available in a streaming | ||
| 549 | session, any fragments that don't contain the same codec private data | ||
| 550 | cause an error to be returned when those different media fragments are | ||
| 551 | loaded. Therefore, the codec private data should not change between | ||
| 552 | fragments in a session. This also means that the session fails if the | ||
| 553 | fragments in a stream change from having only video to having both | ||
| 554 | audio and video. | ||
| 555 | |||
| 556 | Data retrieved with this action is billable. See Pricing | ||
| 557 | (https://aws.amazon.com/kinesis/video-streams/pricing/) for details. | ||
| 558 | |||
| 559 | =item * | ||
| 560 | |||
| 561 | B<GetTSFragment:> Retrieves MPEG TS fragments containing both | ||
| 562 | initialization and media data for all tracks in the stream. | ||
| 563 | |||
| 564 | If the C<ContainerFormat> is C<MPEG_TS>, this API is used instead of | ||
| 565 | C<GetMP4InitFragment> and C<GetMP4MediaFragment> to retrieve stream | ||
| 566 | media. | ||
| 567 | |||
| 568 | Data retrieved with this action is billable. For more information, see | ||
| 569 | Kinesis Video Streams pricing | ||
| 570 | (https://aws.amazon.com/kinesis/video-streams/pricing/). | ||
| 571 | |||
| 572 | =back | ||
| 573 | |||
| 574 | =back | ||
| 575 | |||
| 576 | A streaming session URL must not be shared between players. The service | ||
| 577 | might throttle a session if multiple media players are sharing it. For | ||
| 578 | connection limits, see Kinesis Video Streams Limits | ||
| 579 | (http://docs.aws.amazon.com/kinesisvideostreams/latest/dg/limits.html). | ||
| 580 | |||
| 581 | You can monitor the amount of data that the media player consumes by | ||
| 582 | monitoring the C<GetMP4MediaFragment.OutgoingBytes> Amazon CloudWatch | ||
| 583 | metric. For information about using CloudWatch to monitor Kinesis Video | ||
| 584 | Streams, see Monitoring Kinesis Video Streams | ||
| 585 | (http://docs.aws.amazon.com/kinesisvideostreams/latest/dg/monitoring.html). | ||
| 586 | For pricing information, see Amazon Kinesis Video Streams Pricing | ||
| 587 | (https://aws.amazon.com/kinesis/video-streams/pricing/) and AWS Pricing | ||
| 588 | (https://aws.amazon.com/pricing/). Charges for both HLS sessions and | ||
| 589 | outgoing AWS data apply. | ||
| 590 | |||
| 591 | For more information about HLS, see HTTP Live Streaming | ||
| 592 | (https://developer.apple.com/streaming/) on the Apple Developer site | ||
| 593 | (https://developer.apple.com). | ||
| 594 | |||
| 595 | If an error is thrown after invoking a Kinesis Video Streams archived | ||
| 596 | media API, in addition to the HTTP status code and the response body, | ||
| 597 | it includes the following pieces of information: | ||
| 598 | |||
| 599 | =over | ||
| 600 | |||
| 601 | =item * | ||
| 602 | |||
| 603 | C<x-amz-ErrorType> HTTP header E<ndash> contains a more specific error | ||
| 604 | type in addition to what the HTTP status code provides. | ||
| 605 | |||
| 606 | =item * | ||
| 607 | |||
| 608 | C<x-amz-RequestId> HTTP header E<ndash> if you want to report an issue | ||
| 609 | to AWS, the support team can better diagnose the problem if given the | ||
| 610 | Request Id. | ||
| 611 | |||
| 612 | =back | ||
| 613 | |||
| 614 | Both the HTTP status code and the ErrorType header can be utilized to | ||
| 615 | make programmatic decisions about whether errors are retry-able and | ||
| 616 | under what conditions, as well as provide information on what actions | ||
| 617 | the client programmer might need to take in order to successfully try | ||
| 618 | again. | ||
| 619 | |||
| 620 | For more information, see the B<Errors> section at the bottom of this | ||
| 621 | topic, as well as Common Errors | ||
| 622 | (https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/CommonErrors.html). | ||
| 623 | |||
| 624 | |||
| 625 | =head2 GetMediaForFragmentList | ||
| 626 | |||
| 627 | =over | ||
| 628 | |||
| 629 | =item Fragments => ArrayRef[Str|Undef] | ||
| 630 | |||
| 631 | =item [StreamARN => Str] | ||
| 632 | |||
| 633 | =item [StreamName => Str] | ||
| 634 | |||
| 635 | |||
| 636 | =back | ||
| 637 | |||
| 638 | Each argument is described in detail in: L<Paws::KinesisVideoArchivedMedia::GetMediaForFragmentList> | ||
| 639 | |||
| 640 | Returns: a L<Paws::KinesisVideoArchivedMedia::GetMediaForFragmentListOutput> instance | ||
| 641 | |||
| 642 | Gets media for a list of fragments (specified by fragment number) from | ||
| 643 | the archived data in an Amazon Kinesis video stream. | ||
| 644 | |||
| 645 | You must first call the C<GetDataEndpoint> API to get an endpoint. Then | ||
| 646 | send the C<GetMediaForFragmentList> requests to this endpoint using the | ||
| 647 | --endpoint-url parameter | ||
| 648 | (https://docs.aws.amazon.com/cli/latest/reference/). | ||
| 649 | |||
| 650 | For limits, see Kinesis Video Streams Limits | ||
| 651 | (http://docs.aws.amazon.com/kinesisvideostreams/latest/dg/limits.html). | ||
| 652 | |||
| 653 | If an error is thrown after invoking a Kinesis Video Streams archived | ||
| 654 | media API, in addition to the HTTP status code and the response body, | ||
| 655 | it includes the following pieces of information: | ||
| 656 | |||
| 657 | =over | ||
| 658 | |||
| 659 | =item * | ||
| 660 | |||
| 661 | C<x-amz-ErrorType> HTTP header E<ndash> contains a more specific error | ||
| 662 | type in addition to what the HTTP status code provides. | ||
| 663 | |||
| 664 | =item * | ||
| 665 | |||
| 666 | C<x-amz-RequestId> HTTP header E<ndash> if you want to report an issue | ||
| 667 | to AWS, the support team can better diagnose the problem if given the | ||
| 668 | Request Id. | ||
| 669 | |||
| 670 | =back | ||
| 671 | |||
| 672 | Both the HTTP status code and the ErrorType header can be utilized to | ||
| 673 | make programmatic decisions about whether errors are retry-able and | ||
| 674 | under what conditions, as well as provide information on what actions | ||
| 675 | the client programmer might need to take in order to successfully try | ||
| 676 | again. | ||
| 677 | |||
| 678 | For more information, see the B<Errors> section at the bottom of this | ||
| 679 | topic, as well as Common Errors | ||
| 680 | (https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/CommonErrors.html). | ||
| 681 | |||
| 682 | |||
| 683 | =head2 ListFragments | ||
| 684 | |||
| 685 | =over | ||
| 686 | |||
| 687 | =item [FragmentSelector => L<Paws::KinesisVideoArchivedMedia::FragmentSelector>] | ||
| 688 | |||
| 689 | =item [MaxResults => Int] | ||
| 690 | |||
| 691 | =item [NextToken => Str] | ||
| 692 | |||
| 693 | =item [StreamARN => Str] | ||
| 694 | |||
| 695 | =item [StreamName => Str] | ||
| 696 | |||
| 697 | |||
| 698 | =back | ||
| 699 | |||
| 700 | Each argument is described in detail in: L<Paws::KinesisVideoArchivedMedia::ListFragments> | ||
| 701 | |||
| 702 | Returns: a L<Paws::KinesisVideoArchivedMedia::ListFragmentsOutput> instance | ||
| 703 | |||
| 704 | Returns a list of Fragment objects from the specified stream and | ||
| 705 | timestamp range within the archived data. | ||
| 706 | |||
| 707 | Listing fragments is eventually consistent. This means that even if the | ||
| 708 | producer receives an acknowledgment that a fragment is persisted, the | ||
| 709 | result might not be returned immediately from a request to | ||
| 710 | C<ListFragments>. However, results are typically available in less than | ||
| 711 | one second. | ||
| 712 | |||
| 713 | You must first call the C<GetDataEndpoint> API to get an endpoint. Then | ||
| 714 | send the C<ListFragments> requests to this endpoint using the | ||
| 715 | --endpoint-url parameter | ||
| 716 | (https://docs.aws.amazon.com/cli/latest/reference/). | ||
| 717 | |||
| 718 | If an error is thrown after invoking a Kinesis Video Streams archived | ||
| 719 | media API, in addition to the HTTP status code and the response body, | ||
| 720 | it includes the following pieces of information: | ||
| 721 | |||
| 722 | =over | ||
| 723 | |||
| 724 | =item * | ||
| 725 | |||
| 726 | C<x-amz-ErrorType> HTTP header E<ndash> contains a more specific error | ||
| 727 | type in addition to what the HTTP status code provides. | ||
| 728 | |||
| 729 | =item * | ||
| 730 | |||
| 731 | C<x-amz-RequestId> HTTP header E<ndash> if you want to report an issue | ||
| 732 | to AWS, the support team can better diagnose the problem if given the | ||
| 733 | Request Id. | ||
| 734 | |||
| 735 | =back | ||
| 736 | |||
| 737 | Both the HTTP status code and the ErrorType header can be utilized to | ||
| 738 | make programmatic decisions about whether errors are retry-able and | ||
| 739 | under what conditions, as well as provide information on what actions | ||
| 740 | the client programmer might need to take in order to successfully try | ||
| 741 | again. | ||
| 742 | |||
| 743 | For more information, see the B<Errors> section at the bottom of this | ||
| 744 | topic, as well as Common Errors | ||
| 745 | (https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/CommonErrors.html). | ||
| 746 | |||
| 747 | |||
| 748 | |||
| 749 | |||
| 750 | =head1 PAGINATORS | ||
| 751 | |||
| 752 | Paginator methods are helpers that repetively call methods that return partial results | ||
| 753 | |||
| 754 | =head2 ListAllFragments(sub { },[FragmentSelector => L<Paws::KinesisVideoArchivedMedia::FragmentSelector>, MaxResults => Int, NextToken => Str, StreamARN => Str, StreamName => Str]) | ||
| 755 | |||
| 756 | =head2 ListAllFragments([FragmentSelector => L<Paws::KinesisVideoArchivedMedia::FragmentSelector>, MaxResults => Int, NextToken => Str, StreamARN => Str, StreamName => Str]) | ||
| 757 | |||
| 758 | |||
| 759 | If passed a sub as first parameter, it will call the sub for each element found in : | ||
| 760 | |||
| 761 | - Fragments, passing the object as the first parameter, and the string 'Fragments' as the second parameter | ||
| 762 | |||
| 763 | If not, it will return a a L<Paws::KinesisVideoArchivedMedia::ListFragmentsOutput> instance with all the C<param>s; from all the responses. Please take into account that this mode can potentially consume vasts ammounts of memory. | ||
| 764 | |||
| 765 | |||
| 766 | |||
| 767 | |||
| 768 | |||
| 769 | =head1 SEE ALSO | ||
| 770 | |||
| 771 | This service class forms part of L<Paws> | ||
| 772 | |||
| 773 | =head1 BUGS and CONTRIBUTIONS | ||
| 774 | |||
| 775 | The source code is located here: L<https://github.com/pplu/aws-sdk-perl> | ||
| 776 | |||
| 777 | Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues> | ||
| 778 | |||
| 779 | =cut | ||
| 780 |