PHPackages                             shotstack/shotstack-sdk-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. shotstack/shotstack-sdk-php

ActiveLibrary[API Development](/categories/api)

shotstack/shotstack-sdk-php
===========================

Official PHP SDK for the Shotstack Cloud Video Editing API

0.2.6(1y ago)1544.9k—8%5[3 issues](https://github.com/shotstack/shotstack-sdk-php/issues)MITPHPPHP ^7.4 || ^8.0

Since May 5Pushed 1y ago1 watchersCompare

[ Source](https://github.com/shotstack/shotstack-sdk-php)[ Packagist](https://packagist.org/packages/shotstack/shotstack-sdk-php)[ Docs](https://shotstack.io)[ RSS](/packages/shotstack-shotstack-sdk-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (37)Used By (0)

Shotstack PHP SDK
==================

[](#shotstack-php-sdk-)

PHP SDK for the Shotstack [PHP video editor](https://shotstack.io/product/sdk/php) and cloud video editing API.

Shotstack is a cloud based video editing platform that enables the editing of videos using code.

The platform uses an API and a JSON format for specifying how videos should be edited and what assets and titles should be used.

A server based render farm takes care of rendering the videos allowing multiple videos to be created simultaneously.

For examples of how to use the SDK to create videos using code checkout the PHP demo repo:

Contents
---------

[](#contents-)

- [Using the PHP SDK](#using-the-php-sdk)
    - [Requirements](#requirements)
    - [Installation](#installation)
    - [Video Editing](#video-editing)
        - [Video Editing Example](#video-editing-example)
        - [Status Check Example](#status-check-example)
        - [Save a Template Example](#save-a-template-example)
        - [Render a Template Example](#render-a-template-example)
    - [Video Editing Schemas](#video-editing-schemas)
        - [Edit()](#edit)
        - [Timeline()](#timeline)
        - [Soundtrack()](#soundtrack)
        - [Font()](#font)
        - [Track()](#track)
        - [Clip()](#clip)
        - [VideoAsset()](#videoasset)
        - [ImageAsset()](#imageasset)
        - [TitleAsset()](#titleasset)
        - [HtmlAsset()](#htmlasset)
        - [AudioAsset()](#audioasset)
        - [LumaAsset()](#lumaasset)
        - [Transition()](#transition)
        - [Offset()](#offset)
        - [Crop()](#crop)
        - [Transformation()](#transformation)
        - [RotateTransformation()](#rotatetransformation)
        - [SkewTransformation()](#skewtransformation)
        - [FlipTransformation()](#fliptransformation)
        - [MergeField()](#mergefield)
    - [Template Schemas](#template-schemas)
        - [Template()](#template)
        - [TemplateRender()](#templaterender)
    - [Output Schemas](#output-schemas)
        - [Output()](#output)
        - [Size()](#size)
        - [Range()](#range)
        - [Poster()](#poster)
        - [Thumbnail()](#thumbnail)
    - [Destinations](#destinations)
        - [ShotstackDestination()](#shotstackdestination)
        - [MuxDestination()](#muxdestination)
        - [MuxDestinationOptions()](#muxdestinationoptions)
        - [S3Destination()](#s3destination)
        - [S3DestinationOptions()](#s3destinationoptions)
    - [Render Response Schemas](#render-response-schemas)
        - [QueuedResponse()](#queuedresponse)
        - [QueuedResponseData()](#queuedresponsedata)
        - [RenderResponse()](#renderresponse)
        - [RenderResponseData()](#renderresponsedata)
    - [Template Response Schemas](#template-response-schemas)
        - [TemplateResponse()](#templateresponse)
        - [TemplateResponseData()](#templateresponsedata)
        - [TemplateDataResponse()](#templatedataresponse)
        - [TemplateDataResponseData()](#templatedataresponsedata)
        - [TemplateListResponse()](#templatelistresponse)
        - [TemplateListResponseData()](#templatelistresponsedata)
        - [TemplateListResponseItem()](#templatelistresponseitem)
    - [Inspecting Media](#inspecting-media)
        - [Probe Example](#probe-example)
    - [Probe Schemas](#probe-schemas)
        - [ProbeResponse()](#proberesponse)
    - [Managing Assets](#managing-assets)
        - [Assets by Render ID Example](#assets-by-render-id-example)
        - [Assets by Asset ID Example](#assets-by-asset-id-example)
    - [Asset Schemas](#asset-schemas)
        - [AssetResponse()](#assetresponse)
        - [AssetRenderResponse()](#assetrenderresponse)
        - [AssetResponseData()](#assetresponsedata)
        - [AssetResponseAttributes()](#assetresponseattributes)
- [API Documentation and Guides](#api-documentation-and-guides)

Using the PHP SDK
=================

[](#using-the-php-sdk)

### Requirements

[](#requirements)

Requires PHP7.4+ and uses Guzzle7.3+.

### Installation

[](#installation)

The recommended way to use the SDK is as a composer package. Install using the command:

```
composer require shotstack/shotstack-sdk-php
```

Video Editing
-------------

[](#video-editing)

The Shotstack SDK enables programmatic video editing via the Edit API `render` endpoint. Prepare JSON edits using the provided schema classes and `POST` to the API for rendering.

### Video Editing Example

[](#video-editing-example)

The example below trims the start of a video clip and plays it for 8 seconds. The edit is prepared using the SDK models and then sent to the API for rendering.

```
