PHP code example of knik / elastic-transcoder

1. Go to this page and download the library: Download knik/elastic-transcoder 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/ */

    

knik / elastic-transcoder example snippets


$et = new ElasticTranscoder($awsAccessKey, $awsSecretKey, $awsRegion);

ElasticTranscoder::setAuth($awsAccessKey, $awsSecretKey, $awsRegion);

$pipelineId = 'pipelineId';
$input = array('Key' => 'inputFile');
$output = array(
  'Key' => 'outputFile.mp4',
  'PresetId' => 'presetId'
 );

$result = ElasticTranscoder::createJob($input, array($output), $pipelineId);

if (!$result) {
  echo ElasticTranscoder::getErrorMsg();
} else {
  echo 'New job ID: ' . $result['Job']['Id'];
}

ElasticTranscoder::listJobsByPipeline( string $pipelineId [, boolean $ascending = true ] );

ElasticTranscoder::listJobsByStatus( string $status );

ElasticTranscoder::readJob( string $jobId );

ElasticTranscoder::cancelJob( string $jobId );

ElasticTranscoder::createPipeline( string $name, string $inputBucket, string $outputBucket, string $role [, array $notifications ] );

ElasticTranscoder::listPipelines();

ElasticTranscoder::readPipeline( string $pipelineId );

ElasticTranscoder::updatePipeline( string $pipelineId, array $updates );

ElasticTranscoder::updatePipelineStatus( string $pipelineId, string $status );

ElasticTranscoder::updatePipelineNotifications( string $pipelineId [, array $notifications ] );

ElasticTranscoder::deletePipeline( string $pipelineId );

ElasticTranscoder::testRole( string $inputBucket, string $outputBucket, string $role, array $topics );

ElasticTranscoder::createPreset( array $options );

ElasticTranscoder::listPresets();

ElasticTranscoder::readPreset( string $presetId );

ElasticTranscoder::deletePreset( string $presetId );

ElasticTranscoder::setAuth( string $awsAccessKey, string $awsSecretKey );

ElasticTranscoder::setRegion( string $region = 'us-east-1' );

ElasticTranscoder::getStatusCode();

ElasticTranscoder::getResponse();

ElasticTranscoder::getErrorMsg();