get_images
¶
get_images(
image_selector_type: ImageSelectorType,
start_timestamp: Timestamp,
end_timestamp: Timestamp,
format: Format,
*,
config_overrides: Optional[KinesisVideoArchivedMediaClientConfig] = None,
stream_name: Optional[StreamName] = None,
stream_arn: Optional[ResourceARN] = None,
sampling_interval: Optional[SamplingInterval] = None,
format_config: Optional[FormatConfig] = None,
width_pixels: Optional[WidthPixels] = None,
height_pixels: Optional[HeightPixels] = None,
max_results: Optional[GetImagesMaxResults] = None,
next_token: Optional[NextToken] = None,
) -> GetImagesOutput
Retrieves a list of images corresponding to each timestamp for a given time range, sampling interval, and image format configuration.
Parameters:
-
stream_name(Optional[StreamName], default:None) –The name of the stream from which to retrieve the images. You must specify either the
StreamNameor theStreamARN. -
stream_arn(Optional[ResourceARN], default:None) –The Amazon Resource Name (ARN) of the stream from which to retrieve the images. You must specify either the
StreamNameor theStreamARN. -
image_selector_type(ImageSelectorType) –The origin of the Server or Producer timestamps to use to generate the images.
-
start_timestamp(Timestamp) –The starting point from which the images should be generated. This
StartTimestampmust be within an inclusive range of timestamps for an image to be returned. -
end_timestamp(Timestamp) –The end timestamp for the range of images to be generated. If the time range between
StartTimestampandEndTimestampis more than 300 seconds aboveStartTimestamp, you will receive anIllegalArgumentException. -
sampling_interval(Optional[SamplingInterval], default:None) –The time interval in milliseconds (ms) at which the images need to be generated from the stream. The minimum value that can be provided is 200 ms (5 images per second). If the timestamp range is less than the sampling interval, the image from the
startTimestampwill be returned if available. -
format(Format) –The format that will be used to encode the image.
-
format_config(Optional[FormatConfig], default:None) –The list of a key-value pair structure that contains extra parameters that can be applied when the image is generated. The
FormatConfigkey is theJPEGQuality, which indicates the JPEG quality key to be used to generate the image. TheFormatConfigvalue accepts ints from 1 to 100. If the value is 1, the image will be generated with less quality and the best compression. If the value is 100, the image will be generated with the best quality and less compression. If no value is provided, the default value of theJPEGQualitykey will be set to 80. -
width_pixels(Optional[WidthPixels], default:None) –The width of the output image that is used in conjunction with the
HeightPixelsparameter. When bothWidthPixelsandHeightPixelsparameters are provided, the image will be stretched to fit the specified aspect ratio. If only theWidthPixelsparameter is provided or if only theHeightPixelsis provided, aValidationExceptionwill be thrown. If neither parameter is provided, the original image size from the stream will be returned. -
height_pixels(Optional[HeightPixels], default:None) –The height of the output image that is used in conjunction with the
WidthPixelsparameter. When bothHeightPixelsandWidthPixelsparameters are provided, the image will be stretched to fit the specified aspect ratio. If only theHeightPixelsparameter is provided, its original aspect ratio will be used to calculate theWidthPixelsratio. If neither parameter is provided, the original image size will be returned. -
max_results(Optional[GetImagesMaxResults], default:None) –The maximum number of images to be returned by the API.
The default limit is 25 images per API response. Providing a
MaxResultsgreater than this value will result in a page size of 25. Any additional results will be paginated. -
next_token(Optional[NextToken], default:None) –A token that specifies where to start paginating the next set of Images. This is the
GetImages:NextTokenfrom a previously truncated response.
Raises:
-
ClientLimitExceededException–Kinesis Video Streams has throttled the request because you have exceeded a limit. Try making the call later. For information about limits, see Kinesis Video Streams Limits.
-
InvalidArgumentException–A specified parameter exceeds its restrictions, is not supported, or can't be used.
-
NoDataRetentionException–GetImageswas requested for a stream that does not retain data (that is, has aDataRetentionInHoursof 0). -
NotAuthorizedException–Status Code: 403, The caller is not authorized to perform an operation on the given stream, or the token has expired.
-
ResourceNotFoundException–GetImageswill throw this error when Kinesis Video Streams can't find the stream that you specified.GetHLSStreamingSessionURLandGetDASHStreamingSessionURLthrow this error if a session with aPlaybackModeofON_DEMANDorLIVE_REPLAYis requested for a stream that has no fragments within the requested time range, or if a session with aPlaybackModeofLIVEis requested for a stream that has no fragments within the last 30 seconds. -
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_kinesis_video_archived_media/_services/kinesis_video_archived_media.py
464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 | |