1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <?php
- require dirname(__FILE__) . '/../vendor/autoload.php';
- $secretId = "SECRETID";
- $secretKey = "SECRETKEY";
- $region = "ap-beijing";
- $cosClient = new Qcloud\Cos\Client(
- array(
- 'region' => $region,
- 'schema' => 'https',
- 'credentials'=> array(
- 'secretId' => $secretId ,
- 'secretKey' => $secretKey)));
- try {
-
- $result = $cosClient->createMediaConcatJobs(array(
- 'Bucket' => 'examplebucket-125000000',
- 'Tag' => 'Concat',
- 'QueueId' => 'asdadadfafsdkjhfjghdfjg',
- 'CallBack' => 'https://example.com/callback',
- 'Input' => array(
- 'Object' => 'video01.mp4'
- ),
- 'Operation' => array(
- 'TemplateId' => 'asdfafiahfiushdfisdhfuis',
- 'Output' => array(
- 'Region' => $region,
- 'Bucket' => 'examplebucket-125000000',
- 'Object' => 'concat-video02.mp4',
- ),
- ),
- ));
-
- print_r($result);
-
-
- $result = $cosClient->createMediaConcatJobs(array(
- 'Bucket' => 'examplebucket-125000000',
- 'Tag' => 'Concat',
- 'QueueId' => 'asdadadfafsdkjhfjghdfjg',
- 'CallBack' => 'https://example.com/callback',
- 'Input' => array(
- 'Object' => 'video01.mp4'
- ),
- 'Operation' => array(
- 'Output' => array(
- 'Region' => $region,
- 'Bucket' => 'examplebucket-125000000',
- 'Object' => 'concat-video03.mp4',
- ),
- 'ConcatTemplate' => array(
- 'ConcatFragments' => array(
- array(
- 'Url' => 'https://example.com/video01.mp4',
- 'Mode' => 'Start',
- ),
- array(
- 'Url' => 'https://example.com/video02.mp4',
- 'Mode' => 'Start',
- ),
-
- ),
- 'Index' => 1,
- 'Container' => array(
- 'Format' => 'mp4'
- ),
- 'Audio' => array(
- 'Codec' => 'mp3',
- 'Samplerate' => '',
- 'Bitrate' => '',
- 'Channels' => '',
- ),
- 'Video' => array(
- 'Codec' => 'H.264',
- 'Bitrate' => '1000',
- 'Width' => '1280',
- 'Height' => '',
- 'Fps' => '30',
- ),
- ),
- ),
- ));
-
- print_r($result);
-
- } catch (\Exception $e) {
-
- echo($e);
- }
|