PHP code example of dumpk / elastcoder

1. Go to this page and download the library: Download dumpk/elastcoder library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dumpk / elastcoder example snippets


use Dumpk\Elastcoder\ElastcoderAWS;

$elastcoder = new ElastcoderAWS();


$config = [
    'PresetId' => '432423-dsda',
    'width'  => 1920,
    'height' => 1080,
    'aspect' => '16:9',
	'ext'	 => 'mp4',
	'PipelineId' => '343244232-n2fuqq4',
    'Watermarks' => [[
        'PresetWatermarkId' => 'BottomRight',
        'InputKey'          => '1080.png',
    ]],
    'TimeSpan' => [
        'StartTime' => '0.4',
        'Duration'  => '5.3'
    ],
]


$job = $elastcoder->transcodeVideo($asset->key, $destinationKey, $config, $thumbPattern);


$job = $elastcoder->getJob($job["Id"]);


$elastcoder->setPublicObject($key, $bucket);


$elastcoder->setObjectACL($key, $bucket, $acl);


php artisan vendor:publish --tag=elastcoder

$job = $elastcoder->transcodeAudio($inputfile,$uotputfile,$artwork)