使用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
InputforInputswhen working with multiple video sources—this is a common gotcha! - Wrap each input: Each individual input configuration (like the
Key) must be nested under anInputkey within theInputsarray. This is what the API means by "array of properties" instead of a numerically indexed array. - Composition clarity: In your
Compositionarray, make sure to includeInputKey(orInputIndex) for each segment. This explicitly tells Elastic Transcoder which input video to pull the segment from, preventing unexpected ordering or errors.
内容的提问来源于stack exchange,提问作者Raju1990
相关产品推荐
相关产品推荐

