From c46f76ea67ad457510e3108fb1d94812a247ea2c Mon Sep 17 00:00:00 2001 From: AsyncAws <61784373+async-aws-bot@users.noreply.github.com> Date: Fri, 13 Sep 2024 00:34:18 -0700 Subject: [PATCH] Update generated code (#1762) update generated code --- CHANGELOG.md | 4 + composer.json | 2 +- src/Enum/AacCodecProfile.php | 5 +- src/Enum/AacRateControlMode.php | 4 +- src/Enum/AacVbrQuality.php | 3 +- src/Enum/AudioDurationCorrection.php | 6 +- src/Enum/CaptionSourceByteRateLimit.php | 25 ++++ src/Enum/ContainerType.php | 2 + src/Enum/H264SaliencyAwareEncoding.php | 25 ++++ src/Enum/VideoOverlayPlayBackMode.php | 23 +++ src/Enum/VideoOverlayUnit.php | 21 +++ src/Input/CreateJobRequest.php | 27 ++++ src/MediaConvertClient.php | 1 + src/Result/CreateJobResponse.php | 42 ++++++ src/Result/GetJobResponse.php | 42 ++++++ src/Result/ListJobsResponse.php | 42 ++++++ src/ValueObject/AacSettings.php | 21 +-- src/ValueObject/AudioSelector.php | 4 +- src/ValueObject/FileSourceSettings.php | 30 ++++ src/ValueObject/H264Settings.php | 51 +++++-- src/ValueObject/H265Settings.php | 21 +-- src/ValueObject/Job.php | 34 +++++ src/ValueObject/Mpeg2Settings.php | 17 +-- src/ValueObject/VideoOverlay.php | 101 +++++++++++-- src/ValueObject/VideoOverlayInput.php | 4 +- src/ValueObject/VideoOverlayPosition.php | 156 +++++++++++++++++++++ src/ValueObject/VideoOverlayTransition.php | 98 +++++++++++++ 27 files changed, 754 insertions(+), 57 deletions(-) create mode 100644 src/Enum/CaptionSourceByteRateLimit.php create mode 100644 src/Enum/H264SaliencyAwareEncoding.php create mode 100644 src/Enum/VideoOverlayPlayBackMode.php create mode 100644 src/Enum/VideoOverlayUnit.php create mode 100644 src/ValueObject/VideoOverlayPosition.php create mode 100644 src/ValueObject/VideoOverlayTransition.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 4eab6f8..661be6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## NOT RELEASED +### Added + +- AWS api-change: This release includes support for dynamic video overlay workflows, including picture-in-picture and squeezeback + ### Changed - Enable compiler optimization for the `sprintf` function. diff --git a/composer.json b/composer.json index 4c3391b..7f6a42a 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.4-dev" } } } diff --git a/src/Enum/AacCodecProfile.php b/src/Enum/AacCodecProfile.php index 0604d3f..e69081c 100644 --- a/src/Enum/AacCodecProfile.php +++ b/src/Enum/AacCodecProfile.php @@ -3,7 +3,10 @@ namespace AsyncAws\MediaConvert\Enum; /** - * AAC Profile. + * Specify the AAC profile. For the widest player compatibility and where higher bitrates are acceptable: Keep the + * default profile, LC (AAC-LC) For improved audio performance at lower bitrates: Choose HEV1 or HEV2. HEV1 (AAC-HE v1) + * adds spectral band replication to improve speech audio at low bitrates. HEV2 (AAC-HE v2) adds parametric stereo, + * which optimizes for encoding stereo audio at very low bitrates. */ final class AacCodecProfile { diff --git a/src/Enum/AacRateControlMode.php b/src/Enum/AacRateControlMode.php index 25e22bd..aeaeb20 100644 --- a/src/Enum/AacRateControlMode.php +++ b/src/Enum/AacRateControlMode.php @@ -3,7 +3,9 @@ namespace AsyncAws\MediaConvert\Enum; /** - * Rate Control Mode. + * Specify the AAC rate control mode. For a constant bitrate: Choose CBR. Your AAC output bitrate will be equal to the + * value that you choose for Bitrate. For a variable bitrate: Choose VBR. Your AAC output bitrate will vary according to + * your audio content and the value that you choose for Bitrate quality. */ final class AacRateControlMode { diff --git a/src/Enum/AacVbrQuality.php b/src/Enum/AacVbrQuality.php index 72ca410..f7c9e82 100644 --- a/src/Enum/AacVbrQuality.php +++ b/src/Enum/AacVbrQuality.php @@ -3,7 +3,8 @@ namespace AsyncAws\MediaConvert\Enum; /** - * VBR Quality Level - Only used if rate_control_mode is VBR. + * Specify the quality of your variable bitrate (VBR) AAC audio. For a list of approximate VBR bitrates, see: + * https://docs.aws.amazon.com/mediaconvert/latest/ug/aac-support.html#aac_vbr */ final class AacVbrQuality { diff --git a/src/Enum/AudioDurationCorrection.php b/src/Enum/AudioDurationCorrection.php index dbf484e..f4e8769 100644 --- a/src/Enum/AudioDurationCorrection.php +++ b/src/Enum/AudioDurationCorrection.php @@ -11,12 +11,15 @@ * align the audio track length with STTS duration. Track-level correction does not affect pitch, and is recommended for * tonal audio content such as music. * Frame: Adjust the duration of each audio frame by a variable amount to align * audio frames with STTS timestamps. No corrections are made to already-aligned frames. Frame-level correction may - * affect the pitch of corrected frames, and is recommended for atonal audio content such as speech or percussion. + * affect the pitch of corrected frames, and is recommended for atonal audio content such as speech or percussion. * + * Force: Apply audio duration correction, either Track or Frame depending on your input, regardless of the accuracy of + * your input's STTS table. Your output audio and video may not be aligned or it may contain audio artifacts. */ final class AudioDurationCorrection { public const AUTO = 'AUTO'; public const DISABLED = 'DISABLED'; + public const FORCE = 'FORCE'; public const FRAME = 'FRAME'; public const TRACK = 'TRACK'; @@ -25,6 +28,7 @@ public static function exists(string $value): bool return isset([ self::AUTO => true, self::DISABLED => true, + self::FORCE => true, self::FRAME => true, self::TRACK => true, ][$value]); diff --git a/src/Enum/CaptionSourceByteRateLimit.php b/src/Enum/CaptionSourceByteRateLimit.php new file mode 100644 index 0000000..65fa1f4 --- /dev/null +++ b/src/Enum/CaptionSourceByteRateLimit.php @@ -0,0 +1,25 @@ + true, + self::ENABLED => true, + ][$value]); + } +} diff --git a/src/Enum/ContainerType.php b/src/Enum/ContainerType.php index 1d5c813..e52d288 100644 --- a/src/Enum/ContainerType.php +++ b/src/Enum/ContainerType.php @@ -17,6 +17,7 @@ final class ContainerType public const MP4 = 'MP4'; public const MPD = 'MPD'; public const MXF = 'MXF'; + public const OGG = 'OGG'; public const RAW = 'RAW'; public const WEBM = 'WEBM'; public const Y4M = 'Y4M'; @@ -33,6 +34,7 @@ public static function exists(string $value): bool self::MP4 => true, self::MPD => true, self::MXF => true, + self::OGG => true, self::RAW => true, self::WEBM => true, self::Y4M => true, diff --git a/src/Enum/H264SaliencyAwareEncoding.php b/src/Enum/H264SaliencyAwareEncoding.php new file mode 100644 index 0000000..0d7263d --- /dev/null +++ b/src/Enum/H264SaliencyAwareEncoding.php @@ -0,0 +1,25 @@ + true, + self::PREFERRED => true, + ][$value]); + } +} diff --git a/src/Enum/VideoOverlayPlayBackMode.php b/src/Enum/VideoOverlayPlayBackMode.php new file mode 100644 index 0000000..c3daba1 --- /dev/null +++ b/src/Enum/VideoOverlayPlayBackMode.php @@ -0,0 +1,23 @@ + true, + self::REPEAT => true, + ][$value]); + } +} diff --git a/src/Enum/VideoOverlayUnit.php b/src/Enum/VideoOverlayUnit.php new file mode 100644 index 0000000..e738f1a --- /dev/null +++ b/src/Enum/VideoOverlayUnit.php @@ -0,0 +1,21 @@ + true, + self::PIXELS => true, + ][$value]); + } +} diff --git a/src/Input/CreateJobRequest.php b/src/Input/CreateJobRequest.php index 76050be..d69526e 100644 --- a/src/Input/CreateJobRequest.php +++ b/src/Input/CreateJobRequest.php @@ -57,6 +57,15 @@ final class CreateJobRequest extends Input1 */ private $hopDestinations; + /** + * Use Job engine versions to run jobs for your production workflow on one version, while you test and validate the + * latest version. To specify a Job engine version: Enter a date in a YYYY-MM-DD format. For a list of valid Job engine + * versions, submit a ListVersions request. To not specify a Job engine version: Leave blank. + * + * @var string|null + */ + private $jobEngineVersion; + /** * Optional. When you create a job, you can either specify a job template or specify the transcoding settings * individually. @@ -144,6 +153,7 @@ final class CreateJobRequest extends Input1 * BillingTagsSource?: null|BillingTagsSource::*, * ClientRequestToken?: null|string, * HopDestinations?: null|array, + * JobEngineVersion?: null|string, * JobTemplate?: null|string, * Priority?: null|int, * Queue?: null|string, @@ -162,6 +172,7 @@ public function __construct(array $input = []) $this->billingTagsSource = $input['BillingTagsSource'] ?? null; $this->clientRequestToken = $input['ClientRequestToken'] ?? null; $this->hopDestinations = isset($input['HopDestinations']) ? array_map([HopDestination::class, 'create'], $input['HopDestinations']) : null; + $this->jobEngineVersion = $input['JobEngineVersion'] ?? null; $this->jobTemplate = $input['JobTemplate'] ?? null; $this->priority = $input['Priority'] ?? null; $this->queue = $input['Queue'] ?? null; @@ -180,6 +191,7 @@ public function __construct(array $input = []) * BillingTagsSource?: null|BillingTagsSource::*, * ClientRequestToken?: null|string, * HopDestinations?: null|array, + * JobEngineVersion?: null|string, * JobTemplate?: null|string, * Priority?: null|int, * Queue?: null|string, @@ -223,6 +235,11 @@ public function getHopDestinations(): array return $this->hopDestinations ?? []; } + public function getJobEngineVersion(): ?string + { + return $this->jobEngineVersion; + } + public function getJobTemplate(): ?string { return $this->jobTemplate; @@ -339,6 +356,13 @@ public function setHopDestinations(array $value): self return $this; } + public function setJobEngineVersion(?string $value): self + { + $this->jobEngineVersion = $value; + + return $this; + } + public function setJobTemplate(?string $value): self { $this->jobTemplate = $value; @@ -438,6 +462,9 @@ private function requestBody(): array $payload['hopDestinations'][$index] = $listValue->requestBody(); } } + if (null !== $v = $this->jobEngineVersion) { + $payload['jobEngineVersion'] = $v; + } if (null !== $v = $this->jobTemplate) { $payload['jobTemplate'] = $v; } diff --git a/src/MediaConvertClient.php b/src/MediaConvertClient.php index 4333885..4b0bd44 100644 --- a/src/MediaConvertClient.php +++ b/src/MediaConvertClient.php @@ -80,6 +80,7 @@ public function cancelJob($input): CancelJobResponse * BillingTagsSource?: null|BillingTagsSource::*, * ClientRequestToken?: null|string, * HopDestinations?: null|array, + * JobEngineVersion?: null|string, * JobTemplate?: null|string, * Priority?: null|int, * Queue?: null|string, diff --git a/src/Result/CreateJobResponse.php b/src/Result/CreateJobResponse.php index 6771ac6..d5bb6cf 100644 --- a/src/Result/CreateJobResponse.php +++ b/src/Result/CreateJobResponse.php @@ -161,6 +161,8 @@ use AsyncAws\MediaConvert\ValueObject\VideoOverlay; use AsyncAws\MediaConvert\ValueObject\VideoOverlayInput; use AsyncAws\MediaConvert\ValueObject\VideoOverlayInputClipping; +use AsyncAws\MediaConvert\ValueObject\VideoOverlayPosition; +use AsyncAws\MediaConvert\ValueObject\VideoOverlayTransition; use AsyncAws\MediaConvert\ValueObject\VideoPreprocessor; use AsyncAws\MediaConvert\ValueObject\VideoSelector; use AsyncAws\MediaConvert\ValueObject\VorbisSettings; @@ -964,6 +966,7 @@ private function populateResultFileGroupSettings(array $json): FileGroupSettings private function populateResultFileSourceSettings(array $json): FileSourceSettings { return new FileSourceSettings([ + 'ByteRateLimit' => isset($json['byteRateLimit']) ? (string) $json['byteRateLimit'] : null, 'Convert608To708' => isset($json['convert608To708']) ? (string) $json['convert608To708'] : null, 'ConvertPaintToPop' => isset($json['convertPaintToPop']) ? (string) $json['convertPaintToPop'] : null, 'Framerate' => empty($json['framerate']) ? null : $this->populateResultCaptionSourceFramerate($json['framerate']), @@ -1045,6 +1048,7 @@ private function populateResultH264Settings(array $json): H264Settings 'QvbrSettings' => empty($json['qvbrSettings']) ? null : $this->populateResultH264QvbrSettings($json['qvbrSettings']), 'RateControlMode' => isset($json['rateControlMode']) ? (string) $json['rateControlMode'] : null, 'RepeatPps' => isset($json['repeatPps']) ? (string) $json['repeatPps'] : null, + 'SaliencyAwareEncoding' => isset($json['saliencyAwareEncoding']) ? (string) $json['saliencyAwareEncoding'] : null, 'ScanTypeConversionMode' => isset($json['scanTypeConversionMode']) ? (string) $json['scanTypeConversionMode'] : null, 'SceneChangeDetect' => isset($json['sceneChangeDetect']) ? (string) $json['sceneChangeDetect'] : null, 'Slices' => isset($json['slices']) ? (int) $json['slices'] : null, @@ -1369,6 +1373,8 @@ private function populateResultJob(array $json): Job 'ErrorMessage' => isset($json['errorMessage']) ? (string) $json['errorMessage'] : null, 'HopDestinations' => !isset($json['hopDestinations']) ? null : $this->populateResult__listOfHopDestination($json['hopDestinations']), 'Id' => isset($json['id']) ? (string) $json['id'] : null, + 'JobEngineVersionRequested' => isset($json['jobEngineVersionRequested']) ? (string) $json['jobEngineVersionRequested'] : null, + 'JobEngineVersionUsed' => isset($json['jobEngineVersionUsed']) ? (string) $json['jobEngineVersionUsed'] : null, 'JobPercentComplete' => isset($json['jobPercentComplete']) ? (int) $json['jobPercentComplete'] : null, 'JobTemplate' => isset($json['jobTemplate']) ? (string) $json['jobTemplate'] : null, 'Messages' => empty($json['messages']) ? null : $this->populateResultJobMessages($json['messages']), @@ -2126,8 +2132,11 @@ private function populateResultVideoOverlay(array $json): VideoOverlay { return new VideoOverlay([ 'EndTimecode' => isset($json['endTimecode']) ? (string) $json['endTimecode'] : null, + 'InitialPosition' => empty($json['initialPosition']) ? null : $this->populateResultVideoOverlayPosition($json['initialPosition']), 'Input' => empty($json['input']) ? null : $this->populateResultVideoOverlayInput($json['input']), + 'Playback' => isset($json['playback']) ? (string) $json['playback'] : null, 'StartTimecode' => isset($json['startTimecode']) ? (string) $json['startTimecode'] : null, + 'Transitions' => !isset($json['transitions']) ? null : $this->populateResult__listOfVideoOverlayTransition($json['transitions']), ]); } @@ -2149,6 +2158,26 @@ private function populateResultVideoOverlayInputClipping(array $json): VideoOver ]); } + private function populateResultVideoOverlayPosition(array $json): VideoOverlayPosition + { + return new VideoOverlayPosition([ + 'Height' => isset($json['height']) ? (int) $json['height'] : null, + 'Unit' => isset($json['unit']) ? (string) $json['unit'] : null, + 'Width' => isset($json['width']) ? (int) $json['width'] : null, + 'XPosition' => isset($json['xPosition']) ? (int) $json['xPosition'] : null, + 'YPosition' => isset($json['yPosition']) ? (int) $json['yPosition'] : null, + ]); + } + + private function populateResultVideoOverlayTransition(array $json): VideoOverlayTransition + { + return new VideoOverlayTransition([ + 'EndPosition' => empty($json['endPosition']) ? null : $this->populateResultVideoOverlayPosition($json['endPosition']), + 'EndTimecode' => isset($json['endTimecode']) ? (string) $json['endTimecode'] : null, + 'StartTimecode' => isset($json['startTimecode']) ? (string) $json['startTimecode'] : null, + ]); + } + private function populateResultVideoPreprocessor(array $json): VideoPreprocessor { return new VideoPreprocessor([ @@ -2694,6 +2723,19 @@ private function populateResult__listOfVideoOverlayInputClipping(array $json): a return $items; } + /** + * @return VideoOverlayTransition[] + */ + private function populateResult__listOfVideoOverlayTransition(array $json): array + { + $items = []; + foreach ($json as $item) { + $items[] = $this->populateResultVideoOverlayTransition($item); + } + + return $items; + } + /** * @return WarningGroup[] */ diff --git a/src/Result/GetJobResponse.php b/src/Result/GetJobResponse.php index e46debf..14f0932 100644 --- a/src/Result/GetJobResponse.php +++ b/src/Result/GetJobResponse.php @@ -161,6 +161,8 @@ use AsyncAws\MediaConvert\ValueObject\VideoOverlay; use AsyncAws\MediaConvert\ValueObject\VideoOverlayInput; use AsyncAws\MediaConvert\ValueObject\VideoOverlayInputClipping; +use AsyncAws\MediaConvert\ValueObject\VideoOverlayPosition; +use AsyncAws\MediaConvert\ValueObject\VideoOverlayTransition; use AsyncAws\MediaConvert\ValueObject\VideoPreprocessor; use AsyncAws\MediaConvert\ValueObject\VideoSelector; use AsyncAws\MediaConvert\ValueObject\VorbisSettings; @@ -964,6 +966,7 @@ private function populateResultFileGroupSettings(array $json): FileGroupSettings private function populateResultFileSourceSettings(array $json): FileSourceSettings { return new FileSourceSettings([ + 'ByteRateLimit' => isset($json['byteRateLimit']) ? (string) $json['byteRateLimit'] : null, 'Convert608To708' => isset($json['convert608To708']) ? (string) $json['convert608To708'] : null, 'ConvertPaintToPop' => isset($json['convertPaintToPop']) ? (string) $json['convertPaintToPop'] : null, 'Framerate' => empty($json['framerate']) ? null : $this->populateResultCaptionSourceFramerate($json['framerate']), @@ -1045,6 +1048,7 @@ private function populateResultH264Settings(array $json): H264Settings 'QvbrSettings' => empty($json['qvbrSettings']) ? null : $this->populateResultH264QvbrSettings($json['qvbrSettings']), 'RateControlMode' => isset($json['rateControlMode']) ? (string) $json['rateControlMode'] : null, 'RepeatPps' => isset($json['repeatPps']) ? (string) $json['repeatPps'] : null, + 'SaliencyAwareEncoding' => isset($json['saliencyAwareEncoding']) ? (string) $json['saliencyAwareEncoding'] : null, 'ScanTypeConversionMode' => isset($json['scanTypeConversionMode']) ? (string) $json['scanTypeConversionMode'] : null, 'SceneChangeDetect' => isset($json['sceneChangeDetect']) ? (string) $json['sceneChangeDetect'] : null, 'Slices' => isset($json['slices']) ? (int) $json['slices'] : null, @@ -1369,6 +1373,8 @@ private function populateResultJob(array $json): Job 'ErrorMessage' => isset($json['errorMessage']) ? (string) $json['errorMessage'] : null, 'HopDestinations' => !isset($json['hopDestinations']) ? null : $this->populateResult__listOfHopDestination($json['hopDestinations']), 'Id' => isset($json['id']) ? (string) $json['id'] : null, + 'JobEngineVersionRequested' => isset($json['jobEngineVersionRequested']) ? (string) $json['jobEngineVersionRequested'] : null, + 'JobEngineVersionUsed' => isset($json['jobEngineVersionUsed']) ? (string) $json['jobEngineVersionUsed'] : null, 'JobPercentComplete' => isset($json['jobPercentComplete']) ? (int) $json['jobPercentComplete'] : null, 'JobTemplate' => isset($json['jobTemplate']) ? (string) $json['jobTemplate'] : null, 'Messages' => empty($json['messages']) ? null : $this->populateResultJobMessages($json['messages']), @@ -2126,8 +2132,11 @@ private function populateResultVideoOverlay(array $json): VideoOverlay { return new VideoOverlay([ 'EndTimecode' => isset($json['endTimecode']) ? (string) $json['endTimecode'] : null, + 'InitialPosition' => empty($json['initialPosition']) ? null : $this->populateResultVideoOverlayPosition($json['initialPosition']), 'Input' => empty($json['input']) ? null : $this->populateResultVideoOverlayInput($json['input']), + 'Playback' => isset($json['playback']) ? (string) $json['playback'] : null, 'StartTimecode' => isset($json['startTimecode']) ? (string) $json['startTimecode'] : null, + 'Transitions' => !isset($json['transitions']) ? null : $this->populateResult__listOfVideoOverlayTransition($json['transitions']), ]); } @@ -2149,6 +2158,26 @@ private function populateResultVideoOverlayInputClipping(array $json): VideoOver ]); } + private function populateResultVideoOverlayPosition(array $json): VideoOverlayPosition + { + return new VideoOverlayPosition([ + 'Height' => isset($json['height']) ? (int) $json['height'] : null, + 'Unit' => isset($json['unit']) ? (string) $json['unit'] : null, + 'Width' => isset($json['width']) ? (int) $json['width'] : null, + 'XPosition' => isset($json['xPosition']) ? (int) $json['xPosition'] : null, + 'YPosition' => isset($json['yPosition']) ? (int) $json['yPosition'] : null, + ]); + } + + private function populateResultVideoOverlayTransition(array $json): VideoOverlayTransition + { + return new VideoOverlayTransition([ + 'EndPosition' => empty($json['endPosition']) ? null : $this->populateResultVideoOverlayPosition($json['endPosition']), + 'EndTimecode' => isset($json['endTimecode']) ? (string) $json['endTimecode'] : null, + 'StartTimecode' => isset($json['startTimecode']) ? (string) $json['startTimecode'] : null, + ]); + } + private function populateResultVideoPreprocessor(array $json): VideoPreprocessor { return new VideoPreprocessor([ @@ -2694,6 +2723,19 @@ private function populateResult__listOfVideoOverlayInputClipping(array $json): a return $items; } + /** + * @return VideoOverlayTransition[] + */ + private function populateResult__listOfVideoOverlayTransition(array $json): array + { + $items = []; + foreach ($json as $item) { + $items[] = $this->populateResultVideoOverlayTransition($item); + } + + return $items; + } + /** * @return WarningGroup[] */ diff --git a/src/Result/ListJobsResponse.php b/src/Result/ListJobsResponse.php index 61de9e9..ed4fe23 100644 --- a/src/Result/ListJobsResponse.php +++ b/src/Result/ListJobsResponse.php @@ -164,6 +164,8 @@ use AsyncAws\MediaConvert\ValueObject\VideoOverlay; use AsyncAws\MediaConvert\ValueObject\VideoOverlayInput; use AsyncAws\MediaConvert\ValueObject\VideoOverlayInputClipping; +use AsyncAws\MediaConvert\ValueObject\VideoOverlayPosition; +use AsyncAws\MediaConvert\ValueObject\VideoOverlayTransition; use AsyncAws\MediaConvert\ValueObject\VideoPreprocessor; use AsyncAws\MediaConvert\ValueObject\VideoSelector; use AsyncAws\MediaConvert\ValueObject\VorbisSettings; @@ -1031,6 +1033,7 @@ private function populateResultFileGroupSettings(array $json): FileGroupSettings private function populateResultFileSourceSettings(array $json): FileSourceSettings { return new FileSourceSettings([ + 'ByteRateLimit' => isset($json['byteRateLimit']) ? (string) $json['byteRateLimit'] : null, 'Convert608To708' => isset($json['convert608To708']) ? (string) $json['convert608To708'] : null, 'ConvertPaintToPop' => isset($json['convertPaintToPop']) ? (string) $json['convertPaintToPop'] : null, 'Framerate' => empty($json['framerate']) ? null : $this->populateResultCaptionSourceFramerate($json['framerate']), @@ -1112,6 +1115,7 @@ private function populateResultH264Settings(array $json): H264Settings 'QvbrSettings' => empty($json['qvbrSettings']) ? null : $this->populateResultH264QvbrSettings($json['qvbrSettings']), 'RateControlMode' => isset($json['rateControlMode']) ? (string) $json['rateControlMode'] : null, 'RepeatPps' => isset($json['repeatPps']) ? (string) $json['repeatPps'] : null, + 'SaliencyAwareEncoding' => isset($json['saliencyAwareEncoding']) ? (string) $json['saliencyAwareEncoding'] : null, 'ScanTypeConversionMode' => isset($json['scanTypeConversionMode']) ? (string) $json['scanTypeConversionMode'] : null, 'SceneChangeDetect' => isset($json['sceneChangeDetect']) ? (string) $json['sceneChangeDetect'] : null, 'Slices' => isset($json['slices']) ? (int) $json['slices'] : null, @@ -1436,6 +1440,8 @@ private function populateResultJob(array $json): Job 'ErrorMessage' => isset($json['errorMessage']) ? (string) $json['errorMessage'] : null, 'HopDestinations' => !isset($json['hopDestinations']) ? null : $this->populateResult__listOfHopDestination($json['hopDestinations']), 'Id' => isset($json['id']) ? (string) $json['id'] : null, + 'JobEngineVersionRequested' => isset($json['jobEngineVersionRequested']) ? (string) $json['jobEngineVersionRequested'] : null, + 'JobEngineVersionUsed' => isset($json['jobEngineVersionUsed']) ? (string) $json['jobEngineVersionUsed'] : null, 'JobPercentComplete' => isset($json['jobPercentComplete']) ? (int) $json['jobPercentComplete'] : null, 'JobTemplate' => isset($json['jobTemplate']) ? (string) $json['jobTemplate'] : null, 'Messages' => empty($json['messages']) ? null : $this->populateResultJobMessages($json['messages']), @@ -2193,8 +2199,11 @@ private function populateResultVideoOverlay(array $json): VideoOverlay { return new VideoOverlay([ 'EndTimecode' => isset($json['endTimecode']) ? (string) $json['endTimecode'] : null, + 'InitialPosition' => empty($json['initialPosition']) ? null : $this->populateResultVideoOverlayPosition($json['initialPosition']), 'Input' => empty($json['input']) ? null : $this->populateResultVideoOverlayInput($json['input']), + 'Playback' => isset($json['playback']) ? (string) $json['playback'] : null, 'StartTimecode' => isset($json['startTimecode']) ? (string) $json['startTimecode'] : null, + 'Transitions' => !isset($json['transitions']) ? null : $this->populateResult__listOfVideoOverlayTransition($json['transitions']), ]); } @@ -2216,6 +2225,26 @@ private function populateResultVideoOverlayInputClipping(array $json): VideoOver ]); } + private function populateResultVideoOverlayPosition(array $json): VideoOverlayPosition + { + return new VideoOverlayPosition([ + 'Height' => isset($json['height']) ? (int) $json['height'] : null, + 'Unit' => isset($json['unit']) ? (string) $json['unit'] : null, + 'Width' => isset($json['width']) ? (int) $json['width'] : null, + 'XPosition' => isset($json['xPosition']) ? (int) $json['xPosition'] : null, + 'YPosition' => isset($json['yPosition']) ? (int) $json['yPosition'] : null, + ]); + } + + private function populateResultVideoOverlayTransition(array $json): VideoOverlayTransition + { + return new VideoOverlayTransition([ + 'EndPosition' => empty($json['endPosition']) ? null : $this->populateResultVideoOverlayPosition($json['endPosition']), + 'EndTimecode' => isset($json['endTimecode']) ? (string) $json['endTimecode'] : null, + 'StartTimecode' => isset($json['startTimecode']) ? (string) $json['startTimecode'] : null, + ]); + } + private function populateResultVideoPreprocessor(array $json): VideoPreprocessor { return new VideoPreprocessor([ @@ -2774,6 +2803,19 @@ private function populateResult__listOfVideoOverlayInputClipping(array $json): a return $items; } + /** + * @return VideoOverlayTransition[] + */ + private function populateResult__listOfVideoOverlayTransition(array $json): array + { + $items = []; + foreach ($json as $item) { + $items[] = $this->populateResultVideoOverlayTransition($item); + } + + return $items; + } + /** * @return WarningGroup[] */ diff --git a/src/ValueObject/AacSettings.php b/src/ValueObject/AacSettings.php index f0a870c..8c51f5a 100644 --- a/src/ValueObject/AacSettings.php +++ b/src/ValueObject/AacSettings.php @@ -43,7 +43,10 @@ final class AacSettings private $bitrate; /** - * AAC Profile. + * Specify the AAC profile. For the widest player compatibility and where higher bitrates are acceptable: Keep the + * default profile, LC (AAC-LC) For improved audio performance at lower bitrates: Choose HEV1 or HEV2. HEV1 (AAC-HE v1) + * adds spectral band replication to improve speech audio at low bitrates. HEV2 (AAC-HE v2) adds parametric stereo, + * which optimizes for encoding stereo audio at very low bitrates. * * @var AacCodecProfile::*|null */ @@ -62,7 +65,9 @@ final class AacSettings private $codingMode; /** - * Rate Control Mode. + * Specify the AAC rate control mode. For a constant bitrate: Choose CBR. Your AAC output bitrate will be equal to the + * value that you choose for Bitrate. For a variable bitrate: Choose VBR. Your AAC output bitrate will vary according to + * your audio content and the value that you choose for Bitrate quality. * * @var AacRateControlMode::*|null */ @@ -77,12 +82,9 @@ final class AacSettings private $rawFormat; /** - * Specify the Sample rate in Hz. Valid sample rates depend on the Profile and Coding mode that you select. The - * following list shows valid sample rates for each Profile and Coding mode. * LC Profile, Coding mode 1.0, 2.0, and - * Receiver Mix: 8000, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 88200, 96000. * LC Profile, Coding mode 5.1: - * 32000, 44100, 48000, 96000. * HEV1 Profile, Coding mode 1.0 and Receiver Mix: 22050, 24000, 32000, 44100, 48000. * - * HEV1 Profile, Coding mode 2.0 and 5.1: 32000, 44100, 48000, 96000. * HEV2 Profile, Coding mode 2.0: 22050, 24000, - * 32000, 44100, 48000. + * Specify the AAC sample rate in samples per second (Hz). Valid sample rates depend on the AAC profile and Coding mode + * that you select. For a list of supported sample rates, see: + * https://docs.aws.amazon.com/mediaconvert/latest/ug/aac-support.html. * * @var int|null */ @@ -96,7 +98,8 @@ final class AacSettings private $specification; /** - * VBR Quality Level - Only used if rate_control_mode is VBR. + * Specify the quality of your variable bitrate (VBR) AAC audio. For a list of approximate VBR bitrates, see: + * https://docs.aws.amazon.com/mediaconvert/latest/ug/aac-support.html#aac_vbr * * @var AacVbrQuality::*|null */ diff --git a/src/ValueObject/AudioSelector.php b/src/ValueObject/AudioSelector.php index 8106fe3..1f61591 100644 --- a/src/ValueObject/AudioSelector.php +++ b/src/ValueObject/AudioSelector.php @@ -23,7 +23,9 @@ final class AudioSelector * align the audio track length with STTS duration. Track-level correction does not affect pitch, and is recommended for * tonal audio content such as music. * Frame: Adjust the duration of each audio frame by a variable amount to align * audio frames with STTS timestamps. No corrections are made to already-aligned frames. Frame-level correction may - * affect the pitch of corrected frames, and is recommended for atonal audio content such as speech or percussion. + * affect the pitch of corrected frames, and is recommended for atonal audio content such as speech or percussion. * + * Force: Apply audio duration correction, either Track or Frame depending on your input, regardless of the accuracy of + * your input's STTS table. Your output audio and video may not be aligned or it may contain audio artifacts. * * @var AudioDurationCorrection::*|null */ diff --git a/src/ValueObject/FileSourceSettings.php b/src/ValueObject/FileSourceSettings.php index f9d055f..8480c56 100644 --- a/src/ValueObject/FileSourceSettings.php +++ b/src/ValueObject/FileSourceSettings.php @@ -3,6 +3,7 @@ namespace AsyncAws\MediaConvert\ValueObject; use AsyncAws\Core\Exception\InvalidArgument; +use AsyncAws\MediaConvert\Enum\CaptionSourceByteRateLimit; use AsyncAws\MediaConvert\Enum\CaptionSourceConvertPaintOnToPopOn; use AsyncAws\MediaConvert\Enum\FileSourceConvert608To708; use AsyncAws\MediaConvert\Enum\FileSourceTimeDeltaUnits; @@ -14,6 +15,18 @@ */ final class FileSourceSettings { + /** + * Choose whether to limit the byte rate at which your SCC input captions are inserted into your output. To not limit + * the caption rate: We recommend that you keep the default value, Disabled. MediaConvert inserts captions in your + * output according to the byte rates listed in the EIA-608 specification, typically 2 or 3 caption bytes per frame + * depending on your output frame rate. To limit your output caption rate: Choose Enabled. Choose this option if your + * downstream systems require a maximum of 2 caption bytes per frame. Note that this setting has no effect when your + * output frame rate is 30 or 60. + * + * @var CaptionSourceByteRateLimit::*|null + */ + private $byteRateLimit; + /** * Specify whether this set of input captions appears in your outputs in both 608 and 708 format. If you choose * Upconvert, MediaConvert includes the captions data in two ways: it passes the 608 data through using the 608 @@ -76,6 +89,7 @@ final class FileSourceSettings /** * @param array{ + * ByteRateLimit?: null|CaptionSourceByteRateLimit::*, * Convert608To708?: null|FileSourceConvert608To708::*, * ConvertPaintToPop?: null|CaptionSourceConvertPaintOnToPopOn::*, * Framerate?: null|CaptionSourceFramerate|array, @@ -86,6 +100,7 @@ final class FileSourceSettings */ public function __construct(array $input) { + $this->byteRateLimit = $input['ByteRateLimit'] ?? null; $this->convert608To708 = $input['Convert608To708'] ?? null; $this->convertPaintToPop = $input['ConvertPaintToPop'] ?? null; $this->framerate = isset($input['Framerate']) ? CaptionSourceFramerate::create($input['Framerate']) : null; @@ -96,6 +111,7 @@ public function __construct(array $input) /** * @param array{ + * ByteRateLimit?: null|CaptionSourceByteRateLimit::*, * Convert608To708?: null|FileSourceConvert608To708::*, * ConvertPaintToPop?: null|CaptionSourceConvertPaintOnToPopOn::*, * Framerate?: null|CaptionSourceFramerate|array, @@ -109,6 +125,14 @@ public static function create($input): self return $input instanceof self ? $input : new self($input); } + /** + * @return CaptionSourceByteRateLimit::*|null + */ + public function getByteRateLimit(): ?string + { + return $this->byteRateLimit; + } + /** * @return FileSourceConvert608To708::*|null */ @@ -154,6 +178,12 @@ public function getTimeDeltaUnits(): ?string public function requestBody(): array { $payload = []; + if (null !== $v = $this->byteRateLimit) { + if (!CaptionSourceByteRateLimit::exists($v)) { + throw new InvalidArgument(\sprintf('Invalid parameter "byteRateLimit" for "%s". The value "%s" is not a valid "CaptionSourceByteRateLimit".', __CLASS__, $v)); + } + $payload['byteRateLimit'] = $v; + } if (null !== $v = $this->convert608To708) { if (!FileSourceConvert608To708::exists($v)) { throw new InvalidArgument(\sprintf('Invalid parameter "convert608To708" for "%s". The value "%s" is not a valid "FileSourceConvert608To708".', __CLASS__, $v)); diff --git a/src/ValueObject/H264Settings.php b/src/ValueObject/H264Settings.php index 40606b5..8aecf76 100644 --- a/src/ValueObject/H264Settings.php +++ b/src/ValueObject/H264Settings.php @@ -20,6 +20,7 @@ use AsyncAws\MediaConvert\Enum\H264QualityTuningLevel; use AsyncAws\MediaConvert\Enum\H264RateControlMode; use AsyncAws\MediaConvert\Enum\H264RepeatPps; +use AsyncAws\MediaConvert\Enum\H264SaliencyAwareEncoding; use AsyncAws\MediaConvert\Enum\H264ScanTypeConversionMode; use AsyncAws\MediaConvert\Enum\H264SceneChangeDetect; use AsyncAws\MediaConvert\Enum\H264SlowPal; @@ -264,16 +265,17 @@ final class H264Settings private $maxBitrate; /** - * Use this setting only when you also enable Scene change detection. This setting determines how the encoder manages - * the spacing between I-frames that it inserts as part of the I-frame cadence and the I-frames that it inserts for - * Scene change detection. We recommend that you have the transcoder automatically choose this value for you based on - * characteristics of your input video. To enable this automatic behavior, do this by keeping the default empty value. - * When you explicitly specify a value for this setting, the encoder determines whether to skip a cadence-driven I-frame - * by the value you set. For example, if you set Min I interval to 5 and a cadence-driven I-frame would fall within 5 - * frames of a scene-change I-frame, then the encoder skips the cadence-driven I-frame. In this way, one GOP is shrunk - * slightly and one GOP is stretched slightly. When the cadence-driven I-frames are farther from the scene-change - * I-frame than the value you set, then the encoder leaves all I-frames in place and the GOPs surrounding the scene - * change are smaller than the usual cadence GOPs. + * Specify the minimum number of frames allowed between two IDR-frames in your output. This includes frames created at + * the start of a GOP or a scene change. Use Min I-Interval to improve video compression by varying GOP size when two + * IDR-frames would be created near each other. For example, if a regular cadence-driven IDR-frame would fall within 5 + * frames of a scene-change IDR-frame, and you set Min I-interval to 5, then the encoder would only write an IDR-frame + * for the scene-change. In this way, one GOP is shortened or extended. If a cadence-driven IDR-frame would be further + * than 5 frames from a scene-change IDR-frame, then the encoder leaves all IDR-frames in place. To use an automatically + * determined interval: We recommend that you keep this value blank. This allows for MediaConvert to use an optimal + * setting according to the characteristics of your input video, and results in better video compression. To manually + * specify an interval: Enter a value from 1 to 30. Use when your downstream systems have specific GOP size + * requirements. To disable GOP size variance: Enter 0. MediaConvert will only create IDR-frames at the start of your + * output's cadence-driven GOP. Use when your downstream systems require a regular GOP size. * * @var int|null */ @@ -360,6 +362,18 @@ final class H264Settings */ private $repeatPps; + /** + * Specify whether to apply Saliency aware encoding to your output. Use to improve the perceptual video quality of your + * output by allocating more encoding bits to the prominent or noticeable parts of your content. To apply saliency aware + * encoding, when possible: We recommend that you choose Preferred. The effects of Saliency aware encoding are best seen + * in lower bitrate outputs. When you choose Preferred, note that Saliency aware encoding will only apply to outputs + * that are 720p or higher in resolution. To not apply saliency aware encoding, prioritizing encoding speed over + * perceptual video quality: Choose Disabled. + * + * @var H264SaliencyAwareEncoding::*|null + */ + private $saliencyAwareEncoding; + /** * Use this setting for interlaced outputs, when your output frame rate is half of your input frame rate. In this * situation, choose Optimized interlacing to create a better quality interlaced output. In this case, each progressive @@ -515,6 +529,7 @@ final class H264Settings * QvbrSettings?: null|H264QvbrSettings|array, * RateControlMode?: null|H264RateControlMode::*, * RepeatPps?: null|H264RepeatPps::*, + * SaliencyAwareEncoding?: null|H264SaliencyAwareEncoding::*, * ScanTypeConversionMode?: null|H264ScanTypeConversionMode::*, * SceneChangeDetect?: null|H264SceneChangeDetect::*, * Slices?: null|int, @@ -562,6 +577,7 @@ public function __construct(array $input) $this->qvbrSettings = isset($input['QvbrSettings']) ? H264QvbrSettings::create($input['QvbrSettings']) : null; $this->rateControlMode = $input['RateControlMode'] ?? null; $this->repeatPps = $input['RepeatPps'] ?? null; + $this->saliencyAwareEncoding = $input['SaliencyAwareEncoding'] ?? null; $this->scanTypeConversionMode = $input['ScanTypeConversionMode'] ?? null; $this->sceneChangeDetect = $input['SceneChangeDetect'] ?? null; $this->slices = $input['Slices'] ?? null; @@ -609,6 +625,7 @@ public function __construct(array $input) * QvbrSettings?: null|H264QvbrSettings|array, * RateControlMode?: null|H264RateControlMode::*, * RepeatPps?: null|H264RepeatPps::*, + * SaliencyAwareEncoding?: null|H264SaliencyAwareEncoding::*, * ScanTypeConversionMode?: null|H264ScanTypeConversionMode::*, * SceneChangeDetect?: null|H264SceneChangeDetect::*, * Slices?: null|int, @@ -842,6 +859,14 @@ public function getRepeatPps(): ?string return $this->repeatPps; } + /** + * @return H264SaliencyAwareEncoding::*|null + */ + public function getSaliencyAwareEncoding(): ?string + { + return $this->saliencyAwareEncoding; + } + /** * @return H264ScanTypeConversionMode::*|null */ @@ -1072,6 +1097,12 @@ public function requestBody(): array } $payload['repeatPps'] = $v; } + if (null !== $v = $this->saliencyAwareEncoding) { + if (!H264SaliencyAwareEncoding::exists($v)) { + throw new InvalidArgument(\sprintf('Invalid parameter "saliencyAwareEncoding" for "%s". The value "%s" is not a valid "H264SaliencyAwareEncoding".', __CLASS__, $v)); + } + $payload['saliencyAwareEncoding'] = $v; + } if (null !== $v = $this->scanTypeConversionMode) { if (!H264ScanTypeConversionMode::exists($v)) { throw new InvalidArgument(\sprintf('Invalid parameter "scanTypeConversionMode" for "%s". The value "%s" is not a valid "H264ScanTypeConversionMode".', __CLASS__, $v)); diff --git a/src/ValueObject/H265Settings.php b/src/ValueObject/H265Settings.php index e256f01..fe4ddad 100644 --- a/src/ValueObject/H265Settings.php +++ b/src/ValueObject/H265Settings.php @@ -252,16 +252,17 @@ final class H265Settings private $maxBitrate; /** - * Use this setting only when you also enable Scene change detection. This setting determines how the encoder manages - * the spacing between I-frames that it inserts as part of the I-frame cadence and the I-frames that it inserts for - * Scene change detection. We recommend that you have the transcoder automatically choose this value for you based on - * characteristics of your input video. To enable this automatic behavior, do this by keeping the default empty value. - * When you explicitly specify a value for this setting, the encoder determines whether to skip a cadence-driven I-frame - * by the value you set. For example, if you set Min I interval to 5 and a cadence-driven I-frame would fall within 5 - * frames of a scene-change I-frame, then the encoder skips the cadence-driven I-frame. In this way, one GOP is shrunk - * slightly and one GOP is stretched slightly. When the cadence-driven I-frames are farther from the scene-change - * I-frame than the value you set, then the encoder leaves all I-frames in place and the GOPs surrounding the scene - * change are smaller than the usual cadence GOPs. + * Specify the minimum number of frames allowed between two IDR-frames in your output. This includes frames created at + * the start of a GOP or a scene change. Use Min I-Interval to improve video compression by varying GOP size when two + * IDR-frames would be created near each other. For example, if a regular cadence-driven IDR-frame would fall within 5 + * frames of a scene-change IDR-frame, and you set Min I-interval to 5, then the encoder would only write an IDR-frame + * for the scene-change. In this way, one GOP is shortened or extended. If a cadence-driven IDR-frame would be further + * than 5 frames from a scene-change IDR-frame, then the encoder leaves all IDR-frames in place. To use an automatically + * determined interval: We recommend that you keep this value blank. This allows for MediaConvert to use an optimal + * setting according to the characteristics of your input video, and results in better video compression. To manually + * specify an interval: Enter a value from 1 to 30. Use when your downstream systems have specific GOP size + * requirements. To disable GOP size variance: Enter 0. MediaConvert will only create IDR-frames at the start of your + * output's cadence-driven GOP. Use when your downstream systems require a regular GOP size. * * @var int|null */ diff --git a/src/ValueObject/Job.php b/src/ValueObject/Job.php index 0519e5a..68029b4 100644 --- a/src/ValueObject/Job.php +++ b/src/ValueObject/Job.php @@ -104,6 +104,24 @@ final class Job */ private $id; + /** + * The Job engine version that you requested for your job. Valid versions are in a YYYY-MM-DD format. + * + * @var string|null + */ + private $jobEngineVersionRequested; + + /** + * The Job engine version that your job used. Job engine versions are in a YYYY-MM-DD format. When you request an + * expired version, the response for this property will be empty. Requests to create jobs with an expired version result + * in a regular job, as if no specific Job engine version was requested. When you request an invalid version, the + * response for this property will be empty. Requests to create jobs with an invalid version result in a 400 error + * message, and no job is created. + * + * @var string|null + */ + private $jobEngineVersionUsed; + /** * An estimate of how far your job has progressed. This estimate is shown as a percentage of the total time from when * your job leaves its queue to when your output files appear in your output Amazon S3 bucket. AWS Elemental @@ -242,6 +260,8 @@ final class Job * ErrorMessage?: null|string, * HopDestinations?: null|array, * Id?: null|string, + * JobEngineVersionRequested?: null|string, + * JobEngineVersionUsed?: null|string, * JobPercentComplete?: null|int, * JobTemplate?: null|string, * Messages?: null|JobMessages|array, @@ -273,6 +293,8 @@ public function __construct(array $input) $this->errorMessage = $input['ErrorMessage'] ?? null; $this->hopDestinations = isset($input['HopDestinations']) ? array_map([HopDestination::class, 'create'], $input['HopDestinations']) : null; $this->id = $input['Id'] ?? null; + $this->jobEngineVersionRequested = $input['JobEngineVersionRequested'] ?? null; + $this->jobEngineVersionUsed = $input['JobEngineVersionUsed'] ?? null; $this->jobPercentComplete = $input['JobPercentComplete'] ?? null; $this->jobTemplate = $input['JobTemplate'] ?? null; $this->messages = isset($input['Messages']) ? JobMessages::create($input['Messages']) : null; @@ -304,6 +326,8 @@ public function __construct(array $input) * ErrorMessage?: null|string, * HopDestinations?: null|array, * Id?: null|string, + * JobEngineVersionRequested?: null|string, + * JobEngineVersionUsed?: null|string, * JobPercentComplete?: null|int, * JobTemplate?: null|string, * Messages?: null|JobMessages|array, @@ -394,6 +418,16 @@ public function getId(): ?string return $this->id; } + public function getJobEngineVersionRequested(): ?string + { + return $this->jobEngineVersionRequested; + } + + public function getJobEngineVersionUsed(): ?string + { + return $this->jobEngineVersionUsed; + } + public function getJobPercentComplete(): ?int { return $this->jobPercentComplete; diff --git a/src/ValueObject/Mpeg2Settings.php b/src/ValueObject/Mpeg2Settings.php index 6277b7a..f763a70 100644 --- a/src/ValueObject/Mpeg2Settings.php +++ b/src/ValueObject/Mpeg2Settings.php @@ -191,14 +191,15 @@ final class Mpeg2Settings private $maxBitrate; /** - * Use this setting only when you also enable Scene change detection. This setting determines how the encoder manages - * the spacing between I-frames that it inserts as part of the I-frame cadence and the I-frames that it inserts for - * Scene change detection. When you specify a value for this setting, the encoder determines whether to skip a - * cadence-driven I-frame by the value you set. For example, if you set Min I interval to 5 and a cadence-driven I-frame - * would fall within 5 frames of a scene-change I-frame, then the encoder skips the cadence-driven I-frame. In this way, - * one GOP is shrunk slightly and one GOP is stretched slightly. When the cadence-driven I-frames are farther from the - * scene-change I-frame than the value you set, then the encoder leaves all I-frames in place and the GOPs surrounding - * the scene change are smaller than the usual cadence GOPs. + * Specify the minimum number of frames allowed between two IDR-frames in your output. This includes frames created at + * the start of a GOP or a scene change. Use Min I-Interval to improve video compression by varying GOP size when two + * IDR-frames would be created near each other. For example, if a regular cadence-driven IDR-frame would fall within 5 + * frames of a scene-change IDR-frame, and you set Min I-interval to 5, then the encoder would only write an IDR-frame + * for the scene-change. In this way, one GOP is shortened or extended. If a cadence-driven IDR-frame would be further + * than 5 frames from a scene-change IDR-frame, then the encoder leaves all IDR-frames in place. To manually specify an + * interval: Enter a value from 1 to 30. Use when your downstream systems have specific GOP size requirements. To + * disable GOP size variance: Enter 0. MediaConvert will only create IDR-frames at the start of your output's + * cadence-driven GOP. Use when your downstream systems require a regular GOP size. * * @var int|null */ diff --git a/src/ValueObject/VideoOverlay.php b/src/ValueObject/VideoOverlay.php index 34f7900..ddd31e0 100644 --- a/src/ValueObject/VideoOverlay.php +++ b/src/ValueObject/VideoOverlay.php @@ -2,6 +2,9 @@ namespace AsyncAws\MediaConvert\ValueObject; +use AsyncAws\Core\Exception\InvalidArgument; +use AsyncAws\MediaConvert\Enum\VideoOverlayPlayBackMode; + /** * Overlay one or more videos on top of your input video. For more information, see * https://docs.aws.amazon.com/mediaconvert/latest/ug/video-overlays.html. @@ -9,17 +12,25 @@ final class VideoOverlay { /** - * Enter the end timecode in the underlying input video for this overlay. Your overlay will be active through this - * frame. To display your video overlay for the duration of the underlying video: Leave blank. Use the format - * HH:MM:SS:FF or HH:MM:SS;FF, where HH is the hour, MM is the minute, SS is the second, and FF is the frame number. - * When entering this value, take into account your choice for the underlying Input timecode source. For example, if you - * have embedded timecodes that start at 01:00:00:00 and you want your overlay to end ten minutes into the video, enter - * 01:10:00:00. + * Enter the end timecode in the base input video for this overlay. Your overlay will be active through this frame. To + * display your video overlay for the duration of the base input video: Leave blank. Use the format HH:MM:SS:FF or + * HH:MM:SS;FF, where HH is the hour, MM is the minute, SS isthe second, and FF is the frame number. When entering this + * value, take into account your choice for the base input video's timecode source. For example, if you have embedded + * timecodes that start at 01:00:00:00 and you want your overlay to end ten minutes into the video, enter 01:10:00:00. * * @var string|null */ private $endTimecode; + /** + * Specify the Initial position of your video overlay. To specify the Initial position of your video overlay, including + * distance from the left or top edge of the base input video's frame, or size: Enter a value for X position, Y + * position, Width, or Height. To use the full frame of the base input video: Leave blank. + * + * @var VideoOverlayPosition|null + */ + private $initialPosition; + /** * Input settings for Video overlay. You can include one or more video overlays in sequence at different times that you * specify. @@ -29,36 +40,64 @@ final class VideoOverlay private $input; /** - * Enter the start timecode in the underlying input video for this overlay. Your overlay will be active starting with - * this frame. To display your video overlay starting at the beginning of the underlying video: Leave blank. Use the - * format HH:MM:SS:FF or HH:MM:SS;FF, where HH is the hour, MM is the minute, SS is the second, and FF is the frame - * number. When entering this value, take into account your choice for the underlying Input timecode source. For - * example, if you have embedded timecodes that start at 01:00:00:00 and you want your overlay to begin five minutes - * into the video, enter 01:05:00:00. + * Specify whether your video overlay repeats or plays only once. To repeat your video overlay on a loop: Keep the + * default value, Repeat. Your overlay will repeat for the duration of the base input video. To playback your video + * overlay only once: Choose Once. With either option, you can end playback at a time that you specify by entering a + * value for End timecode. + * + * @var VideoOverlayPlayBackMode::*|null + */ + private $playback; + + /** + * Enter the start timecode in the base input video for this overlay. Your overlay will be active starting with this + * frame. To display your video overlay starting at the beginning of the base input video: Leave blank. Use the format + * HH:MM:SS:FF or HH:MM:SS;FF, where HH is the hour, MM is the minute, SS is the second, and FF is the frame number. + * When entering this value, take into account your choice for the base input video's timecode source. For example, if + * you have embedded timecodes that start at 01:00:00:00 and you want your overlay to begin five minutes into the video, + * enter 01:05:00:00. * * @var string|null */ private $startTimecode; + /** + * Specify one or more transitions for your video overlay. Use Transitions to reposition or resize your overlay over + * time. To use the same position and size for the duration of your video overlay: Leave blank. To specify a Transition: + * Enter a value for Start timecode, End Timecode, X Position, Y Position, Width, or Height. + * + * @var VideoOverlayTransition[]|null + */ + private $transitions; + /** * @param array{ * EndTimecode?: null|string, + * InitialPosition?: null|VideoOverlayPosition|array, * Input?: null|VideoOverlayInput|array, + * Playback?: null|VideoOverlayPlayBackMode::*, * StartTimecode?: null|string, + * Transitions?: null|array, * } $input */ public function __construct(array $input) { $this->endTimecode = $input['EndTimecode'] ?? null; + $this->initialPosition = isset($input['InitialPosition']) ? VideoOverlayPosition::create($input['InitialPosition']) : null; $this->input = isset($input['Input']) ? VideoOverlayInput::create($input['Input']) : null; + $this->playback = $input['Playback'] ?? null; $this->startTimecode = $input['StartTimecode'] ?? null; + $this->transitions = isset($input['Transitions']) ? array_map([VideoOverlayTransition::class, 'create'], $input['Transitions']) : null; } /** * @param array{ * EndTimecode?: null|string, + * InitialPosition?: null|VideoOverlayPosition|array, * Input?: null|VideoOverlayInput|array, + * Playback?: null|VideoOverlayPlayBackMode::*, * StartTimecode?: null|string, + * Transitions?: null|array, * }|VideoOverlay $input */ public static function create($input): self @@ -71,16 +110,37 @@ public function getEndTimecode(): ?string return $this->endTimecode; } + public function getInitialPosition(): ?VideoOverlayPosition + { + return $this->initialPosition; + } + public function getInput(): ?VideoOverlayInput { return $this->input; } + /** + * @return VideoOverlayPlayBackMode::*|null + */ + public function getPlayback(): ?string + { + return $this->playback; + } + public function getStartTimecode(): ?string { return $this->startTimecode; } + /** + * @return VideoOverlayTransition[] + */ + public function getTransitions(): array + { + return $this->transitions ?? []; + } + /** * @internal */ @@ -90,12 +150,29 @@ public function requestBody(): array if (null !== $v = $this->endTimecode) { $payload['endTimecode'] = $v; } + if (null !== $v = $this->initialPosition) { + $payload['initialPosition'] = $v->requestBody(); + } if (null !== $v = $this->input) { $payload['input'] = $v->requestBody(); } + if (null !== $v = $this->playback) { + if (!VideoOverlayPlayBackMode::exists($v)) { + throw new InvalidArgument(\sprintf('Invalid parameter "playback" for "%s". The value "%s" is not a valid "VideoOverlayPlayBackMode".', __CLASS__, $v)); + } + $payload['playback'] = $v; + } if (null !== $v = $this->startTimecode) { $payload['startTimecode'] = $v; } + if (null !== $v = $this->transitions) { + $index = -1; + $payload['transitions'] = []; + foreach ($v as $listValue) { + ++$index; + $payload['transitions'][$index] = $listValue->requestBody(); + } + } return $payload; } diff --git a/src/ValueObject/VideoOverlayInput.php b/src/ValueObject/VideoOverlayInput.php index dd4bef9..ddfb5e9 100644 --- a/src/ValueObject/VideoOverlayInput.php +++ b/src/ValueObject/VideoOverlayInput.php @@ -12,8 +12,8 @@ final class VideoOverlayInput { /** - * Specify the input file S3, HTTP, or HTTPS URI for your video overlay. For consistency in color and formatting in your - * output video image, we recommend that you specify a video with similar characteristics as the underlying input video. + * Specify the input file S3, HTTP, or HTTPS URL for your video overlay. + * To specify one or more Transitions for your base input video instead: Leave blank. * * @var string|null */ diff --git a/src/ValueObject/VideoOverlayPosition.php b/src/ValueObject/VideoOverlayPosition.php new file mode 100644 index 0000000..353e3e2 --- /dev/null +++ b/src/ValueObject/VideoOverlayPosition.php @@ -0,0 +1,156 @@ +height = $input['Height'] ?? null; + $this->unit = $input['Unit'] ?? null; + $this->width = $input['Width'] ?? null; + $this->xposition = $input['XPosition'] ?? null; + $this->yposition = $input['YPosition'] ?? null; + } + + /** + * @param array{ + * Height?: null|int, + * Unit?: null|VideoOverlayUnit::*, + * Width?: null|int, + * XPosition?: null|int, + * YPosition?: null|int, + * }|VideoOverlayPosition $input + */ + public static function create($input): self + { + return $input instanceof self ? $input : new self($input); + } + + public function getHeight(): ?int + { + return $this->height; + } + + /** + * @return VideoOverlayUnit::*|null + */ + public function getUnit(): ?string + { + return $this->unit; + } + + public function getWidth(): ?int + { + return $this->width; + } + + public function getXposition(): ?int + { + return $this->xposition; + } + + public function getYposition(): ?int + { + return $this->yposition; + } + + /** + * @internal + */ + public function requestBody(): array + { + $payload = []; + if (null !== $v = $this->height) { + $payload['height'] = $v; + } + if (null !== $v = $this->unit) { + if (!VideoOverlayUnit::exists($v)) { + throw new InvalidArgument(\sprintf('Invalid parameter "unit" for "%s". The value "%s" is not a valid "VideoOverlayUnit".', __CLASS__, $v)); + } + $payload['unit'] = $v; + } + if (null !== $v = $this->width) { + $payload['width'] = $v; + } + if (null !== $v = $this->xposition) { + $payload['xPosition'] = $v; + } + if (null !== $v = $this->yposition) { + $payload['yPosition'] = $v; + } + + return $payload; + } +} diff --git a/src/ValueObject/VideoOverlayTransition.php b/src/ValueObject/VideoOverlayTransition.php new file mode 100644 index 0000000..9597750 --- /dev/null +++ b/src/ValueObject/VideoOverlayTransition.php @@ -0,0 +1,98 @@ +endPosition = isset($input['EndPosition']) ? VideoOverlayPosition::create($input['EndPosition']) : null; + $this->endTimecode = $input['EndTimecode'] ?? null; + $this->startTimecode = $input['StartTimecode'] ?? null; + } + + /** + * @param array{ + * EndPosition?: null|VideoOverlayPosition|array, + * EndTimecode?: null|string, + * StartTimecode?: null|string, + * }|VideoOverlayTransition $input + */ + public static function create($input): self + { + return $input instanceof self ? $input : new self($input); + } + + public function getEndPosition(): ?VideoOverlayPosition + { + return $this->endPosition; + } + + public function getEndTimecode(): ?string + { + return $this->endTimecode; + } + + public function getStartTimecode(): ?string + { + return $this->startTimecode; + } + + /** + * @internal + */ + public function requestBody(): array + { + $payload = []; + if (null !== $v = $this->endPosition) { + $payload['endPosition'] = $v->requestBody(); + } + if (null !== $v = $this->endTimecode) { + $payload['endTimecode'] = $v; + } + if (null !== $v = $this->startTimecode) { + $payload['startTimecode'] = $v; + } + + return $payload; + } +}