createPreset method
- required String container,
- required String name,
- AudioParameters? audio,
- String? description,
- Thumbnails? thumbnails,
- VideoParameters? video,
The CreatePreset operation creates a preset with settings that you specify. Elastic Transcoder uses the H.264 video-compression format. For more information, see the International Telecommunication Union publication Recommendation ITU-T H.264: Advanced video coding for generic audiovisual services.
May throw ValidationException. May throw IncompatibleVersionException. May throw AccessDeniedException. May throw LimitExceededException. May throw InternalServiceException.
Parameter container
:
The container type for the output file. Valid values include
flac
, flv
, fmp4
, gif
,
mp3
, mp4
, mpg
, mxf
,
oga
, ogg
, ts
, and
webm
.
Parameter name
:
The name of the preset. We recommend that the name be unique within the
AWS account, but uniqueness is not enforced.
Parameter audio
:
A section of the request body that specifies the audio parameters.
Parameter description
:
A description of the preset.
Parameter thumbnails
:
A section of the request body that specifies the thumbnail parameters, if
any.
Parameter video
:
A section of the request body that specifies the video parameters.
Implementation
Future<CreatePresetResponse> createPreset({
required String container,
required String name,
AudioParameters? audio,
String? description,
Thumbnails? thumbnails,
VideoParameters? video,
}) async {
ArgumentError.checkNotNull(container, 'container');
ArgumentError.checkNotNull(name, 'name');
_s.validateStringLength(
'name',
name,
1,
40,
isRequired: true,
);
_s.validateStringLength(
'description',
description,
0,
255,
);
final $payload = <String, dynamic>{
'Container': container,
'Name': name,
if (audio != null) 'Audio': audio,
if (description != null) 'Description': description,
if (thumbnails != null) 'Thumbnails': thumbnails,
if (video != null) 'Video': video,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/2012-09-25/presets',
exceptionFnMap: _exceptionFns,
);
return CreatePresetResponse.fromJson(response);
}