123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- require dirname(__FILE__, 2) . '/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->createMediaSegmentJobs(array(
- 'Bucket' => 'examplebucket-125000000',
- 'Tag' => 'Segment',
- 'QueueId' => 'p81e648af2aee496885707ca0xxxxxxxxx',
- 'Input' => array(
- 'Object' => 'video01.mp4'
- ),
- 'Operation' => array(
- 'Segment' => array(
- 'Format' => 'mkv',
- 'Duration' => '5',
- 'HlsEncrypt' => array(
- 'IsHlsEncrypt' => 'false',
- 'UriKey' => '',
- ),
- ),
- 'Output' => array(
- 'Region' => $region,
- 'Bucket' => 'examplebucket-125000000',
- 'Object' => 'Segment-trans${Number}.mkv',
- ),
- ),
- 'CallBack' => '',
- ));
-
- print_r($result);
- } catch (\Exception $e) {
-
- echo($e);
- }
|