Hello,
Please help to get all required files to work with video using shotstack-sdk-php.
The composer seems work well but there are missing folders while compiling the code, like:
Uncaught Error: Class “Shotstack\Client\Configuration” not found
After few days of trying fix it it’s still not working and I coudn’t set the Shotstack to start to work with.
Have you referred to the PHP demos project. These all use the SDK and should all work out of the box: GitHub - shotstack/php-demos: Shotstack PHP demos - Edit videos in the cloud with PHP and the Shotstack Video Editing API. Is the path to vender/autoload.php
correct. Without that it won’t find the classes.
Also this example from the SDK readme should work:
<?php
require 'vendor/autoload.php';
use Shotstack\Client\Api\EditApi;
use Shotstack\Client\Configuration;
use Shotstack\Client\Model\Edit;
use Shotstack\Client\Model\Output;
use Shotstack\Client\Model\Timeline;
use Shotstack\Client\Model\Track;
use Shotstack\Client\Model\Clip;
use Shotstack\Client\Model\VideoAsset;
$config = Configuration::getDefaultConfiguration()
->setHost('https://api.shotstack.io/stage')
->setApiKey('x-api-key', 'H7jKyj9.........s9j0cD'); // use the correct API key
$client = new EditApi(null, $config);
$videoAsset = new VideoAsset();
$videoAsset
->setSrc('https://s3-ap-southeast-2.amazonaws.com/shotstack-assets/footage/skater.hd.mp4')
->setTrim(3);
$videoClip = new Clip();
$videoClip
->setAsset($videoAsset)
->setLength(8)
->setStart(0);
$track = new Track();
$track->setClips([$videoClip]);
$timeline = new Timeline();
$timeline->setTracks([$track]);
$output = new Output();
$output
->setFormat('mp4')
->setResolution('sd');
$edit = new Edit();
$edit
->setTimeline($timeline)
->setOutput($output);
$render = $client->postRender($edit)->getResponse();
Otherwise can you paste a simplified version of your PHP script and we can see what the issue might be.