You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用AWS Elastic Transcoder多输入剪辑拼接时返回错误的问题咨询

Fixing "Input must be an array of properties, Got numerically indexed array" in AWS Elastic Transcoder Multi-Input Jobs

Ah, I know exactly what's going on here—you're hitting a common formatting quirk with AWS Elastic Transcoder's createJob API when working with multiple input videos. Let me break this down for you:

The error message is telling you that your Input parameter isn't structured the way the API expects. Right now, you're passing a plain numerically indexed array of input objects, but Elastic Transcoder requires each input to be wrapped in an associative array with an Input key, and you need to use the plural Inputs parameter name for multiple sources.

Here's your corrected code:

$result = $client->createJob(array(
    'PipelineId' => '151111112277-cq5k40',
    // Critical fix: Use 'Inputs' (plural) and wrap each input in an 'Input' object
    'Inputs' => array(
        array('Input' => array('Key' => 'test.mp4')),
        array('Input' => array('Key' => 'abc.mp4'))
    ),

    'Output' => array(
        'Key' => $output_file,
        'PresetId' => '1351621234501-000001',
        'Composition' => array(
            array(
                'TimeSpan' => array(
                    'StartTime' => '00:00:00.000',
                    'Duration' => '00:01:00.000',
                ),
                // Don't forget to specify which input this composition segment uses!
                'InputKey' => 'test.mp4'
            ),
            // Add a second segment from your other input video
            array(
                'TimeSpan' => array(
                    'StartTime' => '00:00:00.000',
                    'Duration' => '00:00:30.000',
                ),
                'InputKey' => 'abc.mp4'
            )
        ),
    ),
));

Key things to note:

  • Parameter name change: Swap Input for Inputs when working with multiple video sources—this is a common gotcha!
  • Wrap each input: Each individual input configuration (like the Key) must be nested under an Input key within the Inputs array. This is what the API means by "array of properties" instead of a numerically indexed array.
  • Composition clarity: In your Composition array, make sure to include InputKey (or InputIndex) for each segment. This explicitly tells Elastic Transcoder which input video to pull the segment from, preventing unexpected ordering or errors.

内容的提问来源于stack exchange,提问作者Raju1990

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 10:15:28