PHP code example of leovideo / leovideo-php-sdk

1. Go to this page and download the library: Download leovideo/leovideo-php-sdk 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/ */

    

leovideo / leovideo-php-sdk example snippets


use Hoge\Media\AVFormat;
use Hoge\Transcoder\TargetFileWithParameters;
use Hoge\Transcoder\TranscodeTask;
use Hoge\Transcoder\SourceFile;
use Hoge\Transcoder\TargetFileWithTemplate;
use Hoge\Transcoder\Transcoder;
...

    $sourceFile           = new SourceFile();
    $sourceFile->pathInfo = 'ftp://user:[email protected]/path/to';
    $sourceFile->fileName = 'filename.mp4';

    $targetFile           = new TargetFileWithTemplate();
    $targetFile->pathInfo = 'ftp://user:[email protected]/path/to';
    $targetFile->fileName = 'filename.mp4';

    $transcodeTask = new TranscodeTask('test1', $sourceFile, array($targetFile));
    $response      = Transcoder::createTask($transcodeTask);

...

composer