Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
software.amazon.awssdk.services.elastictranscoder.model.VideoParameters Maven / Gradle / Ivy
Go to download
The AWS Java SDK for Amazon Elastic Transcoder module holds the client classes that are used for
communicating with Amazon Elastic Transcoder Service
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.elastictranscoder.model;
import java.beans.Transient;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* The VideoParameters
structure.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class VideoParameters implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField CODEC_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Codec")
.getter(getter(VideoParameters::codec)).setter(setter(Builder::codec))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Codec").build()).build();
private static final SdkField> CODEC_OPTIONS_FIELD = SdkField
.> builder(MarshallingType.MAP)
.memberName("CodecOptions")
.getter(getter(VideoParameters::codecOptions))
.setter(setter(Builder::codecOptions))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CodecOptions").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField KEYFRAMES_MAX_DIST_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("KeyframesMaxDist").getter(getter(VideoParameters::keyframesMaxDist))
.setter(setter(Builder::keyframesMaxDist))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KeyframesMaxDist").build()).build();
private static final SdkField FIXED_GOP_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("FixedGOP").getter(getter(VideoParameters::fixedGOP)).setter(setter(Builder::fixedGOP))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FixedGOP").build()).build();
private static final SdkField BIT_RATE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("BitRate").getter(getter(VideoParameters::bitRate)).setter(setter(Builder::bitRate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BitRate").build()).build();
private static final SdkField FRAME_RATE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("FrameRate").getter(getter(VideoParameters::frameRate)).setter(setter(Builder::frameRate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FrameRate").build()).build();
private static final SdkField MAX_FRAME_RATE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("MaxFrameRate").getter(getter(VideoParameters::maxFrameRate)).setter(setter(Builder::maxFrameRate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaxFrameRate").build()).build();
private static final SdkField RESOLUTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Resolution").getter(getter(VideoParameters::resolution)).setter(setter(Builder::resolution))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Resolution").build()).build();
private static final SdkField ASPECT_RATIO_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("AspectRatio").getter(getter(VideoParameters::aspectRatio)).setter(setter(Builder::aspectRatio))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AspectRatio").build()).build();
private static final SdkField MAX_WIDTH_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("MaxWidth").getter(getter(VideoParameters::maxWidth)).setter(setter(Builder::maxWidth))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaxWidth").build()).build();
private static final SdkField MAX_HEIGHT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("MaxHeight").getter(getter(VideoParameters::maxHeight)).setter(setter(Builder::maxHeight))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaxHeight").build()).build();
private static final SdkField DISPLAY_ASPECT_RATIO_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DisplayAspectRatio").getter(getter(VideoParameters::displayAspectRatio))
.setter(setter(Builder::displayAspectRatio))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DisplayAspectRatio").build())
.build();
private static final SdkField SIZING_POLICY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SizingPolicy").getter(getter(VideoParameters::sizingPolicy)).setter(setter(Builder::sizingPolicy))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SizingPolicy").build()).build();
private static final SdkField PADDING_POLICY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("PaddingPolicy").getter(getter(VideoParameters::paddingPolicy)).setter(setter(Builder::paddingPolicy))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PaddingPolicy").build()).build();
private static final SdkField> WATERMARKS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Watermarks")
.getter(getter(VideoParameters::watermarks))
.setter(setter(Builder::watermarks))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Watermarks").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(PresetWatermark::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CODEC_FIELD,
CODEC_OPTIONS_FIELD, KEYFRAMES_MAX_DIST_FIELD, FIXED_GOP_FIELD, BIT_RATE_FIELD, FRAME_RATE_FIELD,
MAX_FRAME_RATE_FIELD, RESOLUTION_FIELD, ASPECT_RATIO_FIELD, MAX_WIDTH_FIELD, MAX_HEIGHT_FIELD,
DISPLAY_ASPECT_RATIO_FIELD, SIZING_POLICY_FIELD, PADDING_POLICY_FIELD, WATERMARKS_FIELD));
private static final long serialVersionUID = 1L;
private final String codec;
private final Map codecOptions;
private final String keyframesMaxDist;
private final String fixedGOP;
private final String bitRate;
private final String frameRate;
private final String maxFrameRate;
private final String resolution;
private final String aspectRatio;
private final String maxWidth;
private final String maxHeight;
private final String displayAspectRatio;
private final String sizingPolicy;
private final String paddingPolicy;
private final List watermarks;
private VideoParameters(BuilderImpl builder) {
this.codec = builder.codec;
this.codecOptions = builder.codecOptions;
this.keyframesMaxDist = builder.keyframesMaxDist;
this.fixedGOP = builder.fixedGOP;
this.bitRate = builder.bitRate;
this.frameRate = builder.frameRate;
this.maxFrameRate = builder.maxFrameRate;
this.resolution = builder.resolution;
this.aspectRatio = builder.aspectRatio;
this.maxWidth = builder.maxWidth;
this.maxHeight = builder.maxHeight;
this.displayAspectRatio = builder.displayAspectRatio;
this.sizingPolicy = builder.sizingPolicy;
this.paddingPolicy = builder.paddingPolicy;
this.watermarks = builder.watermarks;
}
/**
*
* The video codec for the output file. Valid values include gif
, H.264
,
* mpeg2
, vp8
, and vp9
. You can only specify vp8
and
* vp9
when the container type is webm
, gif
when the container type is
* gif
, and mpeg2
when the container type is mpg
.
*
*
* @return The video codec for the output file. Valid values include gif
, H.264
,
* mpeg2
, vp8
, and vp9
. You can only specify vp8
and
* vp9
when the container type is webm
, gif
when the container type
* is gif
, and mpeg2
when the container type is mpg
.
*/
public final String codec() {
return codec;
}
/**
* For responses, this returns true if the service returned a value for the CodecOptions property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasCodecOptions() {
return codecOptions != null && !(codecOptions instanceof SdkAutoConstructMap);
}
/**
*
* Profile (H.264/VP8/VP9 Only)
*
*
* The H.264 profile that you want to use for the output file. Elastic Transcoder supports the following profiles:
*
*
*
*
* baseline
: The profile most commonly used for videoconferencing and for mobile applications.
*
*
*
*
* main
: The profile used for standard-definition digital TV broadcasts.
*
*
*
*
* high
: The profile used for high-definition digital TV broadcasts and for Blu-ray discs.
*
*
*
*
* Level (H.264 Only)
*
*
* The H.264 level that you want to use for the output file. Elastic Transcoder supports the following levels:
*
*
* 1
, 1b
, 1.1
, 1.2
, 1.3
, 2
,
* 2.1
, 2.2
, 3
, 3.1
, 3.2
, 4
,
* 4.1
*
*
* MaxReferenceFrames (H.264 Only)
*
*
* Applicable only when the value of Video:Codec is H.264. The maximum number of previously decoded frames to use as
* a reference for decoding future frames. Valid values are integers 0 through 16, but we recommend that you not use
* a value greater than the following:
*
*
* Min(Floor(Maximum decoded picture buffer in macroblocks * 256 / (Width in pixels * Height in pixels)), 16)
*
*
* where Width in pixels and Height in pixels represent either MaxWidth and MaxHeight, or Resolution.
* Maximum decoded picture buffer in macroblocks depends on the value of the Level
object. See
* the list below. (A macroblock is a block of pixels measuring 16x16.)
*
*
*
*
* 1 - 396
*
*
*
*
* 1b - 396
*
*
*
*
* 1.1 - 900
*
*
*
*
* 1.2 - 2376
*
*
*
*
* 1.3 - 2376
*
*
*
*
* 2 - 2376
*
*
*
*
* 2.1 - 4752
*
*
*
*
* 2.2 - 8100
*
*
*
*
* 3 - 8100
*
*
*
*
* 3.1 - 18000
*
*
*
*
* 3.2 - 20480
*
*
*
*
* 4 - 32768
*
*
*
*
* 4.1 - 32768
*
*
*
*
* MaxBitRate (Optional, H.264/MPEG2/VP8/VP9 only)
*
*
* The maximum number of bits per second in a video buffer; the size of the buffer is specified by
* BufferSize
. Specify a value between 16 and 62,500. You can reduce the bandwidth required to stream a
* video by reducing the maximum bit rate, but this also reduces the quality of the video.
*
*
* BufferSize (Optional, H.264/MPEG2/VP8/VP9 only)
*
*
* The maximum number of bits in any x seconds of the output video. This window is commonly 10 seconds, the standard
* segment duration when you're using FMP4 or MPEG-TS for the container type of the output video. Specify an integer
* greater than 0. If you specify MaxBitRate
and omit BufferSize
, Elastic Transcoder sets
* BufferSize
to 10 times the value of MaxBitRate
.
*
*
* InterlacedMode (Optional, H.264/MPEG2 Only)
*
*
* The interlace mode for the output video.
*
*
* Interlaced video is used to double the perceived frame rate for a video by interlacing two fields (one field on
* every other line, the other field on the other lines) so that the human eye registers multiple pictures per
* frame. Interlacing reduces the bandwidth required for transmitting a video, but can result in blurred images and
* flickering.
*
*
* Valid values include Progressive
(no interlacing, top to bottom), TopFirst
(top field
* first), BottomFirst
(bottom field first), and Auto
.
*
*
* If InterlaceMode
is not specified, Elastic Transcoder uses Progressive
for the output.
* If Auto
is specified, Elastic Transcoder interlaces the output.
*
*
* ColorSpaceConversionMode (Optional, H.264/MPEG2 Only)
*
*
* The color space conversion Elastic Transcoder applies to the output video. Color spaces are the algorithms used
* by the computer to store information about how to render color. Bt.601
is the standard for standard
* definition video, while Bt.709
is the standard for high definition video.
*
*
* Valid values include None
, Bt709toBt601
, Bt601toBt709
, and
* Auto
.
*
*
* If you chose Auto
for ColorSpaceConversionMode
and your output is interlaced, your
* frame rate is one of 23.97
, 24
, 25
, 29.97
, 50
,
* or 60
, your SegmentDuration
is null, and you are using one of the resolution changes
* from the list below, Elastic Transcoder applies the following color space conversions:
*
*
*
*
* Standard to HD, 720x480 to 1920x1080 - Elastic Transcoder applies Bt601ToBt709
*
*
*
*
* Standard to HD, 720x576 to 1920x1080 - Elastic Transcoder applies Bt601ToBt709
*
*
*
*
* HD to Standard, 1920x1080 to 720x480 - Elastic Transcoder applies Bt709ToBt601
*
*
*
*
* HD to Standard, 1920x1080 to 720x576 - Elastic Transcoder applies Bt709ToBt601
*
*
*
*
*
* Elastic Transcoder may change the behavior of the ColorspaceConversionMode
Auto
mode in
* the future. All outputs in a playlist must use the same ColorSpaceConversionMode
.
*
*
*
* If you do not specify a ColorSpaceConversionMode
, Elastic Transcoder does not change the color space
* of a file. If you are unsure what ColorSpaceConversionMode
was applied to your output file, you can
* check the AppliedColorSpaceConversion
parameter included in your job response. If your job does not
* have an AppliedColorSpaceConversion
in its response, no ColorSpaceConversionMode
was
* applied.
*
*
* ChromaSubsampling
*
*
* The sampling pattern for the chroma (color) channels of the output video. Valid values include
* yuv420p
and yuv422p
.
*
*
* yuv420p
samples the chroma information of every other horizontal and every other vertical line,
* yuv422p
samples the color information of every horizontal line and every other vertical line.
*
*
* LoopCount (Gif Only)
*
*
* The number of times you want the output gif to loop. Valid values include Infinite
and integers
* between 0
and 100
, inclusive.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasCodecOptions} method.
*
*
* @return Profile (H.264/VP8/VP9 Only)
*
* The H.264 profile that you want to use for the output file. Elastic Transcoder supports the following
* profiles:
*
*
*
*
* baseline
: The profile most commonly used for videoconferencing and for mobile applications.
*
*
*
*
* main
: The profile used for standard-definition digital TV broadcasts.
*
*
*
*
* high
: The profile used for high-definition digital TV broadcasts and for Blu-ray discs.
*
*
*
*
* Level (H.264 Only)
*
*
* The H.264 level that you want to use for the output file. Elastic Transcoder supports the following
* levels:
*
*
* 1
, 1b
, 1.1
, 1.2
, 1.3
, 2
,
* 2.1
, 2.2
, 3
, 3.1
, 3.2
, 4
,
* 4.1
*
*
* MaxReferenceFrames (H.264 Only)
*
*
* Applicable only when the value of Video:Codec is H.264. The maximum number of previously decoded frames
* to use as a reference for decoding future frames. Valid values are integers 0 through 16, but we
* recommend that you not use a value greater than the following:
*
*
* Min(Floor(Maximum decoded picture buffer in macroblocks * 256 / (Width in pixels * Height in pixels)), 16)
*
*
* where Width in pixels and Height in pixels represent either MaxWidth and MaxHeight, or
* Resolution. Maximum decoded picture buffer in macroblocks depends on the value of the
* Level
object. See the list below. (A macroblock is a block of pixels measuring 16x16.)
*
*
*
*
* 1 - 396
*
*
*
*
* 1b - 396
*
*
*
*
* 1.1 - 900
*
*
*
*
* 1.2 - 2376
*
*
*
*
* 1.3 - 2376
*
*
*
*
* 2 - 2376
*
*
*
*
* 2.1 - 4752
*
*
*
*
* 2.2 - 8100
*
*
*
*
* 3 - 8100
*
*
*
*
* 3.1 - 18000
*
*
*
*
* 3.2 - 20480
*
*
*
*
* 4 - 32768
*
*
*
*
* 4.1 - 32768
*
*
*
*
* MaxBitRate (Optional, H.264/MPEG2/VP8/VP9 only)
*
*
* The maximum number of bits per second in a video buffer; the size of the buffer is specified by
* BufferSize
. Specify a value between 16 and 62,500. You can reduce the bandwidth required to
* stream a video by reducing the maximum bit rate, but this also reduces the quality of the video.
*
*
* BufferSize (Optional, H.264/MPEG2/VP8/VP9 only)
*
*
* The maximum number of bits in any x seconds of the output video. This window is commonly 10 seconds, the
* standard segment duration when you're using FMP4 or MPEG-TS for the container type of the output video.
* Specify an integer greater than 0. If you specify MaxBitRate
and omit
* BufferSize
, Elastic Transcoder sets BufferSize
to 10 times the value of
* MaxBitRate
.
*
*
* InterlacedMode (Optional, H.264/MPEG2 Only)
*
*
* The interlace mode for the output video.
*
*
* Interlaced video is used to double the perceived frame rate for a video by interlacing two fields (one
* field on every other line, the other field on the other lines) so that the human eye registers multiple
* pictures per frame. Interlacing reduces the bandwidth required for transmitting a video, but can result
* in blurred images and flickering.
*
*
* Valid values include Progressive
(no interlacing, top to bottom), TopFirst
(top
* field first), BottomFirst
(bottom field first), and Auto
.
*
*
* If InterlaceMode
is not specified, Elastic Transcoder uses Progressive
for the
* output. If Auto
is specified, Elastic Transcoder interlaces the output.
*
*
* ColorSpaceConversionMode (Optional, H.264/MPEG2 Only)
*
*
* The color space conversion Elastic Transcoder applies to the output video. Color spaces are the
* algorithms used by the computer to store information about how to render color. Bt.601
is
* the standard for standard definition video, while Bt.709
is the standard for high definition
* video.
*
*
* Valid values include None
, Bt709toBt601
, Bt601toBt709
, and
* Auto
.
*
*
* If you chose Auto
for ColorSpaceConversionMode
and your output is interlaced,
* your frame rate is one of 23.97
, 24
, 25
, 29.97
,
* 50
, or 60
, your SegmentDuration
is null, and you are using one of
* the resolution changes from the list below, Elastic Transcoder applies the following color space
* conversions:
*
*
*
*
* Standard to HD, 720x480 to 1920x1080 - Elastic Transcoder applies Bt601ToBt709
*
*
*
*
* Standard to HD, 720x576 to 1920x1080 - Elastic Transcoder applies Bt601ToBt709
*
*
*
*
* HD to Standard, 1920x1080 to 720x480 - Elastic Transcoder applies Bt709ToBt601
*
*
*
*
* HD to Standard, 1920x1080 to 720x576 - Elastic Transcoder applies Bt709ToBt601
*
*
*
*
*
* Elastic Transcoder may change the behavior of the ColorspaceConversionMode
Auto
* mode in the future. All outputs in a playlist must use the same ColorSpaceConversionMode
.
*
*
*
* If you do not specify a ColorSpaceConversionMode
, Elastic Transcoder does not change the
* color space of a file. If you are unsure what ColorSpaceConversionMode
was applied to your
* output file, you can check the AppliedColorSpaceConversion
parameter included in your job
* response. If your job does not have an AppliedColorSpaceConversion
in its response, no
* ColorSpaceConversionMode
was applied.
*
*
* ChromaSubsampling
*
*
* The sampling pattern for the chroma (color) channels of the output video. Valid values include
* yuv420p
and yuv422p
.
*
*
* yuv420p
samples the chroma information of every other horizontal and every other vertical
* line, yuv422p
samples the color information of every horizontal line and every other
* vertical line.
*
*
* LoopCount (Gif Only)
*
*
* The number of times you want the output gif to loop. Valid values include Infinite
and
* integers between 0
and 100
, inclusive.
*/
public final Map codecOptions() {
return codecOptions;
}
/**
*
* Applicable only when the value of Video:Codec is one of H.264
, MPEG2
, or
* VP8
.
*
*
* The maximum number of frames between key frames. Key frames are fully encoded frames; the frames between key
* frames are encoded based, in part, on the content of the key frames. The value is an integer formatted as a
* string; valid values are between 1 (every frame is a key frame) and 100000, inclusive. A higher value results in
* higher compression but may also discernibly decrease video quality.
*
*
* For Smooth
outputs, the FrameRate
must have a constant ratio to the
* KeyframesMaxDist
. This allows Smooth
playlists to switch between different quality
* levels while the file is being played.
*
*
* For example, an input file can have a FrameRate
of 30 with a KeyframesMaxDist
of 90.
* The output file then needs to have a ratio of 1:3. Valid outputs would have FrameRate
of 30, 25, and
* 10, and KeyframesMaxDist
of 90, 75, and 30, respectively.
*
*
* Alternately, this can be achieved by setting FrameRate
to auto and having the same values for
* MaxFrameRate
and KeyframesMaxDist
.
*
*
* @return Applicable only when the value of Video:Codec is one of H.264
, MPEG2
, or
* VP8
.
*
* The maximum number of frames between key frames. Key frames are fully encoded frames; the frames between
* key frames are encoded based, in part, on the content of the key frames. The value is an integer
* formatted as a string; valid values are between 1 (every frame is a key frame) and 100000, inclusive. A
* higher value results in higher compression but may also discernibly decrease video quality.
*
*
* For Smooth
outputs, the FrameRate
must have a constant ratio to the
* KeyframesMaxDist
. This allows Smooth
playlists to switch between different
* quality levels while the file is being played.
*
*
* For example, an input file can have a FrameRate
of 30 with a KeyframesMaxDist
* of 90. The output file then needs to have a ratio of 1:3. Valid outputs would have FrameRate
* of 30, 25, and 10, and KeyframesMaxDist
of 90, 75, and 30, respectively.
*
*
* Alternately, this can be achieved by setting FrameRate
to auto and having the same values
* for MaxFrameRate
and KeyframesMaxDist
.
*/
public final String keyframesMaxDist() {
return keyframesMaxDist;
}
/**
*
* Applicable only when the value of Video:Codec is one of H.264
, MPEG2
, or
* VP8
.
*
*
* Whether to use a fixed value for FixedGOP
. Valid values are true
and false
* :
*
*
*
*
* true
: Elastic Transcoder uses the value of KeyframesMaxDist
for the distance between
* key frames (the number of frames in a group of pictures, or GOP).
*
*
*
*
* false
: The distance between key frames can vary.
*
*
*
*
*
* FixedGOP
must be set to true
for fmp4
containers.
*
*
*
* @return Applicable only when the value of Video:Codec is one of H.264
, MPEG2
, or
* VP8
.
*
* Whether to use a fixed value for FixedGOP
. Valid values are true
and
* false
:
*
*
*
*
* true
: Elastic Transcoder uses the value of KeyframesMaxDist
for the distance
* between key frames (the number of frames in a group of pictures, or GOP).
*
*
*
*
* false
: The distance between key frames can vary.
*
*
*
*
*
* FixedGOP
must be set to true
for fmp4
containers.
*
*/
public final String fixedGOP() {
return fixedGOP;
}
/**
*
* The bit rate of the video stream in the output file, in kilobits/second. Valid values depend on the values of
* Level
and Profile
. If you specify auto
, Elastic Transcoder uses the
* detected bit rate of the input source. If you specify a value other than auto
, we recommend that you
* specify a value less than or equal to the maximum H.264-compliant value listed for your level and profile:
*
*
* Level - Maximum video bit rate in kilobits/second (baseline and main Profile) : maximum video bit rate in
* kilobits/second (high Profile)
*
*
*
*
* 1 - 64 : 80
*
*
*
*
* 1b - 128 : 160
*
*
*
*
* 1.1 - 192 : 240
*
*
*
*
* 1.2 - 384 : 480
*
*
*
*
* 1.3 - 768 : 960
*
*
*
*
* 2 - 2000 : 2500
*
*
*
*
* 3 - 10000 : 12500
*
*
*
*
* 3.1 - 14000 : 17500
*
*
*
*
* 3.2 - 20000 : 25000
*
*
*
*
* 4 - 20000 : 25000
*
*
*
*
* 4.1 - 50000 : 62500
*
*
*
*
* @return The bit rate of the video stream in the output file, in kilobits/second. Valid values depend on the
* values of Level
and Profile
. If you specify auto
, Elastic
* Transcoder uses the detected bit rate of the input source. If you specify a value other than
* auto
, we recommend that you specify a value less than or equal to the maximum
* H.264-compliant value listed for your level and profile:
*
* Level - Maximum video bit rate in kilobits/second (baseline and main Profile) : maximum video bit rate
* in kilobits/second (high Profile)
*
*
*
*
* 1 - 64 : 80
*
*
*
*
* 1b - 128 : 160
*
*
*
*
* 1.1 - 192 : 240
*
*
*
*
* 1.2 - 384 : 480
*
*
*
*
* 1.3 - 768 : 960
*
*
*
*
* 2 - 2000 : 2500
*
*
*
*
* 3 - 10000 : 12500
*
*
*
*
* 3.1 - 14000 : 17500
*
*
*
*
* 3.2 - 20000 : 25000
*
*
*
*
* 4 - 20000 : 25000
*
*
*
*
* 4.1 - 50000 : 62500
*
*
*/
public final String bitRate() {
return bitRate;
}
/**
*
* The frames per second for the video stream in the output file. Valid values include:
*
*
* auto
, 10
, 15
, 23.97
, 24
, 25
,
* 29.97
, 30
, 60
*
*
* If you specify auto
, Elastic Transcoder uses the detected frame rate of the input source. If you
* specify a frame rate, we recommend that you perform the following calculation:
*
*
* Frame rate = maximum recommended decoding speed in luma samples/second / (width in pixels * height in pixels)
*
*
* where:
*
*
*
*
* width in pixels and height in pixels represent the Resolution of the output video.
*
*
*
*
* maximum recommended decoding speed in Luma samples/second is less than or equal to the maximum value
* listed in the following table, based on the value that you specified for Level.
*
*
*
*
* The maximum recommended decoding speed in Luma samples/second for each level is described in the following list
* (Level - Decoding speed ):
*
*
*
*
* 1 - 380160
*
*
*
*
* 1b - 380160
*
*
*
*
* 1.1 - 76800
*
*
*
*
* 1.2 - 1536000
*
*
*
*
* 1.3 - 3041280
*
*
*
*
* 2 - 3041280
*
*
*
*
* 2.1 - 5068800
*
*
*
*
* 2.2 - 5184000
*
*
*
*
* 3 - 10368000
*
*
*
*
* 3.1 - 27648000
*
*
*
*
* 3.2 - 55296000
*
*
*
*
* 4 - 62914560
*
*
*
*
* 4.1 - 62914560
*
*
*
*
* @return The frames per second for the video stream in the output file. Valid values include:
*
* auto
, 10
, 15
, 23.97
, 24
, 25
, 29.97
, 30
, 60
*
*
* If you specify auto
, Elastic Transcoder uses the detected frame rate of the input source. If
* you specify a frame rate, we recommend that you perform the following calculation:
*
*
* Frame rate = maximum recommended decoding speed in luma samples/second / (width in pixels * height in pixels)
*
*
* where:
*
*
*
*
* width in pixels and height in pixels represent the Resolution of the output video.
*
*
*
*
* maximum recommended decoding speed in Luma samples/second is less than or equal to the maximum
* value listed in the following table, based on the value that you specified for Level.
*
*
*
*
* The maximum recommended decoding speed in Luma samples/second for each level is described in the
* following list (Level - Decoding speed ):
*
*
*
*
* 1 - 380160
*
*
*
*
* 1b - 380160
*
*
*
*
* 1.1 - 76800
*
*
*
*
* 1.2 - 1536000
*
*
*
*
* 1.3 - 3041280
*
*
*
*
* 2 - 3041280
*
*
*
*
* 2.1 - 5068800
*
*
*
*
* 2.2 - 5184000
*
*
*
*
* 3 - 10368000
*
*
*
*
* 3.1 - 27648000
*
*
*
*
* 3.2 - 55296000
*
*
*
*
* 4 - 62914560
*
*
*
*
* 4.1 - 62914560
*
*
*/
public final String frameRate() {
return frameRate;
}
/**
*
* If you specify auto
for FrameRate
, Elastic Transcoder uses the frame rate of the input
* video for the frame rate of the output video. Specify the maximum frame rate that you want Elastic Transcoder to
* use when the frame rate of the input video is greater than the desired maximum frame rate of the output video.
* Valid values include: 10
, 15
, 23.97
, 24
, 25
,
* 29.97
, 30
, 60
.
*
*
* @return If you specify auto
for FrameRate
, Elastic Transcoder uses the frame rate of
* the input video for the frame rate of the output video. Specify the maximum frame rate that you want
* Elastic Transcoder to use when the frame rate of the input video is greater than the desired maximum
* frame rate of the output video. Valid values include: 10
, 15
,
* 23.97
, 24
, 25
, 29.97
, 30
,
* 60
.
*/
public final String maxFrameRate() {
return maxFrameRate;
}
/**
*
*
* To better control resolution and aspect ratio of output videos, we recommend that you use the values
* MaxWidth
, MaxHeight
, SizingPolicy
, PaddingPolicy
, and
* DisplayAspectRatio
instead of Resolution
and AspectRatio
. The two groups
* of settings are mutually exclusive. Do not use them together.
*
*
*
* The width and height of the video in the output file, in pixels. Valid values are auto
and
* width x height :
*
*
*
*
* auto
: Elastic Transcoder attempts to preserve the width and height of the input file, subject to the
* following rules.
*
*
*
*
* width x height
: The width and height of the output video in pixels.
*
*
*
*
* Note the following about specifying the width and height:
*
*
*
*
* The width must be an even integer between 128 and 4096, inclusive.
*
*
*
*
* The height must be an even integer between 96 and 3072, inclusive.
*
*
*
*
* If you specify a resolution that is less than the resolution of the input file, Elastic Transcoder rescales the
* output file to the lower resolution.
*
*
*
*
* If you specify a resolution that is greater than the resolution of the input file, Elastic Transcoder rescales
* the output to the higher resolution.
*
*
*
*
* We recommend that you specify a resolution for which the product of width and height is less than or equal to the
* applicable value in the following list (List - Max width x height value ):
*
*
*
*
* 1 - 25344
*
*
*
*
* 1b - 25344
*
*
*
*
* 1.1 - 101376
*
*
*
*
* 1.2 - 101376
*
*
*
*
* 1.3 - 101376
*
*
*
*
* 2 - 101376
*
*
*
*
* 2.1 - 202752
*
*
*
*
* 2.2 - 404720
*
*
*
*
* 3 - 404720
*
*
*
*
* 3.1 - 921600
*
*
*
*
* 3.2 - 1310720
*
*
*
*
* 4 - 2097152
*
*
*
*
* 4.1 - 2097152
*
*
*
*
*
*
* @return
* To better control resolution and aspect ratio of output videos, we recommend that you use the values
* MaxWidth
, MaxHeight
, SizingPolicy
, PaddingPolicy
, and
* DisplayAspectRatio
instead of Resolution
and AspectRatio
. The two
* groups of settings are mutually exclusive. Do not use them together.
*
*
*
* The width and height of the video in the output file, in pixels. Valid values are auto
and
* width x height :
*
*
*
*
* auto
: Elastic Transcoder attempts to preserve the width and height of the input file,
* subject to the following rules.
*
*
*
*
* width x height
: The width and height of the output video in pixels.
*
*
*
*
* Note the following about specifying the width and height:
*
*
*
*
* The width must be an even integer between 128 and 4096, inclusive.
*
*
*
*
* The height must be an even integer between 96 and 3072, inclusive.
*
*
*
*
* If you specify a resolution that is less than the resolution of the input file, Elastic Transcoder
* rescales the output file to the lower resolution.
*
*
*
*
* If you specify a resolution that is greater than the resolution of the input file, Elastic Transcoder
* rescales the output to the higher resolution.
*
*
*
*
* We recommend that you specify a resolution for which the product of width and height is less than or
* equal to the applicable value in the following list (List - Max width x height value ):
*
*
*
*
* 1 - 25344
*
*
*
*
* 1b - 25344
*
*
*
*
* 1.1 - 101376
*
*
*
*
* 1.2 - 101376
*
*
*
*
* 1.3 - 101376
*
*
*
*
* 2 - 101376
*
*
*
*
* 2.1 - 202752
*
*
*
*
* 2.2 - 404720
*
*
*
*
* 3 - 404720
*
*
*
*
* 3.1 - 921600
*
*
*
*
* 3.2 - 1310720
*
*
*
*
* 4 - 2097152
*
*
*
*
* 4.1 - 2097152
*
*
*
*
*/
public final String resolution() {
return resolution;
}
/**
*
*
* To better control resolution and aspect ratio of output videos, we recommend that you use the values
* MaxWidth
, MaxHeight
, SizingPolicy
, PaddingPolicy
, and
* DisplayAspectRatio
instead of Resolution
and AspectRatio
. The two groups
* of settings are mutually exclusive. Do not use them together.
*
*
*
* The display aspect ratio of the video in the output file. Valid values include:
*
*
* auto
, 1:1
, 4:3
, 3:2
, 16:9
*
*
* If you specify auto
, Elastic Transcoder tries to preserve the aspect ratio of the input file.
*
*
* If you specify an aspect ratio for the output file that differs from aspect ratio of the input file, Elastic
* Transcoder adds pillarboxing (black bars on the sides) or letterboxing (black bars on the top and bottom) to
* maintain the aspect ratio of the active region of the video.
*
*
* @return
* To better control resolution and aspect ratio of output videos, we recommend that you use the values
* MaxWidth
, MaxHeight
, SizingPolicy
, PaddingPolicy
, and
* DisplayAspectRatio
instead of Resolution
and AspectRatio
. The two
* groups of settings are mutually exclusive. Do not use them together.
*
*
*
* The display aspect ratio of the video in the output file. Valid values include:
*
*
* auto
, 1:1
, 4:3
, 3:2
, 16:9
*
*
* If you specify auto
, Elastic Transcoder tries to preserve the aspect ratio of the input
* file.
*
*
* If you specify an aspect ratio for the output file that differs from aspect ratio of the input file,
* Elastic Transcoder adds pillarboxing (black bars on the sides) or letterboxing (black bars on the top and
* bottom) to maintain the aspect ratio of the active region of the video.
*/
public final String aspectRatio() {
return aspectRatio;
}
/**
*
* The maximum width of the output video in pixels. If you specify auto
, Elastic Transcoder uses 1920
* (Full HD) as the default value. If you specify a numeric value, enter an even integer between 128 and 4096.
*
*
* @return The maximum width of the output video in pixels. If you specify auto
, Elastic Transcoder
* uses 1920 (Full HD) as the default value. If you specify a numeric value, enter an even integer between
* 128 and 4096.
*/
public final String maxWidth() {
return maxWidth;
}
/**
*
* The maximum height of the output video in pixels. If you specify auto
, Elastic Transcoder uses 1080
* (Full HD) as the default value. If you specify a numeric value, enter an even integer between 96 and 3072.
*
*
* @return The maximum height of the output video in pixels. If you specify auto
, Elastic Transcoder
* uses 1080 (Full HD) as the default value. If you specify a numeric value, enter an even integer between
* 96 and 3072.
*/
public final String maxHeight() {
return maxHeight;
}
/**
*
* The value that Elastic Transcoder adds to the metadata in the output file.
*
*
* @return The value that Elastic Transcoder adds to the metadata in the output file.
*/
public final String displayAspectRatio() {
return displayAspectRatio;
}
/**
*
* Specify one of the following values to control scaling of the output video:
*
*
*
*
* Fit
: Elastic Transcoder scales the output video so it matches the value that you specified in either
* MaxWidth
or MaxHeight
without exceeding the other value.
*
*
*
*
* Fill
: Elastic Transcoder scales the output video so it matches the value that you specified in
* either MaxWidth
or MaxHeight
and matches or exceeds the other value. Elastic Transcoder
* centers the output video and then crops it in the dimension (if any) that exceeds the maximum value.
*
*
*
*
* Stretch
: Elastic Transcoder stretches the output video to match the values that you specified for
* MaxWidth
and MaxHeight
. If the relative proportions of the input video and the output
* video are different, the output video will be distorted.
*
*
*
*
* Keep
: Elastic Transcoder does not scale the output video. If either dimension of the input video
* exceeds the values that you specified for MaxWidth
and MaxHeight
, Elastic Transcoder
* crops the output video.
*
*
*
*
* ShrinkToFit
: Elastic Transcoder scales the output video down so that its dimensions match the values
* that you specified for at least one of MaxWidth
and MaxHeight
without exceeding either
* value. If you specify this option, Elastic Transcoder does not scale the video up.
*
*
*
*
* ShrinkToFill
: Elastic Transcoder scales the output video down so that its dimensions match the
* values that you specified for at least one of MaxWidth
and MaxHeight
without dropping
* below either value. If you specify this option, Elastic Transcoder does not scale the video up.
*
*
*
*
* @return Specify one of the following values to control scaling of the output video:
*
*
*
* Fit
: Elastic Transcoder scales the output video so it matches the value that you specified
* in either MaxWidth
or MaxHeight
without exceeding the other value.
*
*
*
*
* Fill
: Elastic Transcoder scales the output video so it matches the value that you specified
* in either MaxWidth
or MaxHeight
and matches or exceeds the other value. Elastic
* Transcoder centers the output video and then crops it in the dimension (if any) that exceeds the maximum
* value.
*
*
*
*
* Stretch
: Elastic Transcoder stretches the output video to match the values that you
* specified for MaxWidth
and MaxHeight
. If the relative proportions of the input
* video and the output video are different, the output video will be distorted.
*
*
*
*
* Keep
: Elastic Transcoder does not scale the output video. If either dimension of the input
* video exceeds the values that you specified for MaxWidth
and MaxHeight
, Elastic
* Transcoder crops the output video.
*
*
*
*
* ShrinkToFit
: Elastic Transcoder scales the output video down so that its dimensions match
* the values that you specified for at least one of MaxWidth
and MaxHeight
* without exceeding either value. If you specify this option, Elastic Transcoder does not scale the video
* up.
*
*
*
*
* ShrinkToFill
: Elastic Transcoder scales the output video down so that its dimensions match
* the values that you specified for at least one of MaxWidth
and MaxHeight
* without dropping below either value. If you specify this option, Elastic Transcoder does not scale the
* video up.
*
*
*/
public final String sizingPolicy() {
return sizingPolicy;
}
/**
*
* When you set PaddingPolicy
to Pad
, Elastic Transcoder may add black bars to the top and
* bottom and/or left and right sides of the output video to make the total size of the output video match the
* values that you specified for MaxWidth
and MaxHeight
.
*
*
* @return When you set PaddingPolicy
to Pad
, Elastic Transcoder may add black bars to the
* top and bottom and/or left and right sides of the output video to make the total size of the output video
* match the values that you specified for MaxWidth
and MaxHeight
.
*/
public final String paddingPolicy() {
return paddingPolicy;
}
/**
* For responses, this returns true if the service returned a value for the Watermarks property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasWatermarks() {
return watermarks != null && !(watermarks instanceof SdkAutoConstructList);
}
/**
*
* Settings for the size, location, and opacity of graphics that you want Elastic Transcoder to overlay over videos
* that are transcoded using this preset. You can specify settings for up to four watermarks. Watermarks appear in
* the specified size and location, and with the specified opacity for the duration of the transcoded video.
*
*
* Watermarks can be in .png or .jpg format. If you want to display a watermark that is not rectangular, use the
* .png format, which supports transparency.
*
*
* When you create a job that uses this preset, you specify the .png or .jpg graphics that you want Elastic
* Transcoder to include in the transcoded videos. You can specify fewer graphics in the job than you specify
* watermark settings in the preset, which allows you to use the same preset for up to four watermarks that have
* different dimensions.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasWatermarks} method.
*
*
* @return Settings for the size, location, and opacity of graphics that you want Elastic Transcoder to overlay over
* videos that are transcoded using this preset. You can specify settings for up to four watermarks.
* Watermarks appear in the specified size and location, and with the specified opacity for the duration of
* the transcoded video.
*
* Watermarks can be in .png or .jpg format. If you want to display a watermark that is not rectangular, use
* the .png format, which supports transparency.
*
*
* When you create a job that uses this preset, you specify the .png or .jpg graphics that you want Elastic
* Transcoder to include in the transcoded videos. You can specify fewer graphics in the job than you
* specify watermark settings in the preset, which allows you to use the same preset for up to four
* watermarks that have different dimensions.
*/
public final List watermarks() {
return watermarks;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(codec());
hashCode = 31 * hashCode + Objects.hashCode(hasCodecOptions() ? codecOptions() : null);
hashCode = 31 * hashCode + Objects.hashCode(keyframesMaxDist());
hashCode = 31 * hashCode + Objects.hashCode(fixedGOP());
hashCode = 31 * hashCode + Objects.hashCode(bitRate());
hashCode = 31 * hashCode + Objects.hashCode(frameRate());
hashCode = 31 * hashCode + Objects.hashCode(maxFrameRate());
hashCode = 31 * hashCode + Objects.hashCode(resolution());
hashCode = 31 * hashCode + Objects.hashCode(aspectRatio());
hashCode = 31 * hashCode + Objects.hashCode(maxWidth());
hashCode = 31 * hashCode + Objects.hashCode(maxHeight());
hashCode = 31 * hashCode + Objects.hashCode(displayAspectRatio());
hashCode = 31 * hashCode + Objects.hashCode(sizingPolicy());
hashCode = 31 * hashCode + Objects.hashCode(paddingPolicy());
hashCode = 31 * hashCode + Objects.hashCode(hasWatermarks() ? watermarks() : null);
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof VideoParameters)) {
return false;
}
VideoParameters other = (VideoParameters) obj;
return Objects.equals(codec(), other.codec()) && hasCodecOptions() == other.hasCodecOptions()
&& Objects.equals(codecOptions(), other.codecOptions())
&& Objects.equals(keyframesMaxDist(), other.keyframesMaxDist()) && Objects.equals(fixedGOP(), other.fixedGOP())
&& Objects.equals(bitRate(), other.bitRate()) && Objects.equals(frameRate(), other.frameRate())
&& Objects.equals(maxFrameRate(), other.maxFrameRate()) && Objects.equals(resolution(), other.resolution())
&& Objects.equals(aspectRatio(), other.aspectRatio()) && Objects.equals(maxWidth(), other.maxWidth())
&& Objects.equals(maxHeight(), other.maxHeight())
&& Objects.equals(displayAspectRatio(), other.displayAspectRatio())
&& Objects.equals(sizingPolicy(), other.sizingPolicy()) && Objects.equals(paddingPolicy(), other.paddingPolicy())
&& hasWatermarks() == other.hasWatermarks() && Objects.equals(watermarks(), other.watermarks());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("VideoParameters").add("Codec", codec())
.add("CodecOptions", hasCodecOptions() ? codecOptions() : null).add("KeyframesMaxDist", keyframesMaxDist())
.add("FixedGOP", fixedGOP()).add("BitRate", bitRate()).add("FrameRate", frameRate())
.add("MaxFrameRate", maxFrameRate()).add("Resolution", resolution()).add("AspectRatio", aspectRatio())
.add("MaxWidth", maxWidth()).add("MaxHeight", maxHeight()).add("DisplayAspectRatio", displayAspectRatio())
.add("SizingPolicy", sizingPolicy()).add("PaddingPolicy", paddingPolicy())
.add("Watermarks", hasWatermarks() ? watermarks() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Codec":
return Optional.ofNullable(clazz.cast(codec()));
case "CodecOptions":
return Optional.ofNullable(clazz.cast(codecOptions()));
case "KeyframesMaxDist":
return Optional.ofNullable(clazz.cast(keyframesMaxDist()));
case "FixedGOP":
return Optional.ofNullable(clazz.cast(fixedGOP()));
case "BitRate":
return Optional.ofNullable(clazz.cast(bitRate()));
case "FrameRate":
return Optional.ofNullable(clazz.cast(frameRate()));
case "MaxFrameRate":
return Optional.ofNullable(clazz.cast(maxFrameRate()));
case "Resolution":
return Optional.ofNullable(clazz.cast(resolution()));
case "AspectRatio":
return Optional.ofNullable(clazz.cast(aspectRatio()));
case "MaxWidth":
return Optional.ofNullable(clazz.cast(maxWidth()));
case "MaxHeight":
return Optional.ofNullable(clazz.cast(maxHeight()));
case "DisplayAspectRatio":
return Optional.ofNullable(clazz.cast(displayAspectRatio()));
case "SizingPolicy":
return Optional.ofNullable(clazz.cast(sizingPolicy()));
case "PaddingPolicy":
return Optional.ofNullable(clazz.cast(paddingPolicy()));
case "Watermarks":
return Optional.ofNullable(clazz.cast(watermarks()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((VideoParameters) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder {
/**
*
* The video codec for the output file. Valid values include gif
, H.264
,
* mpeg2
, vp8
, and vp9
. You can only specify vp8
and
* vp9
when the container type is webm
, gif
when the container type is
* gif
, and mpeg2
when the container type is mpg
.
*
*
* @param codec
* The video codec for the output file. Valid values include gif
, H.264
,
* mpeg2
, vp8
, and vp9
. You can only specify vp8
and
* vp9
when the container type is webm
, gif
when the container
* type is gif
, and mpeg2
when the container type is mpg
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder codec(String codec);
/**
*
* Profile (H.264/VP8/VP9 Only)
*
*
* The H.264 profile that you want to use for the output file. Elastic Transcoder supports the following
* profiles:
*
*
*
*
* baseline
: The profile most commonly used for videoconferencing and for mobile applications.
*
*
*
*
* main
: The profile used for standard-definition digital TV broadcasts.
*
*
*
*
* high
: The profile used for high-definition digital TV broadcasts and for Blu-ray discs.
*
*
*
*
* Level (H.264 Only)
*
*
* The H.264 level that you want to use for the output file. Elastic Transcoder supports the following levels:
*
*
* 1
, 1b
, 1.1
, 1.2
, 1.3
, 2
,
* 2.1
, 2.2
, 3
, 3.1
, 3.2
, 4
,
* 4.1
*
*
* MaxReferenceFrames (H.264 Only)
*
*
* Applicable only when the value of Video:Codec is H.264. The maximum number of previously decoded frames to
* use as a reference for decoding future frames. Valid values are integers 0 through 16, but we recommend that
* you not use a value greater than the following:
*
*
* Min(Floor(Maximum decoded picture buffer in macroblocks * 256 / (Width in pixels * Height in pixels)), 16)
*
*
* where Width in pixels and Height in pixels represent either MaxWidth and MaxHeight, or
* Resolution. Maximum decoded picture buffer in macroblocks depends on the value of the
* Level
object. See the list below. (A macroblock is a block of pixels measuring 16x16.)
*
*
*
*
* 1 - 396
*
*
*
*
* 1b - 396
*
*
*
*
* 1.1 - 900
*
*
*
*
* 1.2 - 2376
*
*
*
*
* 1.3 - 2376
*
*
*
*
* 2 - 2376
*
*
*
*
* 2.1 - 4752
*
*
*
*
* 2.2 - 8100
*
*
*
*
* 3 - 8100
*
*
*
*
* 3.1 - 18000
*
*
*
*
* 3.2 - 20480
*
*
*
*
* 4 - 32768
*
*
*
*
* 4.1 - 32768
*
*
*
*
* MaxBitRate (Optional, H.264/MPEG2/VP8/VP9 only)
*
*
* The maximum number of bits per second in a video buffer; the size of the buffer is specified by
* BufferSize
. Specify a value between 16 and 62,500. You can reduce the bandwidth required to
* stream a video by reducing the maximum bit rate, but this also reduces the quality of the video.
*
*
* BufferSize (Optional, H.264/MPEG2/VP8/VP9 only)
*
*
* The maximum number of bits in any x seconds of the output video. This window is commonly 10 seconds, the
* standard segment duration when you're using FMP4 or MPEG-TS for the container type of the output video.
* Specify an integer greater than 0. If you specify MaxBitRate
and omit BufferSize
,
* Elastic Transcoder sets BufferSize
to 10 times the value of MaxBitRate
.
*
*
* InterlacedMode (Optional, H.264/MPEG2 Only)
*
*
* The interlace mode for the output video.
*
*
* Interlaced video is used to double the perceived frame rate for a video by interlacing two fields (one field
* on every other line, the other field on the other lines) so that the human eye registers multiple pictures
* per frame. Interlacing reduces the bandwidth required for transmitting a video, but can result in blurred
* images and flickering.
*
*
* Valid values include Progressive
(no interlacing, top to bottom), TopFirst
(top
* field first), BottomFirst
(bottom field first), and Auto
.
*
*
* If InterlaceMode
is not specified, Elastic Transcoder uses Progressive
for the
* output. If Auto
is specified, Elastic Transcoder interlaces the output.
*
*
* ColorSpaceConversionMode (Optional, H.264/MPEG2 Only)
*
*
* The color space conversion Elastic Transcoder applies to the output video. Color spaces are the algorithms
* used by the computer to store information about how to render color. Bt.601
is the standard for
* standard definition video, while Bt.709
is the standard for high definition video.
*
*
* Valid values include None
, Bt709toBt601
, Bt601toBt709
, and
* Auto
.
*
*
* If you chose Auto
for ColorSpaceConversionMode
and your output is interlaced, your
* frame rate is one of 23.97
, 24
, 25
, 29.97
,
* 50
, or 60
, your SegmentDuration
is null, and you are using one of the
* resolution changes from the list below, Elastic Transcoder applies the following color space conversions:
*
*
*
*
* Standard to HD, 720x480 to 1920x1080 - Elastic Transcoder applies Bt601ToBt709
*
*
*
*
* Standard to HD, 720x576 to 1920x1080 - Elastic Transcoder applies Bt601ToBt709
*
*
*
*
* HD to Standard, 1920x1080 to 720x480 - Elastic Transcoder applies Bt709ToBt601
*
*
*
*
* HD to Standard, 1920x1080 to 720x576 - Elastic Transcoder applies Bt709ToBt601
*
*
*
*
*
* Elastic Transcoder may change the behavior of the ColorspaceConversionMode
Auto
* mode in the future. All outputs in a playlist must use the same ColorSpaceConversionMode
.
*
*
*
* If you do not specify a ColorSpaceConversionMode
, Elastic Transcoder does not change the color
* space of a file. If you are unsure what ColorSpaceConversionMode
was applied to your output
* file, you can check the AppliedColorSpaceConversion
parameter included in your job response. If
* your job does not have an AppliedColorSpaceConversion
in its response, no
* ColorSpaceConversionMode
was applied.
*
*
* ChromaSubsampling
*
*
* The sampling pattern for the chroma (color) channels of the output video. Valid values include
* yuv420p
and yuv422p
.
*
*
* yuv420p
samples the chroma information of every other horizontal and every other vertical line,
* yuv422p
samples the color information of every horizontal line and every other vertical line.
*
*
* LoopCount (Gif Only)
*
*
* The number of times you want the output gif to loop. Valid values include Infinite
and integers
* between 0
and 100
, inclusive.
*
*
* @param codecOptions
* Profile (H.264/VP8/VP9 Only)
*
* The H.264 profile that you want to use for the output file. Elastic Transcoder supports the following
* profiles:
*
*
*
*
* baseline
: The profile most commonly used for videoconferencing and for mobile
* applications.
*
*
*
*
* main
: The profile used for standard-definition digital TV broadcasts.
*
*
*
*
* high
: The profile used for high-definition digital TV broadcasts and for Blu-ray discs.
*
*
*
*
* Level (H.264 Only)
*
*
* The H.264 level that you want to use for the output file. Elastic Transcoder supports the following
* levels:
*
*
* 1
, 1b
, 1.1
, 1.2
, 1.3
, 2
,
* 2.1
, 2.2
, 3
, 3.1
, 3.2
, 4
, 4.1
*
*
* MaxReferenceFrames (H.264 Only)
*
*
* Applicable only when the value of Video:Codec is H.264. The maximum number of previously decoded
* frames to use as a reference for decoding future frames. Valid values are integers 0 through 16, but
* we recommend that you not use a value greater than the following:
*
*
* Min(Floor(Maximum decoded picture buffer in macroblocks * 256 / (Width in pixels * Height in pixels)), 16)
*
*
* where Width in pixels and Height in pixels represent either MaxWidth and MaxHeight, or
* Resolution. Maximum decoded picture buffer in macroblocks depends on the value of the
* Level
object. See the list below. (A macroblock is a block of pixels measuring 16x16.)
*
*
*
*
* 1 - 396
*
*
*
*
* 1b - 396
*
*
*
*
* 1.1 - 900
*
*
*
*
* 1.2 - 2376
*
*
*
*
* 1.3 - 2376
*
*
*
*
* 2 - 2376
*
*
*
*
* 2.1 - 4752
*
*
*
*
* 2.2 - 8100
*
*
*
*
* 3 - 8100
*
*
*
*
* 3.1 - 18000
*
*
*
*
* 3.2 - 20480
*
*
*
*
* 4 - 32768
*
*
*
*
* 4.1 - 32768
*
*
*
*
* MaxBitRate (Optional, H.264/MPEG2/VP8/VP9 only)
*
*
* The maximum number of bits per second in a video buffer; the size of the buffer is specified by
* BufferSize
. Specify a value between 16 and 62,500. You can reduce the bandwidth required
* to stream a video by reducing the maximum bit rate, but this also reduces the quality of the video.
*
*
* BufferSize (Optional, H.264/MPEG2/VP8/VP9 only)
*
*
* The maximum number of bits in any x seconds of the output video. This window is commonly 10 seconds,
* the standard segment duration when you're using FMP4 or MPEG-TS for the container type of the output
* video. Specify an integer greater than 0. If you specify MaxBitRate
and omit
* BufferSize
, Elastic Transcoder sets BufferSize
to 10 times the value of
* MaxBitRate
.
*
*
* InterlacedMode (Optional, H.264/MPEG2 Only)
*
*
* The interlace mode for the output video.
*
*
* Interlaced video is used to double the perceived frame rate for a video by interlacing two fields (one
* field on every other line, the other field on the other lines) so that the human eye registers
* multiple pictures per frame. Interlacing reduces the bandwidth required for transmitting a video, but
* can result in blurred images and flickering.
*
*
* Valid values include Progressive
(no interlacing, top to bottom), TopFirst
* (top field first), BottomFirst
(bottom field first), and Auto
.
*
*
* If InterlaceMode
is not specified, Elastic Transcoder uses Progressive
for
* the output. If Auto
is specified, Elastic Transcoder interlaces the output.
*
*
* ColorSpaceConversionMode (Optional, H.264/MPEG2 Only)
*
*
* The color space conversion Elastic Transcoder applies to the output video. Color spaces are the
* algorithms used by the computer to store information about how to render color. Bt.601
is
* the standard for standard definition video, while Bt.709
is the standard for high
* definition video.
*
*
* Valid values include None
, Bt709toBt601
, Bt601toBt709
, and
* Auto
.
*
*
* If you chose Auto
for ColorSpaceConversionMode
and your output is
* interlaced, your frame rate is one of 23.97
, 24
, 25
,
* 29.97
, 50
, or 60
, your SegmentDuration
is null,
* and you are using one of the resolution changes from the list below, Elastic Transcoder applies the
* following color space conversions:
*
*
*
*
* Standard to HD, 720x480 to 1920x1080 - Elastic Transcoder applies Bt601ToBt709
*
*
*
*
* Standard to HD, 720x576 to 1920x1080 - Elastic Transcoder applies Bt601ToBt709
*
*
*
*
* HD to Standard, 1920x1080 to 720x480 - Elastic Transcoder applies Bt709ToBt601
*
*
*
*
* HD to Standard, 1920x1080 to 720x576 - Elastic Transcoder applies Bt709ToBt601
*
*
*
*
*
* Elastic Transcoder may change the behavior of the ColorspaceConversionMode
* Auto
mode in the future. All outputs in a playlist must use the same
* ColorSpaceConversionMode
.
*
*
*
* If you do not specify a ColorSpaceConversionMode
, Elastic Transcoder does not change the
* color space of a file. If you are unsure what ColorSpaceConversionMode
was applied to
* your output file, you can check the AppliedColorSpaceConversion
parameter included in
* your job response. If your job does not have an AppliedColorSpaceConversion
in its
* response, no ColorSpaceConversionMode
was applied.
*
*
* ChromaSubsampling
*
*
* The sampling pattern for the chroma (color) channels of the output video. Valid values include
* yuv420p
and yuv422p
.
*
*
* yuv420p
samples the chroma information of every other horizontal and every other vertical
* line, yuv422p
samples the color information of every horizontal line and every other
* vertical line.
*
*
* LoopCount (Gif Only)
*
*
* The number of times you want the output gif to loop. Valid values include Infinite
and
* integers between 0
and 100
, inclusive.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder codecOptions(Map codecOptions);
/**
*
* Applicable only when the value of Video:Codec is one of H.264
, MPEG2
, or
* VP8
.
*
*
* The maximum number of frames between key frames. Key frames are fully encoded frames; the frames between key
* frames are encoded based, in part, on the content of the key frames. The value is an integer formatted as a
* string; valid values are between 1 (every frame is a key frame) and 100000, inclusive. A higher value results
* in higher compression but may also discernibly decrease video quality.
*
*
* For Smooth
outputs, the FrameRate
must have a constant ratio to the
* KeyframesMaxDist
. This allows Smooth
playlists to switch between different quality
* levels while the file is being played.
*
*
* For example, an input file can have a FrameRate
of 30 with a KeyframesMaxDist
of
* 90. The output file then needs to have a ratio of 1:3. Valid outputs would have FrameRate
of 30,
* 25, and 10, and KeyframesMaxDist
of 90, 75, and 30, respectively.
*
*
* Alternately, this can be achieved by setting FrameRate
to auto and having the same values for
* MaxFrameRate
and KeyframesMaxDist
.
*
*
* @param keyframesMaxDist
* Applicable only when the value of Video:Codec is one of H.264
, MPEG2
, or
* VP8
.
*
* The maximum number of frames between key frames. Key frames are fully encoded frames; the frames
* between key frames are encoded based, in part, on the content of the key frames. The value is an
* integer formatted as a string; valid values are between 1 (every frame is a key frame) and 100000,
* inclusive. A higher value results in higher compression but may also discernibly decrease video
* quality.
*
*
* For Smooth
outputs, the FrameRate
must have a constant ratio to the
* KeyframesMaxDist
. This allows Smooth
playlists to switch between different
* quality levels while the file is being played.
*
*
* For example, an input file can have a FrameRate
of 30 with a
* KeyframesMaxDist
of 90. The output file then needs to have a ratio of 1:3. Valid outputs
* would have FrameRate
of 30, 25, and 10, and KeyframesMaxDist
of 90, 75, and
* 30, respectively.
*
*
* Alternately, this can be achieved by setting FrameRate
to auto and having the same values
* for MaxFrameRate
and KeyframesMaxDist
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder keyframesMaxDist(String keyframesMaxDist);
/**
*
* Applicable only when the value of Video:Codec is one of H.264
, MPEG2
, or
* VP8
.
*
*
* Whether to use a fixed value for FixedGOP
. Valid values are true
and
* false
:
*
*
*
*
* true
: Elastic Transcoder uses the value of KeyframesMaxDist
for the distance
* between key frames (the number of frames in a group of pictures, or GOP).
*
*
*
*
* false
: The distance between key frames can vary.
*
*
*
*
*
* FixedGOP
must be set to true
for fmp4
containers.
*
*
*
* @param fixedGOP
* Applicable only when the value of Video:Codec is one of H.264
, MPEG2
, or
* VP8
.
*
* Whether to use a fixed value for FixedGOP
. Valid values are true
and
* false
:
*
*
*
*
* true
: Elastic Transcoder uses the value of KeyframesMaxDist
for the distance
* between key frames (the number of frames in a group of pictures, or GOP).
*
*
*
*
* false
: The distance between key frames can vary.
*
*
*
*
*
* FixedGOP
must be set to true
for fmp4
containers.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder fixedGOP(String fixedGOP);
/**
*
* The bit rate of the video stream in the output file, in kilobits/second. Valid values depend on the values of
* Level
and Profile
. If you specify auto
, Elastic Transcoder uses the
* detected bit rate of the input source. If you specify a value other than auto
, we recommend that
* you specify a value less than or equal to the maximum H.264-compliant value listed for your level and
* profile:
*
*
* Level - Maximum video bit rate in kilobits/second (baseline and main Profile) : maximum video bit rate in
* kilobits/second (high Profile)
*
*
*
*
* 1 - 64 : 80
*
*
*
*
* 1b - 128 : 160
*
*
*
*
* 1.1 - 192 : 240
*
*
*
*
* 1.2 - 384 : 480
*
*
*
*
* 1.3 - 768 : 960
*
*
*
*
* 2 - 2000 : 2500
*
*
*
*
* 3 - 10000 : 12500
*
*
*
*
* 3.1 - 14000 : 17500
*
*
*
*
* 3.2 - 20000 : 25000
*
*
*
*
* 4 - 20000 : 25000
*
*
*
*
* 4.1 - 50000 : 62500
*
*
*
*
* @param bitRate
* The bit rate of the video stream in the output file, in kilobits/second. Valid values depend on the
* values of Level
and Profile
. If you specify auto
, Elastic
* Transcoder uses the detected bit rate of the input source. If you specify a value other than
* auto
, we recommend that you specify a value less than or equal to the maximum
* H.264-compliant value listed for your level and profile:
*
* Level - Maximum video bit rate in kilobits/second (baseline and main Profile) : maximum video bit
* rate in kilobits/second (high Profile)
*
*
*
*
* 1 - 64 : 80
*
*
*
*
* 1b - 128 : 160
*
*
*
*
* 1.1 - 192 : 240
*
*
*
*
* 1.2 - 384 : 480
*
*
*
*
* 1.3 - 768 : 960
*
*
*
*
* 2 - 2000 : 2500
*
*
*
*
* 3 - 10000 : 12500
*
*
*
*
* 3.1 - 14000 : 17500
*
*
*
*
* 3.2 - 20000 : 25000
*
*
*
*
* 4 - 20000 : 25000
*
*
*
*
* 4.1 - 50000 : 62500
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder bitRate(String bitRate);
/**
*
* The frames per second for the video stream in the output file. Valid values include:
*
*
* auto
, 10
, 15
, 23.97
, 24
, 25
,
* 29.97
, 30
, 60
*
*
* If you specify auto
, Elastic Transcoder uses the detected frame rate of the input source. If you
* specify a frame rate, we recommend that you perform the following calculation:
*
*
* Frame rate = maximum recommended decoding speed in luma samples/second / (width in pixels * height in pixels)
*
*
* where:
*
*
*
*
* width in pixels and height in pixels represent the Resolution of the output video.
*
*
*
*
* maximum recommended decoding speed in Luma samples/second is less than or equal to the maximum value
* listed in the following table, based on the value that you specified for Level.
*
*
*
*
* The maximum recommended decoding speed in Luma samples/second for each level is described in the following
* list (Level - Decoding speed ):
*
*
*
*
* 1 - 380160
*
*
*
*
* 1b - 380160
*
*
*
*
* 1.1 - 76800
*
*
*
*
* 1.2 - 1536000
*
*
*
*
* 1.3 - 3041280
*
*
*
*
* 2 - 3041280
*
*
*
*
* 2.1 - 5068800
*
*
*
*
* 2.2 - 5184000
*
*
*
*
* 3 - 10368000
*
*
*
*
* 3.1 - 27648000
*
*
*
*
* 3.2 - 55296000
*
*
*
*
* 4 - 62914560
*
*
*
*
* 4.1 - 62914560
*
*
*
*
* @param frameRate
* The frames per second for the video stream in the output file. Valid values include:
*
* auto
, 10
, 15
, 23.97
, 24
,
* 25
, 29.97
, 30
, 60
*
*
* If you specify auto
, Elastic Transcoder uses the detected frame rate of the input source.
* If you specify a frame rate, we recommend that you perform the following calculation:
*
*
* Frame rate = maximum recommended decoding speed in luma samples/second / (width in pixels * height in pixels)
*
*
* where:
*
*
*
*
* width in pixels and height in pixels represent the Resolution of the output video.
*
*
*
*
* maximum recommended decoding speed in Luma samples/second is less than or equal to the maximum
* value listed in the following table, based on the value that you specified for Level.
*
*
*
*
* The maximum recommended decoding speed in Luma samples/second for each level is described in the
* following list (Level - Decoding speed ):
*
*
*
*
* 1 - 380160
*
*
*
*
* 1b - 380160
*
*
*
*
* 1.1 - 76800
*
*
*
*
* 1.2 - 1536000
*
*
*
*
* 1.3 - 3041280
*
*
*
*
* 2 - 3041280
*
*
*
*
* 2.1 - 5068800
*
*
*
*
* 2.2 - 5184000
*
*
*
*
* 3 - 10368000
*
*
*
*
* 3.1 - 27648000
*
*
*
*
* 3.2 - 55296000
*
*
*
*
* 4 - 62914560
*
*
*
*
* 4.1 - 62914560
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder frameRate(String frameRate);
/**
*
* If you specify auto
for FrameRate
, Elastic Transcoder uses the frame rate of the
* input video for the frame rate of the output video. Specify the maximum frame rate that you want Elastic
* Transcoder to use when the frame rate of the input video is greater than the desired maximum frame rate of
* the output video. Valid values include: 10
, 15
, 23.97
, 24
, 25
, 29.97
, 30
, 60
.
*
*
* @param maxFrameRate
* If you specify auto
for FrameRate
, Elastic Transcoder uses the frame rate of
* the input video for the frame rate of the output video. Specify the maximum frame rate that you want
* Elastic Transcoder to use when the frame rate of the input video is greater than the desired maximum
* frame rate of the output video. Valid values include: 10
, 15
,
* 23.97
, 24
, 25
, 29.97
, 30
,
* 60
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder maxFrameRate(String maxFrameRate);
/**
*
*
* To better control resolution and aspect ratio of output videos, we recommend that you use the values
* MaxWidth
, MaxHeight
, SizingPolicy
, PaddingPolicy
, and
* DisplayAspectRatio
instead of Resolution
and AspectRatio
. The two
* groups of settings are mutually exclusive. Do not use them together.
*
*
*
* The width and height of the video in the output file, in pixels. Valid values are auto
and
* width x height :
*
*
*
*
* auto
: Elastic Transcoder attempts to preserve the width and height of the input file, subject to
* the following rules.
*
*
*
*
* width x height
: The width and height of the output video in pixels.
*
*
*
*
* Note the following about specifying the width and height:
*
*
*
*
* The width must be an even integer between 128 and 4096, inclusive.
*
*
*
*
* The height must be an even integer between 96 and 3072, inclusive.
*
*
*
*
* If you specify a resolution that is less than the resolution of the input file, Elastic Transcoder rescales
* the output file to the lower resolution.
*
*
*
*
* If you specify a resolution that is greater than the resolution of the input file, Elastic Transcoder
* rescales the output to the higher resolution.
*
*
*
*
* We recommend that you specify a resolution for which the product of width and height is less than or equal to
* the applicable value in the following list (List - Max width x height value ):
*
*
*
*
* 1 - 25344
*
*
*
*
* 1b - 25344
*
*
*
*
* 1.1 - 101376
*
*
*
*
* 1.2 - 101376
*
*
*
*
* 1.3 - 101376
*
*
*
*
* 2 - 101376
*
*
*
*
* 2.1 - 202752
*
*
*
*
* 2.2 - 404720
*
*
*
*
* 3 - 404720
*
*
*
*
* 3.1 - 921600
*
*
*
*
* 3.2 - 1310720
*
*
*
*
* 4 - 2097152
*
*
*
*
* 4.1 - 2097152
*
*
*
*
*
*
* @param resolution
*
* To better control resolution and aspect ratio of output videos, we recommend that you use the values
* MaxWidth
, MaxHeight
, SizingPolicy
, PaddingPolicy
,
* and DisplayAspectRatio
instead of Resolution
and AspectRatio
.
* The two groups of settings are mutually exclusive. Do not use them together.
*
*
*
* The width and height of the video in the output file, in pixels. Valid values are auto
* and width x height :
*
*
*
*
* auto
: Elastic Transcoder attempts to preserve the width and height of the input file,
* subject to the following rules.
*
*
*
*
* width x height
: The width and height of the output video in pixels.
*
*
*
*
* Note the following about specifying the width and height:
*
*
*
*
* The width must be an even integer between 128 and 4096, inclusive.
*
*
*
*
* The height must be an even integer between 96 and 3072, inclusive.
*
*
*
*
* If you specify a resolution that is less than the resolution of the input file, Elastic Transcoder
* rescales the output file to the lower resolution.
*
*
*
*
* If you specify a resolution that is greater than the resolution of the input file, Elastic Transcoder
* rescales the output to the higher resolution.
*
*
*
*
* We recommend that you specify a resolution for which the product of width and height is less than or
* equal to the applicable value in the following list (List - Max width x height value ):
*
*
*
*
* 1 - 25344
*
*
*
*
* 1b - 25344
*
*
*
*
* 1.1 - 101376
*
*
*
*
* 1.2 - 101376
*
*
*
*
* 1.3 - 101376
*
*
*
*
* 2 - 101376
*
*
*
*
* 2.1 - 202752
*
*
*
*
* 2.2 - 404720
*
*
*
*
* 3 - 404720
*
*
*
*
* 3.1 - 921600
*
*
*
*
* 3.2 - 1310720
*
*
*
*
* 4 - 2097152
*
*
*
*
* 4.1 - 2097152
*
*
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder resolution(String resolution);
/**
*
*
* To better control resolution and aspect ratio of output videos, we recommend that you use the values
* MaxWidth
, MaxHeight
, SizingPolicy
, PaddingPolicy
, and
* DisplayAspectRatio
instead of Resolution
and AspectRatio
. The two
* groups of settings are mutually exclusive. Do not use them together.
*
*
*
* The display aspect ratio of the video in the output file. Valid values include:
*
*
* auto
, 1:1
, 4:3
, 3:2
, 16:9
*
*
* If you specify auto
, Elastic Transcoder tries to preserve the aspect ratio of the input file.
*
*
* If you specify an aspect ratio for the output file that differs from aspect ratio of the input file, Elastic
* Transcoder adds pillarboxing (black bars on the sides) or letterboxing (black bars on the top and bottom) to
* maintain the aspect ratio of the active region of the video.
*
*
* @param aspectRatio
*
* To better control resolution and aspect ratio of output videos, we recommend that you use the values
* MaxWidth
, MaxHeight
, SizingPolicy
, PaddingPolicy
,
* and DisplayAspectRatio
instead of Resolution
and AspectRatio
.
* The two groups of settings are mutually exclusive. Do not use them together.
*
*
*
* The display aspect ratio of the video in the output file. Valid values include:
*
*
* auto
, 1:1
, 4:3
, 3:2
, 16:9
*
*
* If you specify auto
, Elastic Transcoder tries to preserve the aspect ratio of the input
* file.
*
*
* If you specify an aspect ratio for the output file that differs from aspect ratio of the input file,
* Elastic Transcoder adds pillarboxing (black bars on the sides) or letterboxing (black bars on the top
* and bottom) to maintain the aspect ratio of the active region of the video.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder aspectRatio(String aspectRatio);
/**
*
* The maximum width of the output video in pixels. If you specify auto
, Elastic Transcoder uses
* 1920 (Full HD) as the default value. If you specify a numeric value, enter an even integer between 128 and
* 4096.
*
*
* @param maxWidth
* The maximum width of the output video in pixels. If you specify auto
, Elastic Transcoder
* uses 1920 (Full HD) as the default value. If you specify a numeric value, enter an even integer
* between 128 and 4096.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder maxWidth(String maxWidth);
/**
*
* The maximum height of the output video in pixels. If you specify auto
, Elastic Transcoder uses
* 1080 (Full HD) as the default value. If you specify a numeric value, enter an even integer between 96 and
* 3072.
*
*
* @param maxHeight
* The maximum height of the output video in pixels. If you specify auto
, Elastic Transcoder
* uses 1080 (Full HD) as the default value. If you specify a numeric value, enter an even integer
* between 96 and 3072.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder maxHeight(String maxHeight);
/**
*
* The value that Elastic Transcoder adds to the metadata in the output file.
*
*
* @param displayAspectRatio
* The value that Elastic Transcoder adds to the metadata in the output file.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder displayAspectRatio(String displayAspectRatio);
/**
*
* Specify one of the following values to control scaling of the output video:
*
*
*
*
* Fit
: Elastic Transcoder scales the output video so it matches the value that you specified in
* either MaxWidth
or MaxHeight
without exceeding the other value.
*
*
*
*
* Fill
: Elastic Transcoder scales the output video so it matches the value that you specified in
* either MaxWidth
or MaxHeight
and matches or exceeds the other value. Elastic
* Transcoder centers the output video and then crops it in the dimension (if any) that exceeds the maximum
* value.
*
*
*
*
* Stretch
: Elastic Transcoder stretches the output video to match the values that you specified
* for MaxWidth
and MaxHeight
. If the relative proportions of the input video and the
* output video are different, the output video will be distorted.
*
*
*
*
* Keep
: Elastic Transcoder does not scale the output video. If either dimension of the input video
* exceeds the values that you specified for MaxWidth
and MaxHeight
, Elastic
* Transcoder crops the output video.
*
*
*
*
* ShrinkToFit
: Elastic Transcoder scales the output video down so that its dimensions match the
* values that you specified for at least one of MaxWidth
and MaxHeight
without
* exceeding either value. If you specify this option, Elastic Transcoder does not scale the video up.
*
*
*
*
* ShrinkToFill
: Elastic Transcoder scales the output video down so that its dimensions match the
* values that you specified for at least one of MaxWidth
and MaxHeight
without
* dropping below either value. If you specify this option, Elastic Transcoder does not scale the video up.
*
*
*
*
* @param sizingPolicy
* Specify one of the following values to control scaling of the output video:
*
*
*
* Fit
: Elastic Transcoder scales the output video so it matches the value that you
* specified in either MaxWidth
or MaxHeight
without exceeding the other value.
*
*
*
*
* Fill
: Elastic Transcoder scales the output video so it matches the value that you
* specified in either MaxWidth
or MaxHeight
and matches or exceeds the other
* value. Elastic Transcoder centers the output video and then crops it in the dimension (if any) that
* exceeds the maximum value.
*
*
*
*
* Stretch
: Elastic Transcoder stretches the output video to match the values that you
* specified for MaxWidth
and MaxHeight
. If the relative proportions of the
* input video and the output video are different, the output video will be distorted.
*
*
*
*
* Keep
: Elastic Transcoder does not scale the output video. If either dimension of the
* input video exceeds the values that you specified for MaxWidth
and MaxHeight
* , Elastic Transcoder crops the output video.
*
*
*
*
* ShrinkToFit
: Elastic Transcoder scales the output video down so that its dimensions match
* the values that you specified for at least one of MaxWidth
and MaxHeight
* without exceeding either value. If you specify this option, Elastic Transcoder does not scale the
* video up.
*
*
*
*
* ShrinkToFill
: Elastic Transcoder scales the output video down so that its dimensions
* match the values that you specified for at least one of MaxWidth
and
* MaxHeight
without dropping below either value. If you specify this option, Elastic
* Transcoder does not scale the video up.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder sizingPolicy(String sizingPolicy);
/**
*
* When you set PaddingPolicy
to Pad
, Elastic Transcoder may add black bars to the top
* and bottom and/or left and right sides of the output video to make the total size of the output video match
* the values that you specified for MaxWidth
and MaxHeight
.
*
*
* @param paddingPolicy
* When you set PaddingPolicy
to Pad
, Elastic Transcoder may add black bars to
* the top and bottom and/or left and right sides of the output video to make the total size of the
* output video match the values that you specified for MaxWidth
and MaxHeight
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder paddingPolicy(String paddingPolicy);
/**
*
* Settings for the size, location, and opacity of graphics that you want Elastic Transcoder to overlay over
* videos that are transcoded using this preset. You can specify settings for up to four watermarks. Watermarks
* appear in the specified size and location, and with the specified opacity for the duration of the transcoded
* video.
*
*
* Watermarks can be in .png or .jpg format. If you want to display a watermark that is not rectangular, use the
* .png format, which supports transparency.
*
*
* When you create a job that uses this preset, you specify the .png or .jpg graphics that you want Elastic
* Transcoder to include in the transcoded videos. You can specify fewer graphics in the job than you specify
* watermark settings in the preset, which allows you to use the same preset for up to four watermarks that have
* different dimensions.
*
*
* @param watermarks
* Settings for the size, location, and opacity of graphics that you want Elastic Transcoder to overlay
* over videos that are transcoded using this preset. You can specify settings for up to four watermarks.
* Watermarks appear in the specified size and location, and with the specified opacity for the duration
* of the transcoded video.
*
* Watermarks can be in .png or .jpg format. If you want to display a watermark that is not rectangular,
* use the .png format, which supports transparency.
*
*
* When you create a job that uses this preset, you specify the .png or .jpg graphics that you want
* Elastic Transcoder to include in the transcoded videos. You can specify fewer graphics in the job than
* you specify watermark settings in the preset, which allows you to use the same preset for up to four
* watermarks that have different dimensions.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder watermarks(Collection watermarks);
/**
*
* Settings for the size, location, and opacity of graphics that you want Elastic Transcoder to overlay over
* videos that are transcoded using this preset. You can specify settings for up to four watermarks. Watermarks
* appear in the specified size and location, and with the specified opacity for the duration of the transcoded
* video.
*
*
* Watermarks can be in .png or .jpg format. If you want to display a watermark that is not rectangular, use the
* .png format, which supports transparency.
*
*
* When you create a job that uses this preset, you specify the .png or .jpg graphics that you want Elastic
* Transcoder to include in the transcoded videos. You can specify fewer graphics in the job than you specify
* watermark settings in the preset, which allows you to use the same preset for up to four watermarks that have
* different dimensions.
*
*
* @param watermarks
* Settings for the size, location, and opacity of graphics that you want Elastic Transcoder to overlay
* over videos that are transcoded using this preset. You can specify settings for up to four watermarks.
* Watermarks appear in the specified size and location, and with the specified opacity for the duration
* of the transcoded video.
*
* Watermarks can be in .png or .jpg format. If you want to display a watermark that is not rectangular,
* use the .png format, which supports transparency.
*
*
* When you create a job that uses this preset, you specify the .png or .jpg graphics that you want
* Elastic Transcoder to include in the transcoded videos. You can specify fewer graphics in the job than
* you specify watermark settings in the preset, which allows you to use the same preset for up to four
* watermarks that have different dimensions.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder watermarks(PresetWatermark... watermarks);
/**
*
* Settings for the size, location, and opacity of graphics that you want Elastic Transcoder to overlay over
* videos that are transcoded using this preset. You can specify settings for up to four watermarks. Watermarks
* appear in the specified size and location, and with the specified opacity for the duration of the transcoded
* video.
*
*
* Watermarks can be in .png or .jpg format. If you want to display a watermark that is not rectangular, use the
* .png format, which supports transparency.
*
*
* When you create a job that uses this preset, you specify the .png or .jpg graphics that you want Elastic
* Transcoder to include in the transcoded videos. You can specify fewer graphics in the job than you specify
* watermark settings in the preset, which allows you to use the same preset for up to four watermarks that have
* different dimensions.
*
* This is a convenience that creates an instance of the {@link List.Builder} avoiding the need
* to create one manually via {@link List#builder()}.
*
* When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and
* its result is passed to {@link #watermarks(List)}.
*
* @param watermarks
* a consumer that will call methods on {@link List.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #watermarks(List)
*/
Builder watermarks(Consumer... watermarks);
}
static final class BuilderImpl implements Builder {
private String codec;
private Map codecOptions = DefaultSdkAutoConstructMap.getInstance();
private String keyframesMaxDist;
private String fixedGOP;
private String bitRate;
private String frameRate;
private String maxFrameRate;
private String resolution;
private String aspectRatio;
private String maxWidth;
private String maxHeight;
private String displayAspectRatio;
private String sizingPolicy;
private String paddingPolicy;
private List watermarks = DefaultSdkAutoConstructList.getInstance();
private BuilderImpl() {
}
private BuilderImpl(VideoParameters model) {
codec(model.codec);
codecOptions(model.codecOptions);
keyframesMaxDist(model.keyframesMaxDist);
fixedGOP(model.fixedGOP);
bitRate(model.bitRate);
frameRate(model.frameRate);
maxFrameRate(model.maxFrameRate);
resolution(model.resolution);
aspectRatio(model.aspectRatio);
maxWidth(model.maxWidth);
maxHeight(model.maxHeight);
displayAspectRatio(model.displayAspectRatio);
sizingPolicy(model.sizingPolicy);
paddingPolicy(model.paddingPolicy);
watermarks(model.watermarks);
}
public final String getCodec() {
return codec;
}
public final void setCodec(String codec) {
this.codec = codec;
}
@Override
@Transient
public final Builder codec(String codec) {
this.codec = codec;
return this;
}
public final Map getCodecOptions() {
if (codecOptions instanceof SdkAutoConstructMap) {
return null;
}
return codecOptions;
}
public final void setCodecOptions(Map codecOptions) {
this.codecOptions = CodecOptionsCopier.copy(codecOptions);
}
@Override
@Transient
public final Builder codecOptions(Map codecOptions) {
this.codecOptions = CodecOptionsCopier.copy(codecOptions);
return this;
}
public final String getKeyframesMaxDist() {
return keyframesMaxDist;
}
public final void setKeyframesMaxDist(String keyframesMaxDist) {
this.keyframesMaxDist = keyframesMaxDist;
}
@Override
@Transient
public final Builder keyframesMaxDist(String keyframesMaxDist) {
this.keyframesMaxDist = keyframesMaxDist;
return this;
}
public final String getFixedGOP() {
return fixedGOP;
}
public final void setFixedGOP(String fixedGOP) {
this.fixedGOP = fixedGOP;
}
@Override
@Transient
public final Builder fixedGOP(String fixedGOP) {
this.fixedGOP = fixedGOP;
return this;
}
public final String getBitRate() {
return bitRate;
}
public final void setBitRate(String bitRate) {
this.bitRate = bitRate;
}
@Override
@Transient
public final Builder bitRate(String bitRate) {
this.bitRate = bitRate;
return this;
}
public final String getFrameRate() {
return frameRate;
}
public final void setFrameRate(String frameRate) {
this.frameRate = frameRate;
}
@Override
@Transient
public final Builder frameRate(String frameRate) {
this.frameRate = frameRate;
return this;
}
public final String getMaxFrameRate() {
return maxFrameRate;
}
public final void setMaxFrameRate(String maxFrameRate) {
this.maxFrameRate = maxFrameRate;
}
@Override
@Transient
public final Builder maxFrameRate(String maxFrameRate) {
this.maxFrameRate = maxFrameRate;
return this;
}
public final String getResolution() {
return resolution;
}
public final void setResolution(String resolution) {
this.resolution = resolution;
}
@Override
@Transient
public final Builder resolution(String resolution) {
this.resolution = resolution;
return this;
}
public final String getAspectRatio() {
return aspectRatio;
}
public final void setAspectRatio(String aspectRatio) {
this.aspectRatio = aspectRatio;
}
@Override
@Transient
public final Builder aspectRatio(String aspectRatio) {
this.aspectRatio = aspectRatio;
return this;
}
public final String getMaxWidth() {
return maxWidth;
}
public final void setMaxWidth(String maxWidth) {
this.maxWidth = maxWidth;
}
@Override
@Transient
public final Builder maxWidth(String maxWidth) {
this.maxWidth = maxWidth;
return this;
}
public final String getMaxHeight() {
return maxHeight;
}
public final void setMaxHeight(String maxHeight) {
this.maxHeight = maxHeight;
}
@Override
@Transient
public final Builder maxHeight(String maxHeight) {
this.maxHeight = maxHeight;
return this;
}
public final String getDisplayAspectRatio() {
return displayAspectRatio;
}
public final void setDisplayAspectRatio(String displayAspectRatio) {
this.displayAspectRatio = displayAspectRatio;
}
@Override
@Transient
public final Builder displayAspectRatio(String displayAspectRatio) {
this.displayAspectRatio = displayAspectRatio;
return this;
}
public final String getSizingPolicy() {
return sizingPolicy;
}
public final void setSizingPolicy(String sizingPolicy) {
this.sizingPolicy = sizingPolicy;
}
@Override
@Transient
public final Builder sizingPolicy(String sizingPolicy) {
this.sizingPolicy = sizingPolicy;
return this;
}
public final String getPaddingPolicy() {
return paddingPolicy;
}
public final void setPaddingPolicy(String paddingPolicy) {
this.paddingPolicy = paddingPolicy;
}
@Override
@Transient
public final Builder paddingPolicy(String paddingPolicy) {
this.paddingPolicy = paddingPolicy;
return this;
}
public final List getWatermarks() {
List result = PresetWatermarksCopier.copyToBuilder(this.watermarks);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setWatermarks(Collection watermarks) {
this.watermarks = PresetWatermarksCopier.copyFromBuilder(watermarks);
}
@Override
@Transient
public final Builder watermarks(Collection watermarks) {
this.watermarks = PresetWatermarksCopier.copy(watermarks);
return this;
}
@Override
@Transient
@SafeVarargs
public final Builder watermarks(PresetWatermark... watermarks) {
watermarks(Arrays.asList(watermarks));
return this;
}
@Override
@Transient
@SafeVarargs
public final Builder watermarks(Consumer... watermarks) {
watermarks(Stream.of(watermarks).map(c -> PresetWatermark.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
@Override
public VideoParameters build() {
return new VideoParameters(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}