弹性转码器 "Start of list found where not expected"

Elastic Transcoder "Start of list found where not expected"

我在 PHP 中使用 Elastic Transcoder 时遇到问题。我正在尝试使用转码器从 S3 中获取音频文件,trim,然后将其放回原处。当我尝试使用以下作业创建代码时出现错误:“{"Message":"Start of list found where not expected"}”

当我尝试创建 JOB 时,我使用以下代码:

$createJobResult = $transCoderClient->createJob([
    'PipelineId' => {pipelineID},
    'Input' => [
            'Key' => $media->key
        ],
    'Outputs' => [
        [
            'Key' => $newMedia->key,
            'PresetId' => {$presetID},
            'Composition' => [
               [
                   'Timespan' => [
                       'StartTime' => $trimStart,
                       'Duration' => $duration
                       ]
                   ]
               ]
           ]
       ],
       'UserMetaData' => [
           'trimJobId' => $trimQueueEntry->id
       ]
   ]);

任何人都可以权衡这个问题并提供帮助吗?查看 Amazon 上的文档时,结构看起来不错。

经过多次搜索找到了答案。这是正确的结构。

$createJobResult = $transCoderClient->createJob([
                'PipelineId' => '{pipelineID}',
                'Input' => [
                    'Key' => (string) $media->key,
                ],
                'Inputs' => [
                    [
                        'Key' => (string) $media->key,
                        'Timespan' => [
                            'StartTime' => 00:00:00.000,
                            'Duration' => 00:00:25.000
                        ]
                    ]
                ],
                'Output' => [
                    'Composition' => [
                        [
                            'TimeSpan' => [
                                'StartTime' => 00:00:00.000,
                                'Duration' => 00:00:25.000
                            ],
                        ],
                    ],
                    'Key' => $newMedia->key,
                    'PresetId' => {presetID},
                ],
            ]);