When trying to create a MediaLive channel I get the following error:
Error executing "CreateChannel" on "https://medialive.eu-west-3.amazonaws.com/prod/channels"; AWS HTTP error: Client error: `POST https://medialive.eu-west-3.amazonaws.com/prod/channels` resulted in a `400 Bad Request` response: { "message" : "Non-empty channel name required" } BadRequestException (client): Non-empty channel name required - { "message" : "Non-empty channel name required" }
I use the following code to try and create the channel
The name attribute is filled as you can see below.
The documentation for this API can be found at the following link:
https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-medialive-2017-10-14.html#createchannel
$mediaLiveChannel = $this->mediaLive->createChannel([
'ChannelClass' => 'STANDARD',
'Destinations' => [
[
'Id' => 'mediapackage',
'MediaPackageSettings' => [
[
'ChannelId' => $mediaPackageChannel['Id'],
],
],
],
],
'EncoderSettings' => [
'AudioDescriptions' => [
[
"AudioSelectorName" => "Default",
"AudioTypeControl" => "FOLLOW_INPUT",
'CodecSettings' => [
'AacSettings' => [
'Bitrate' => 192000,
'CodingMode' => 'CODING_MODE_2_0',
'InputType' => 'NORMAL',
'Profile' => 'LC',
'RateControlMode' => 'CBR',
'RawFormat' => 'NONE',
'SampleRate' => 48000,
'Spec' => 'MPEG4',
],
],
"LanguageCode" => "or",
"LanguageCodeControl" => "USE_CONFIGURED",
"Name" => "Default",
"StreamName" => "Original",
],
],
'OutputGroups' => [
[
'Name' => 'MediaPackage',
'OutputGroupSettings' => [
'MediaPackageGroupSettings' => [
'Destination' => [
'DestinationRefId' => 'mediapackage',
],
],
],
'Outputs' => [
[
'AudioDescriptionNames' => ['Default'],
'OutputName' => 'Audio_Default',
'OutputSettings' => [
'MediaPackageOutputSettings' => [
],
],
],
[
'OutputName' => 'video_480p25',
'OutputSettings' => [
'MediaPackageOutputSettings' => [
],
],
'VideoDescriptionName' => 'video_480p25',
],
[
'OutputName' => 'video_720p25',
'OutputSettings' => [
'MediaPackageOutputSettings' => [
],
],
'VideoDescriptionName' => 'video_720p25',
],
[
'OutputName' => 'video_1080p25',
'OutputSettings' => [
'MediaPackageOutputSettings' => [
],
],
'VideoDescriptionName' => 'video_1080p25',
]
]
],
],
'TimecodeConfig' => [
'Source' => 'EMBEDDED',
],
'VideoDescriptions' => [
[
'Name' => 'video_480p25',
'Width' => 640,
'Height' => 480,
'CodecSettings' => [
'H264Settings' => [
'Bitrate' => 1000000,
'FramerateControl' => 'SPECIFIED',
'FramerateNumerator' => 25,
'FramerateDenominator' => 1,
'GopSize' => 2,
'GopSizeUnits' => 'SECONDS',
'Profile' => 'MAIN',
],
],
],
[
'Name' => 'video_720p25',
'Width' => 1280,
'Height' => 720,
'CodecSettings' => [
'H264Settings' => [
'Bitrate' => 3000000,
'FramerateControl' => 'SPECIFIED',
'FramerateNumerator' => 25,
'FramerateDenominator' => 1,
'GopSize' => 2,
'GopSizeUnits' => 'SECONDS',
'Profile' => 'MAIN',
],
],
],
[
'Name' => 'video_1080p25',
'Width' => 1920,
'Height' => 1080,
'CodecSettings' => [
'H264Settings' => [
'Bitrate' => 6000000,
'FramerateControl' => 'SPECIFIED',
'FramerateNumerator' => 25,
'FramerateDenominator' => 1,
'GopSize' => 2,
'GopSizeUnits' => 'SECONDS',
'Profile' => 'MAIN',
],
],
],
]
],
'InputAttachments' => [
[
'InputAttachmentName' => 'Input1',
'InputId' => $input['Input']['Id'],
'InputSettings' => [
'AudioSelectors' => [
[
'Name' => 'Default',
'SelectorSettings' => [
'AudioTrackSelection' => [
'Tracks' => [
[
'Track' => 1,
],
]
]
]
],
],
]
],
],
'InputSpecification' => [
'Codec' => 'AVC',
'MaximumBitrate' => 'MAX_20_MBPS',
'Resolution' => 'HD',
],
'name' => 'this_is_a_medialive_channel',
'RoleArn' => env("AWS_MEDIALIVEACCESSROLE"),
]);