You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-2Lines changed: 7 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,7 @@ For examples of how to use the SDK to create videos using code checkout the PHP
12
12
13
13
## Contents <!-- omit in toc -->
14
14
-[Using the PHP SDK](#using-the-php-sdk)
15
+
-[Requirements](#requirements)
15
16
-[Installation](#installation)
16
17
-[Video Editing](#video-editing)
17
18
-[Video Editing Example](#video-editing-example)
@@ -64,6 +65,10 @@ For examples of how to use the SDK to create videos using code checkout the PHP
64
65
-[API Documentation and Guides](#api-documentation-and-guides)
65
66
66
67
# Using the PHP SDK
68
+
### Requirements
69
+
70
+
Requires PHP7.3+ and uses Guzzle7.3+.
71
+
67
72
### Installation
68
73
69
74
The recommended way to use the SDK is as a composer package. Install using the command:
@@ -734,7 +739,7 @@ setFormat(string $format) | The output format and type of media file to generate
734
739
setResolution(string $resolution) | The output resolution of the video or image. <ul><li>`preview` - 512px x 288px @ 15fps</li><li>`mobile` - 640px x 360px @ 25fps</li><li>`sd` - 1024px x 576px @ 25fps</li><li>`hd` - 1280px x 720px @ 25fps</li><li>`1080` - 1920px x 1080px @ 25fps</li></ul> | -
735
740
setAspectRatio(string $aspectRatio) | The aspect ratio (shape) of the video or image. Useful for social media output formats. Options are: <ul><li>`16:9` - regular landscape/horizontal aspect ratio (default)</li><li>`9:16` - vertical/portrait aspect ratio</li><li>`1:1` - square aspect ratio</li><li>`4:5` - short vertical/portrait aspect ratio</li><li>`4:3` - legacy TV aspect ratio</li></ul> | -
736
741
setSize([\Shotstack\Client\Model\Size](#size) $size) | Set a custom size for a video or image. When using a custom size omit the `resolution` and `aspectRatio`. Custom sizes must be divisible by 2 based on the encoder specifications. | -
737
-
setFps(int $fps) | Override the default frames per second. Useful for when the source footage is recorded at 30fps, i.e. on mobile devices. Lower frame rates can be used to add cinematic quality (24fps) or to create smaller file size/faster render times or animated gifs (12 or 15fps). Default is 25fps. <ul><li>`12` - 12fps</li><li>`15` - 15fps</li><li>`24` - 24fps</li><li>`25` - 25fps</li><li>`30` - 30fps</li></ul> | -
742
+
setFps(float $fps) | Override the default frames per second. Useful for when the source footage is recorded at 30fps, i.e. on mobile devices. Lower frame rates can be used to add cinematic quality (24fps) or to create smaller file size/faster render times or animated gifs (12 or 15fps). Default is 25fps. <ul><li>`12` - 12fps</li><li>`15` - 15fps</li><li>`23.976` - 23.976fps</li><li>`24` - 24fps</li><li>`25` - 25fps</li><li>`29.97` - 29.97fps</li><li>`30` - 30fps</li></ul> | -
738
743
setScaleTo(string $scaleTo) | Override the resolution and scale the video or image to render at a different size. When using scaleTo the asset should be edited at the resolution dimensions, i.e. use font sizes that look best at HD, then use scaleTo to output the file at SD and the text will be scaled to the correct size. This is useful if you want to create multiple asset sizes. <ul><li>`preview` - 512px x 288px @ 15fps</li><li>`mobile` - 640px x 360px @ 25fps</li><li>`sd` - 1024px x 576px @25fps</li><li>`hd` - 1280px x 720px @25fps</li><li>`1080` - 1920px x 1080px @25fps</li></ul> | -
739
744
setQuality(string $quality) | Adjust the output quality of the video, image or audio. Adjusting quality affects render speed, download speeds and storage requirements due to file size. The default `medium` provides the most optimized choice for all three factors. <ul><li>`low` - slightly reduced quality, smaller file size</li><li>`medium` - optimized quality, render speeds and file size</li><li>`high` - slightly increased quality, larger file size</li></ul> | -
740
745
setRepeat(bool $repeat) | Loop settings for gif files. Set to `true` to loop, `false` to play only once. [default to `true`] | -
@@ -1104,4 +1109,4 @@ getUpdated(): string | The time the asset status was last updated. | -
1104
1109
-[Getting Started Guide](https://shotstack.io/docs/guide/getting-started/core-concepts/)
Copy file name to clipboardExpand all lines: src/Api/EditApi.php
+63-49Lines changed: 63 additions & 49 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
<?php
2
2
/**
3
3
* EditApi
4
-
* PHP version 7.2
4
+
* PHP version 7.3
5
5
*
6
6
* @category Class
7
7
* @package Shotstack\Client
@@ -15,9 +15,8 @@
15
15
* Shotstack is a video, image and audio editing service that allows for the automated generation of videos, images and audio using JSON and a RESTful API. You arrange and configure an edit and POST it to the API which will render your media and provide a file location when complete. For more details visit [shotstack.io](https://shotstack.io) or checkout our [getting started](https://shotstack.gitbook.io/docs/guides/getting-started) documentation. There are two main API's, one for editing and generating assets (Edit API) and one for managing hosted assets (Serve API). The Edit API base URL is: <b>https://api.shotstack.io/{version}</b> The Serve API base URL is: <b>https://api.shotstack.io/serve/{version}</b>
16
16
*
17
17
* The version of the OpenAPI document: v1
18
-
*
19
18
* Generated by: https://openapi-generator.tech
20
-
* OpenAPI Generator version: 5.0.0
19
+
* OpenAPI Generator version: 5.4.0
21
20
*/
22
21
23
22
/**
@@ -28,9 +27,12 @@
28
27
29
28
namespaceShotstack\Client\Api;
30
29
30
+
error_reporting(E_ALL & ~E_DEPRECATED);
31
+
31
32
useGuzzleHttp\Client;
32
33
useGuzzleHttp\ClientInterface;
33
34
useGuzzleHttp\Exception\RequestException;
35
+
useGuzzleHttp\Exception\ConnectException;
34
36
useGuzzleHttp\Psr7\MultipartStream;
35
37
useGuzzleHttp\Psr7\Request;
36
38
useGuzzleHttp\RequestOptions;
@@ -92,7 +94,7 @@ public function __construct(
92
94
*
93
95
* @param int $hostIndex Host index (required)
94
96
*/
95
-
publicfunctionsetHostIndex($hostIndex)
97
+
publicfunctionsetHostIndex($hostIndex): void
96
98
{
97
99
$this->hostIndex = $hostIndex;
98
100
}
@@ -158,10 +160,17 @@ public function getRenderWithHttpInfo($id, $data = null, $merged = null)
0 commit comments