1. Go to this page and download the library: Download vimqu/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/ */
vimqu / php-sdk example snippets
use Vimqu\Vimqu\Task\TaskManager;
use Vimqu\Vimqu\Outputs\VideoOutput;
$task = TaskManager::withToken('your_access_token')
->setInputFromStorage('your_storage_id', '/birds.mp4');
// or
->setInputFromUrl('https://<your_file>.mp4');
$video = (new VideoOutput('h264', 'mp4'))
->setStorage('your_storage_id', '/outputs/videos')
->setReferenceId('your_reference_id')
->subtitle(true)
->resize(300, null)
->clip(2, duration: 45)
->crop(300, 300, 15, 15);
$task->addOutput($video);
$result = $task->send();
$status = $result->getStatus(); // the status will be "active".
$id = $result->getId();
use Vimqu\Vimqu\Task\Search;
// This query will give you the "TaskDto" instance again.
$task = Search::withToken('xxxx xxxx')->getById($id);
use Vimqu\Vimqu\Outputs\HlsOutput;
$hls = (new HlsOutput)
->setStorage('your_storage_id', '/outputs/hls')
->setReferenceId('your_reference_id')
->subtitle(true)
->clip(2, 45)
->crop(300, 300, 15, 15)
->overlayImage('https://your_overlay_image.png', 50, 50, 0, 20)
->addVariant('240p')
->addVariant('480p')
->addVariant('720p')
->addVariant('1080p');
// $task is instance of TaskManager, we created it before.
$task->addOutput($hls);
$task->send();
use Vimqu\Vimqu\Outputs\DashOutput;
$dash = (new DashOutput)
->setStorage('your_storage_id', '/outputs/dash')
->setReferenceId('your_reference_id')
->subtitle(true)
->clip(2, 45)
->crop(300, 300, 15, 15)
->addVariant('720p')
->addVariant('1080p');
$task->addOutput($dash);
$task->send();