« blib/lib/Paws/KinesisVideoArchivedMedia/GetDASHStreamingSessionURLOutput.pm
↑ Summary
blib/lib/Paws/KinesisVideoArchivedMedia/GetHLSStreamingSessionURLOutput.pm »
| 1 | |||
| 2 | package Paws::KinesisVideoArchivedMedia::GetHLSStreamingSessionURL; | ||
| 3 | use Moose; | ||
| 4 | has ContainerFormat => (is => 'ro', isa => 'Str'); | ||
| 5 | has DiscontinuityMode => (is => 'ro', isa => 'Str'); | ||
| 6 | has DisplayFragmentTimestamp => (is => 'ro', isa => 'Str'); | ||
| 7 | has Expires => (is => 'ro', isa => 'Int'); | ||
| 8 | has HLSFragmentSelector => (is => 'ro', isa => 'Paws::KinesisVideoArchivedMedia::HLSFragmentSelector'); | ||
| 9 | has MaxMediaPlaylistFragmentResults => (is => 'ro', isa => 'Int'); | ||
| 10 | has PlaybackMode => (is => 'ro', isa => 'Str'); | ||
| 11 | has StreamARN => (is => 'ro', isa => 'Str'); | ||
| 12 | has StreamName => (is => 'ro', isa => 'Str'); | ||
| 13 | |||
| 14 | use MooseX::ClassAttribute; | ||
| 15 | |||
| 16 | class_has _api_call => (isa => 'Str', is => 'ro', default => 'GetHLSStreamingSessionURL'); | ||
| 17 | class_has _api_uri => (isa => 'Str', is => 'ro', default => '/getHLSStreamingSessionURL'); | ||
| 18 | class_has _api_method => (isa => 'Str', is => 'ro', default => 'POST'); | ||
| 19 | class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::KinesisVideoArchivedMedia::GetHLSStreamingSessionURLOutput'); | ||
| 20 | 1; | ||
| 21 | |||
| 22 | ### main pod documentation begin ### | ||
| 23 | |||
| 24 | =head1 NAME | ||
| 25 | |||
| 26 | Paws::KinesisVideoArchivedMedia::GetHLSStreamingSessionURL - Arguments for method GetHLSStreamingSessionURL on L<Paws::KinesisVideoArchivedMedia> | ||
| 27 | |||
| 28 | =head1 DESCRIPTION | ||
| 29 | |||
| 30 | This class represents the parameters used for calling the method GetHLSStreamingSessionURL on the | ||
| 31 | L<Amazon Kinesis Video Streams Archived Media|Paws::KinesisVideoArchivedMedia> service. Use the attributes of this class | ||
| 32 | as arguments to method GetHLSStreamingSessionURL. | ||
| 33 | |||
| 34 | You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to GetHLSStreamingSessionURL. | ||
| 35 | |||
| 36 | =head1 SYNOPSIS | ||
| 37 | |||
| 38 | my $kinesisvideo = Paws->service('KinesisVideoArchivedMedia'); | ||
| 39 | my $GetHLSStreamingSessionURLOutput = | ||
| 40 | $kinesisvideo->GetHLSStreamingSessionURL( | ||
| 41 | ContainerFormat => 'FRAGMENTED_MP4', # OPTIONAL | ||
| 42 | DiscontinuityMode => 'ALWAYS', # OPTIONAL | ||
| 43 | DisplayFragmentTimestamp => 'ALWAYS', # OPTIONAL | ||
| 44 | Expires => 1, # OPTIONAL | ||
| 45 | HLSFragmentSelector => { | ||
| 46 | FragmentSelectorType => 'PRODUCER_TIMESTAMP' | ||
| 47 | , # values: PRODUCER_TIMESTAMP, SERVER_TIMESTAMP; OPTIONAL | ||
| 48 | TimestampRange => { | ||
| 49 | EndTimestamp => '1970-01-01T01:00:00', # OPTIONAL | ||
| 50 | StartTimestamp => '1970-01-01T01:00:00', # OPTIONAL | ||
| 51 | }, # OPTIONAL | ||
| 52 | }, # OPTIONAL | ||
| 53 | MaxMediaPlaylistFragmentResults => 1, # OPTIONAL | ||
| 54 | PlaybackMode => 'LIVE', # OPTIONAL | ||
| 55 | StreamARN => 'MyResourceARN', # OPTIONAL | ||
| 56 | StreamName => 'MyStreamName', # OPTIONAL | ||
| 57 | ); | ||
| 58 | |||
| 59 | # Results: | ||
| 60 | my $HLSStreamingSessionURL = | ||
| 61 | $GetHLSStreamingSessionURLOutput->HLSStreamingSessionURL; | ||
| 62 | |||
| 63 | # Returns a L<Paws::KinesisVideoArchivedMedia::GetHLSStreamingSessionURLOutput> object. | ||
| 64 | |||
| 65 | Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object. | ||
| 66 | For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo/GetHLSStreamingSessionURL> | ||
| 67 | |||
| 68 | =head1 ATTRIBUTES | ||
| 69 | |||
| 70 | |||
| 71 | =head2 ContainerFormat => Str | ||
| 72 | |||
| 73 | Specifies which format should be used for packaging the media. | ||
| 74 | Specifying the C<FRAGMENTED_MP4> container format packages the media | ||
| 75 | into MP4 fragments (fMP4 or CMAF). This is the recommended packaging | ||
| 76 | because there is minimal packaging overhead. The other container format | ||
| 77 | option is C<MPEG_TS>. HLS has supported MPEG TS chunks since it was | ||
| 78 | released and is sometimes the only supported packaging on older HLS | ||
| 79 | players. MPEG TS typically has a 5-25 percent packaging overhead. This | ||
| 80 | means MPEG TS typically requires 5-25 percent more bandwidth and cost | ||
| 81 | than fMP4. | ||
| 82 | |||
| 83 | The default is C<FRAGMENTED_MP4>. | ||
| 84 | |||
| 85 | Valid values are: C<"FRAGMENTED_MP4">, C<"MPEG_TS"> | ||
| 86 | |||
| 87 | =head2 DiscontinuityMode => Str | ||
| 88 | |||
| 89 | Specifies when flags marking discontinuities between fragments are | ||
| 90 | added to the media playlists. | ||
| 91 | |||
| 92 | Media players typically build a timeline of media content to play, | ||
| 93 | based on the timestamps of each fragment. This means that if there is | ||
| 94 | any overlap or gap between fragments (as is typical if | ||
| 95 | HLSFragmentSelector is set to C<SERVER_TIMESTAMP>), the media player | ||
| 96 | timeline will also have small gaps between fragments in some places, | ||
| 97 | and will overwrite frames in other places. Gaps in the media player | ||
| 98 | timeline can cause playback to stall and overlaps can cause playback to | ||
| 99 | be jittery. When there are discontinuity flags between fragments, the | ||
| 100 | media player is expected to reset the timeline, resulting in the next | ||
| 101 | fragment being played immediately after the previous fragment. | ||
| 102 | |||
| 103 | The following modes are supported: | ||
| 104 | |||
| 105 | =over | ||
| 106 | |||
| 107 | =item * | ||
| 108 | |||
| 109 | C<ALWAYS>: a discontinuity marker is placed between every fragment in | ||
| 110 | the HLS media playlist. It is recommended to use a value of C<ALWAYS> | ||
| 111 | if the fragment timestamps are not accurate. | ||
| 112 | |||
| 113 | =item * | ||
| 114 | |||
| 115 | C<NEVER>: no discontinuity markers are placed anywhere. It is | ||
| 116 | recommended to use a value of C<NEVER> to ensure the media player | ||
| 117 | timeline most accurately maps to the producer timestamps. | ||
| 118 | |||
| 119 | =item * | ||
| 120 | |||
| 121 | C<ON_DISCONTINUITY>: a discontinuity marker is placed between fragments | ||
| 122 | that have a gap or overlap of more than 50 milliseconds. For most | ||
| 123 | playback scenarios, it is recommended to use a value of | ||
| 124 | C<ON_DISCONTINUITY> so that the media player timeline is only reset | ||
| 125 | when there is a significant issue with the media timeline (e.g. a | ||
| 126 | missing fragment). | ||
| 127 | |||
| 128 | =back | ||
| 129 | |||
| 130 | The default is C<ALWAYS> when HLSFragmentSelector is set to | ||
| 131 | C<SERVER_TIMESTAMP>, and C<NEVER> when it is set to | ||
| 132 | C<PRODUCER_TIMESTAMP>. | ||
| 133 | |||
| 134 | Valid values are: C<"ALWAYS">, C<"NEVER">, C<"ON_DISCONTINUITY"> | ||
| 135 | |||
| 136 | =head2 DisplayFragmentTimestamp => Str | ||
| 137 | |||
| 138 | Specifies when the fragment start timestamps should be included in the | ||
| 139 | HLS media playlist. Typically, media players report the playhead | ||
| 140 | position as a time relative to the start of the first fragment in the | ||
| 141 | playback session. However, when the start timestamps are included in | ||
| 142 | the HLS media playlist, some media players might report the current | ||
| 143 | playhead as an absolute time based on the fragment timestamps. This can | ||
| 144 | be useful for creating a playback experience that shows viewers the | ||
| 145 | wall-clock time of the media. | ||
| 146 | |||
| 147 | The default is C<NEVER>. When HLSFragmentSelector is | ||
| 148 | C<SERVER_TIMESTAMP>, the timestamps will be the server start | ||
| 149 | timestamps. Similarly, when HLSFragmentSelector is | ||
| 150 | C<PRODUCER_TIMESTAMP>, the timestamps will be the producer start | ||
| 151 | timestamps. | ||
| 152 | |||
| 153 | Valid values are: C<"ALWAYS">, C<"NEVER"> | ||
| 154 | |||
| 155 | =head2 Expires => Int | ||
| 156 | |||
| 157 | The time in seconds until the requested session expires. This value can | ||
| 158 | be between 300 (5 minutes) and 43200 (12 hours). | ||
| 159 | |||
| 160 | When a session expires, no new calls to C<GetHLSMasterPlaylist>, | ||
| 161 | C<GetHLSMediaPlaylist>, C<GetMP4InitFragment>, C<GetMP4MediaFragment>, | ||
| 162 | or C<GetTSFragment> can be made for that session. | ||
| 163 | |||
| 164 | The default is 300 (5 minutes). | ||
| 165 | |||
| 166 | |||
| 167 | |||
| 168 | =head2 HLSFragmentSelector => L<Paws::KinesisVideoArchivedMedia::HLSFragmentSelector> | ||
| 169 | |||
| 170 | The time range of the requested fragment and the source of the | ||
| 171 | timestamps. | ||
| 172 | |||
| 173 | This parameter is required if C<PlaybackMode> is C<ON_DEMAND> or | ||
| 174 | C<LIVE_REPLAY>. This parameter is optional if PlaybackMode isC< | ||
| 175 | C<LIVE>. If C<PlaybackMode> is C<LIVE>, the C<FragmentSelectorType> can | ||
| 176 | be set, but the C<TimestampRange> should not be set. If C<PlaybackMode> | ||
| 177 | is C<ON_DEMAND> or C<LIVE_REPLAY>, both C<FragmentSelectorType> and | ||
| 178 | C<TimestampRange> must be set.> | ||
| 179 | |||
| 180 | |||
| 181 | |||
| 182 | =head2 MaxMediaPlaylistFragmentResults => Int | ||
| 183 | |||
| 184 | The maximum number of fragments that are returned in the HLS media | ||
| 185 | playlists. | ||
| 186 | |||
| 187 | When the C<PlaybackMode> is C<LIVE>, the most recent fragments are | ||
| 188 | returned up to this value. When the C<PlaybackMode> is C<ON_DEMAND>, | ||
| 189 | the oldest fragments are returned, up to this maximum number. | ||
| 190 | |||
| 191 | When there are a higher number of fragments available in a live HLS | ||
| 192 | media playlist, video players often buffer content before starting | ||
| 193 | playback. Increasing the buffer size increases the playback latency, | ||
| 194 | but it decreases the likelihood that rebuffering will occur during | ||
| 195 | playback. We recommend that a live HLS media playlist have a minimum of | ||
| 196 | 3 fragments and a maximum of 10 fragments. | ||
| 197 | |||
| 198 | The default is 5 fragments if C<PlaybackMode> is C<LIVE> or | ||
| 199 | C<LIVE_REPLAY>, and 1,000 if C<PlaybackMode> is C<ON_DEMAND>. | ||
| 200 | |||
| 201 | The maximum value of 5,000 fragments corresponds to more than 80 | ||
| 202 | minutes of video on streams with 1-second fragments, and more than 13 | ||
| 203 | hours of video on streams with 10-second fragments. | ||
| 204 | |||
| 205 | |||
| 206 | |||
| 207 | =head2 PlaybackMode => Str | ||
| 208 | |||
| 209 | Whether to retrieve live, live replay, or archived, on-demand data. | ||
| 210 | |||
| 211 | Features of the three types of sessions include the following: | ||
| 212 | |||
| 213 | =over | ||
| 214 | |||
| 215 | =item * | ||
| 216 | |||
| 217 | B<C<LIVE> >: For sessions of this type, the HLS media playlist is | ||
| 218 | continually updated with the latest fragments as they become available. | ||
| 219 | We recommend that the media player retrieve a new playlist on a | ||
| 220 | one-second interval. When this type of session is played in a media | ||
| 221 | player, the user interface typically displays a "live" notification, | ||
| 222 | with no scrubber control for choosing the position in the playback | ||
| 223 | window to display. | ||
| 224 | |||
| 225 | In C<LIVE> mode, the newest available fragments are included in an HLS | ||
| 226 | media playlist, even if there is a gap between fragments (that is, if a | ||
| 227 | fragment is missing). A gap like this might cause a media player to | ||
| 228 | halt or cause a jump in playback. In this mode, fragments are not added | ||
| 229 | to the HLS media playlist if they are older than the newest fragment in | ||
| 230 | the playlist. If the missing fragment becomes available after a | ||
| 231 | subsequent fragment is added to the playlist, the older fragment is not | ||
| 232 | added, and the gap is not filled. | ||
| 233 | |||
| 234 | =item * | ||
| 235 | |||
| 236 | B<C<LIVE_REPLAY> >: For sessions of this type, the HLS media playlist | ||
| 237 | is updated similarly to how it is updated for C<LIVE> mode except that | ||
| 238 | it starts by including fragments from a given start time. Instead of | ||
| 239 | fragments being added as they are ingested, fragments are added as the | ||
| 240 | duration of the next fragment elapses. For example, if the fragments in | ||
| 241 | the session are two seconds long, then a new fragment is added to the | ||
| 242 | media playlist every two seconds. This mode is useful to be able to | ||
| 243 | start playback from when an event is detected and continue live | ||
| 244 | streaming media that has not yet been ingested as of the time of the | ||
| 245 | session creation. This mode is also useful to stream previously | ||
| 246 | archived media without being limited by the 1,000 fragment limit in the | ||
| 247 | C<ON_DEMAND> mode. | ||
| 248 | |||
| 249 | =item * | ||
| 250 | |||
| 251 | B<C<ON_DEMAND> >: For sessions of this type, the HLS media playlist | ||
| 252 | contains all the fragments for the session, up to the number that is | ||
| 253 | specified in C<MaxMediaPlaylistFragmentResults>. The playlist must be | ||
| 254 | retrieved only once for each session. When this type of session is | ||
| 255 | played in a media player, the user interface typically displays a | ||
| 256 | scrubber control for choosing the position in the playback window to | ||
| 257 | display. | ||
| 258 | |||
| 259 | =back | ||
| 260 | |||
| 261 | In all playback modes, if C<FragmentSelectorType> is | ||
| 262 | C<PRODUCER_TIMESTAMP>, and if there are multiple fragments with the | ||
| 263 | same start timestamp, the fragment that has the largest fragment number | ||
| 264 | (that is, the newest fragment) is included in the HLS media playlist. | ||
| 265 | The other fragments are not included. Fragments that have different | ||
| 266 | timestamps but have overlapping durations are still included in the HLS | ||
| 267 | media playlist. This can lead to unexpected behavior in the media | ||
| 268 | player. | ||
| 269 | |||
| 270 | The default is C<LIVE>. | ||
| 271 | |||
| 272 | Valid values are: C<"LIVE">, C<"LIVE_REPLAY">, C<"ON_DEMAND"> | ||
| 273 | |||
| 274 | =head2 StreamARN => Str | ||
| 275 | |||
| 276 | The Amazon Resource Name (ARN) of the stream for which to retrieve the | ||
| 277 | HLS master playlist URL. | ||
| 278 | |||
| 279 | You must specify either the C<StreamName> or the C<StreamARN>. | ||
| 280 | |||
| 281 | |||
| 282 | |||
| 283 | =head2 StreamName => Str | ||
| 284 | |||
| 285 | The name of the stream for which to retrieve the HLS master playlist | ||
| 286 | URL. | ||
| 287 | |||
| 288 | You must specify either the C<StreamName> or the C<StreamARN>. | ||
| 289 | |||
| 290 | |||
| 291 | |||
| 292 | |||
| 293 | =head1 SEE ALSO | ||
| 294 | |||
| 295 | This class forms part of L<Paws>, documenting arguments for method GetHLSStreamingSessionURL in L<Paws::KinesisVideoArchivedMedia> | ||
| 296 | |||
| 297 | =head1 BUGS and CONTRIBUTIONS | ||
| 298 | |||
| 299 | The source code is located here: L<https://github.com/pplu/aws-sdk-perl> | ||
| 300 | |||
| 301 | Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues> | ||
| 302 | |||
| 303 | =cut | ||
| 304 |