123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- <?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->createMediaVideoProcessJobs(array(
- 'Bucket' => 'examplebucket-125000000',
- 'Tag' => 'VideoProcess',
- 'Input' => array(
- 'Object' => 'video01.mp4'
- ),
- 'Operation' => array(
- 'TemplateId' => 't13466f1ea41a14c0xxxxxxxxxxxxx',
- 'TranscodeTemplateId' => 't0b6a845f5e42847bd81xxxxxxxxxxxxx',
- 'WatermarkTemplateId' => 't185e2e24551b24259a0xxxxxxxxxxxxx',
- 'Output' => array(
- 'Region' => $region,
- 'Bucket' => 'examplebucket-125000000',
- 'Object' => 'VideoProcess.flv',
- ),
- ),
- 'CallBack' => '',
- ));
-
- print_r($result);
-
-
- $result = $cosClient->createMediaVideoProcessJobs(array(
- 'Bucket' => 'examplebucket-125000000',
- 'Tag' => 'VideoProcess',
- 'Input' => array(
- 'Object' => 'video01.mp4'
- ),
- 'Operation' => array(
- 'VideoProcess' => array(
- 'ColorEnhance' => array(
- 'Enable' => '',
- 'Contrast' => '',
- 'Correction' => '',
- 'Saturation' => '',
- ),
- 'MsSharpen' => array(
- 'Enable' => '',
- 'SharpenLevel' => '',
- ),
- ),
- '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' => '',
- ),
- ),
- 'Output' => array(
- 'Region' => $region,
- 'Bucket' => 'examplebucket-125000000',
- 'Object' => 'VideoProcess.flv',
- ),
- ),
- 'CallBack' => '',
- ));
-
- print_r($result);
-
- } catch (\Exception $e) {
-
- echo($e);
- }
|