OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

AWS SDK PHP MediaLive CreateChannel: BadRequestException (client): Non-empty channel name required - { "message" : "Non-empty channel name required" }

  • Thread starter Thread starter Sidney Van Peteghem
  • Start date Start date
S

Sidney Van Peteghem

Guest
When trying to create a MediaLive channel I get the following error:

Code:
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

Code:
$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"),
]);
<p>When trying to create a MediaLive channel I get the following error:</p>
<pre><code>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" }
</code></pre>
<p>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:
<a href="https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-medialive-2017-10-14.html#createchannel" rel="nofollow noreferrer">https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-medialive-2017-10-14.html#createchannel</a></p>
<pre><code>$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"),
]);
</code></pre>
Continue reading...
 

Latest posts

J
Replies
0
Views
1
jbowerbir
J
Top