updateMediaVideoEnhanceTemplate.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. require dirname(__FILE__, 2) . '/vendor/autoload.php';
  3. $secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
  4. $secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
  5. $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
  6. $cosClient = new Qcloud\Cos\Client(
  7. array(
  8. 'region' => $region,
  9. 'scheme' => 'https', //协议头部,默认为http
  10. 'credentials'=> array(
  11. 'secretId' => $secretId,
  12. 'secretKey' => $secretKey)));
  13. try {
  14. // https://cloud.tencent.com/document/product/460/84745 更新画质增强模板
  15. $result = $cosClient->updateMediaVideoEnhanceTemplate(array(
  16. 'Bucket' => 'examplebucket-125000000', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
  17. 'Key' => '', // TemplateId
  18. 'Tag' => 'VideoEnhance',
  19. 'Name' => 'TemplateName',
  20. 'VideoEnhance' => array(
  21. 'Transcode' => array(
  22. 'Container' => array(
  23. 'Format' => 'mp4',
  24. ),
  25. 'Video' => array(
  26. 'Codec' => 'H.264',
  27. 'Width' => '1280',
  28. 'Height' => '920',
  29. 'Fps' => '30',
  30. ),
  31. 'Audio' => array(
  32. 'Codec' => 'aac',
  33. 'Samplerate' => '44100',
  34. 'Bitrate' => '128',
  35. 'Channels' => '4',
  36. ),
  37. ),
  38. 'SuperResolution' => array(
  39. 'Resolution' => 'sdtohd',
  40. 'EnableScaleUp' => 'true',
  41. 'Version' => 'Enhance',
  42. ),
  43. 'SDRtoHDR' => array(
  44. 'HdrMode' => 'HDR10',
  45. ),
  46. 'ColorEnhance' => array(
  47. 'Contrast' => '50',
  48. 'Correction' => '100',
  49. 'Saturation' => '100',
  50. ),
  51. 'MsSharpen' => array(
  52. 'SharpenLevel' => '5',
  53. ),
  54. 'FrameEnhance' => array(
  55. 'FrameDoubling' => 'true',
  56. ),
  57. ),
  58. ));
  59. // 请求成功
  60. print_r($result);
  61. } catch (\Exception $e) {
  62. // 请求失败
  63. echo($e);
  64. }