123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <?php
- require dirname(__FILE__, 2) . '/vendor/autoload.php';
- $secretId = "SECRETID";
- $secretKey = "SECRETKEY";
- $region = "ap-beijing";
- $cosClient = new Qcloud\Cos\Client(
- array(
- 'region' => $region,
- 'scheme' => 'https',
- 'credentials'=> array(
- 'secretId' => $secretId,
- 'secretKey' => $secretKey)));
- try {
-
-
- $result = $cosClient->createMediaSegmentVideoBodyJobs(array(
- 'Bucket' => 'examplebucket-125000000',
- 'Tag' => 'SegmentVideoBody',
- 'Input' => array(
- 'Object' => 'input/test.mp4',
- ),
- 'Operation' => array(
- 'TemplateId' => '',
- 'Output' => array(
- 'Region' => $region,
- 'Bucket' => 'examplebucket-125000000',
- 'Object' => 'output/out.mp4',
- ),
- ),
- ));
-
- print_r($result);
-
-
- $result = $cosClient->createMediaSegmentVideoBodyJobs(array(
- 'Bucket' => 'examplebucket-125000000',
- 'Tag' => 'SegmentVideoBody',
- 'Input' => array(
- 'Object' => 'input/test.mp4',
- ),
- 'Operation' => array(
- 'SegmentVideoBody' => array(
- 'Mode' => 'Mask',
- 'SegmentType' => '',
- 'BackgroundGreen' => '',
- 'BackgroundBlue' => '',
- 'BackgroundLogoUrl' => '',
- 'BinaryThreshold' => '',
- 'RemoveRed' => '',
- 'RemoveGreen' => '',
- 'RemoveBlue' => '',
- ),
- 'Output' => array(
- 'Region' => $region,
- 'Bucket' => 'examplebucket-125000000',
- 'Object' => 'output/out.mp4',
- ),
- ),
- ));
-
- print_r($result);
-
- } catch (\Exception $e) {
-
- echo($e);
- }
|