123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- <?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->createMediaSuperResolutionJobs(array(
- 'Bucket' => 'examplebucket-125000000',
- 'Tag' => 'SuperResolution',
- 'Input' => array(
- 'Object' => 'video01.mp4'
- ),
- 'Operation' => array(
- 'TemplateId' =>'t19ea5e0c0b7054d7b904axxxxxxxxxxx',
- 'TranscodeTemplateId' =>'t0b612860a293f41078xxxxxxxxxxx',
- 'WatermarkTemplateId' =>'t185e2e24551b24259a02xxxxxxxxxxx',
- 'DigitalWatermark' => array(
- 'Message' => 'xxx',
- 'Type' => 'Text',
- 'Version' => 'V1',
- 'IgnoreError' => 'true',
- ),
- 'Output' => array(
- 'Region' => $region,
- 'Bucket' => 'examplebucket-125000000',
- 'Object' => 'SuperResolution.flv',
- ),
- ),
- 'CallBack' => '',
- ));
-
- print_r($result);
-
-
- $result = $cosClient->createMediaSuperResolutionJobs(array(
- 'Bucket' => 'examplebucket-125000000',
- 'Tag' => 'SuperResolution',
- 'Input' => array(
- 'Object' => 'video01.mp4'
- ),
- 'Operation' => array(
- 'SuperResolution' => array(
- 'Resolution' => '',
- 'EnableScaleUp' => '',
- ),
- 'Transcode' => array(
- 'Tag' => '',
- 'Name' => '',
- 'Container' => array(
- 'Format' => '',
- ),
- 'Video' => array(
- 'Codec' => '',
- 'Width' => '',
- 'Height' => '',
- 'Fps' => '',
- 'Remove' => '',
- 'Profile' => '',
- 'Bitrate' => '',
- 'Crf' => '',
- 'Gop' => '',
- 'Preset' => '',
- 'Bufsize' => '',
- 'Maxrate' => '',
- 'HlsTsTime' => '',
- 'Pixfmt' => '',
- 'LongShortMode' => '',
- ),
- 'TimeInterval' => array(
- 'Start' => '',
- 'Duration' => '',
- ),
- 'Audio' => array(
- 'Codec' => '',
- 'Samplerate' => '',
- 'Bitrate' => '',
- 'Channels' => '',
- 'Remove' => '',
- 'KeepTwoTracks' => '',
- 'SwitchTrack' => '',
- 'SampleFormat' => '',
- ),
- 'TransConfig' => array(
- 'AdjDarMethod' => '',
- 'IsCheckReso' => '',
- 'ResoAdjMethod' => '',
- 'IsCheckVideoBitrate' => '',
- 'VideoBitrateAdjMethod' => '',
- 'IsCheckAudioBitrate' => '',
- 'AudioBitrateAdjMethod' => '',
- 'DeleteMetadata' => '',
- 'IsHdr2Sdr' => '',
- 'HlsEncrypt' => array(
- 'IsHlsEncrypt' => '',
- 'UriKey' => '',
- ),
- ),
- ),
- 'Watermark' => array(
- 'Type' => '',
- 'Pos' => '',
- 'LocMode' => '',
- 'Dx' => '',
- 'Dy' => '',
- 'StartTime' => '',
- 'EndTime' => '',
- 'Image' => array(
- 'Url' => '',
- 'Mode' => '',
- 'Width' => '',
- 'Height' => '',
- 'Transparency' => '',
- 'Background' => '',
- ),
- 'Text' => array(
- 'FontSize' => '',
- 'FontType' => '',
- 'FontColor' => '',
- 'Transparency' => '',
- 'Text' => '',
- ),
- ),
- 'DigitalWatermark' => array(
- 'Message' => '',
- 'Type' => '',
- 'Version' => '',
- 'IgnoreError' => '',
- ),
- 'Output' => array(
- 'Region' => $region,
- 'Bucket' => 'examplebucket-125000000',
- 'Object' => 'SuperResolution.flv',
- ),
- ),
- 'CallBack' => '',
- ));
-
- print_r($result);
-
- } catch (\Exception $e) {
-
- echo($e);
- }
|