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
Also, the path to save the file, the method of request, and [request options](http://docs.guzzlephp.org/en/stable/request-options.html) can be passed to the method.
Amazon S3 or Amazon Simple Storage Service is a service offered by [Amazon Web Services (AWS)](https://aws.amazon.com/) that provides object storage through a web service interface. [learn more](https://en.wikipedia.org/wiki/Amazon_S3)
99
129
@@ -104,10 +134,10 @@ For downloading a file from Amazon S3, you need to pass an array as configuratio
104
134
105
135
```php
106
136
$config = [
107
-
'version' => 'latest',
108
-
'region' => 'us-west-1',
137
+
'version' => 'latest',
138
+
'region' => 'us-west-1',
109
139
'credentials' => [
110
-
'key' => 'my-access-key-id',
140
+
'key' => 'my-access-key-id',
111
141
'secret' => 'my-secret-access-key',
112
142
]
113
143
];
@@ -137,6 +167,8 @@ $video->DASH()
137
167
Also, You can create multi-representations video files using `Representation` object:
138
168
139
169
```php
170
+
use Streaming\Representation;
171
+
140
172
$rep_1 = (new Representation())->setKiloBitrate(800)->setResize(1080 , 720);
141
173
$rep_2 = (new Representation())->setKiloBitrate(300)->setResize(640 , 360);
142
174
@@ -161,22 +193,24 @@ Create HLS files based on original video(auto generate qualities).
161
193
```php
162
194
$video->HLS()
163
195
->X264()
164
-
->autoGenerateRepresentations()
196
+
->autoGenerateRepresentations([720, 360]) // You can limit the numbers of representatons
165
197
->save();
166
198
```
167
199
168
200
Create multi-qualities video files using `Representation` object(set bit-rate and size manually):
169
201
170
202
```php
203
+
use Streaming\Representation;
204
+
171
205
$rep_1 = (new Representation())->setKiloBitrate(1000)->setResize(1080 , 720);
172
206
$rep_2 = (new Representation())->setKiloBitrate(500)->setResize(640 , 360);
173
207
$rep_3 = (new Representation())->setKiloBitrate(200)->setResize(480 , 270);
174
208
175
209
$video->HLS()
176
210
->X264()
177
-
->addRepresentation($rep_1) // Add a representation
178
-
->addRepresentation($rep_2) // Add a representation
179
-
->addRepresentation($rep_3) // Add a representation
211
+
->addRepresentation($rep_1)
212
+
->addRepresentation($rep_2)
213
+
->addRepresentation($rep_3)
180
214
->setHlsTime(5) // Set Hls Time. Default value is 10
181
215
->setHlsAllowCache(false) // Default value is true
It can also be null. The default path is the input path.
304
+
305
+
```php
306
+
$hls = $video->HLS()
307
+
->X264()
308
+
->autoGenerateRepresentations();
309
+
310
+
$hls->save();
311
+
```
312
+
-**NOTE:** If you opened a file from cloud and did not pass a path to save a file, then you have to pass a local path to the `save` method.
313
+
314
+
#### 2. To a Cloud
315
+
You can save your files to cloud using `saveToCloud` method. This package uses [Guzzle](http://docs.guzzlephp.org/en/stable/index.html) to send and receive files.
316
+
317
+
- Before you get started, please read the Guzzle Document found **[here](http://docs.guzzlephp.org/en/stable/index.html)**.
For more information, please read [AWS SDK for PHP](https://aws.amazon.com/sdk-for-php/) document.
288
380
381
+
-**NOTE:** You can mix opening and saving options together. For Instance, you can open a file and save packaged files to Cloud (or vice versa).
382
+
289
383
### Other Advanced Features
290
384
You can easily use other advanced features in the [PHP-FFMpeg](https://github.com/PHP-FFMpeg/PHP-FFMpeg) library. In fact, when you open a file with `open` method(or `fromURL`), it holds the Media object that belongs to the PHP-FFMpeg.
0 commit comments