Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon Elastic Transcoder - Adding duration to output returning error

I'm using AWS SDK PHP.

Using ->createJob( everything is fine, but when I add

'Composition' => array(
                    'TimeSpan' => array(
                        'StartTime' => '00:00:00.000',
                        'Duration' => '00:00:02.000'
                    )
                )

to one of the outputs, I get the following error:

{"error":{"type":"Aws\ElasticTranscoder\Exception\ElasticTranscoderException","message":"Start of structure or map found where not expected.","file":"/Applications/XAMPP/xamppfiles/htdocs/breves/vendor/aws/aws-sdk-php/src/Aws/Common/Exception/NamespaceExceptionFactory.php","line":91}}

I'm trying to cut the video.

Any toughts?

Amazon SDK API Developer Guide

like image 759
jplozano Avatar asked Jun 20 '26 06:06

jplozano


1 Answers

Found out the answer:

it should be an array of "clips", like so:

'Composition' => array(
array(
    'TimeSpan' => array(
        'StartTime' => '00:00:00.000',
        'Duration' => '00:00:02.000'
    )

)

In my case I only needed 1 clip.

More information about duration here: (Optional) Clip Start Time - (StartTime) You can create an output file that contains an excerpt from the input file. Clip Start Time indicates the place in the input file where you want a clip to start. The format can be either HH:mm:ss.SSS (maximum value: 23:59:59.999; SSS is thousandths of a second) or sssss.SSS (maximum value: 86399.999). If you don't specify a value, Elastic Transcoder starts at the beginning of the input file.

(Optional) Clip Duration (Duration) The duration of your excerpt clip. The format can be either HH:mm:ss.SSS (maximum value: 23:59:59.999; SSS is thousandths of a second) or sssss.SSS (maximum value: 86399.999). If you don't specify a value, Elastic Transcoder clips from Clip Start Time to the end of the file.

If you specify a value longer than the duration of the input file, Elastic Transcoder transcodes from Clip Start Time to the end of the file and returns a warning message.

For Detailed info about aws transcoder here

like image 74
jplozano Avatar answered Jun 23 '26 03:06

jplozano