tencent cloud

Cloud Object Storage

Release Notes and Announcements
Release Notes
Announcements
Product Introduction
Overview
Features
Use Cases
Strengths
Concepts
Regions and Access Endpoints
Specifications and Limits
Service Regions and Service Providers
Billing
Billing Overview
Billing Method
Billable Items
Free Tier
Billing Examples
Viewing and Downloading Bill
Payment Overdue
FAQs
Getting Started
Console
Getting Started with COSBrowser
User Guide
Creating Request
Bucket
Object
Data Management
Batch Operation
Global Acceleration
Monitoring and Alarms
Operations Center
Data Processing
Content Moderation
Smart Toolbox
Data Processing Workflow
Application Integration
User Tools
Tool Overview
Installation and Configuration of Environment
COSBrowser
COSCLI (Beta)
COSCMD
COS Migration
FTP Server
Hadoop
COSDistCp
HDFS TO COS
GooseFS-Lite
Online Tools
Diagnostic Tool
Use Cases
Overview
Access Control and Permission Management
Performance Optimization
Accessing COS with AWS S3 SDK
Data Disaster Recovery and Backup
Domain Name Management Practice
Image Processing
Audio/Video Practices
Workflow
Direct Data Upload
Content Moderation
Data Security
Data Verification
Big Data Practice
COS Cost Optimization Solutions
Using COS in the Third-party Applications
Migration Guide
Migrating Local Data to COS
Migrating Data from Third-Party Cloud Storage Service to COS
Migrating Data from URL to COS
Migrating Data Within COS
Migrating Data Between HDFS and COS
Data Lake Storage
Cloud Native Datalake Storage
Metadata Accelerator
GooseFS
Data Processing
Data Processing Overview
Image Processing
Media Processing
Content Moderation
File Processing Service
File Preview
Troubleshooting
Obtaining RequestId
Slow Upload over Public Network
403 Error for COS Access
Resource Access Error
POST Object Common Exceptions
API Documentation
Introduction
Common Request Headers
Common Response Headers
Error Codes
Request Signature
Action List
Service APIs
Bucket APIs
Object APIs
Batch Operation APIs
Data Processing APIs
Job and Workflow
Content Moderation APIs
Cloud Antivirus API
SDK Documentation
SDK Overview
Preparations
Android SDK
C SDK
C++ SDK
.NET(C#) SDK
Flutter SDK
Go SDK
iOS SDK
Java SDK
JavaScript SDK
Node.js SDK
PHP SDK
Python SDK
React Native SDK
Mini Program SDK
Error Codes
Harmony SDK
Endpoint SDK Quality Optimization
Security and Compliance
Data Disaster Recovery
Data Security
Cloud Access Management
FAQs
Popular Questions
General
Billing
Domain Name Compliance Issues
Bucket Configuration
Domain Names and CDN
Object Operations
Logging and Monitoring
Permission Management
Data Processing
Data Security
Pre-signed URL Issues
SDKs
Tools
APIs
Agreements
Service Level Agreement
Privacy Policy
Data Processing And Security Agreement
Contact Us
Glossary

Video Enhancement Job APIs

PDF
Focus Mode
Font Size
Last updated: 2024-02-04 15:40:24

Overview

This document provides an overview of APIs and SDK code samples for submitting a video enhancement job.
API
Description
Submits a video enhancement job.

Submitting Video Enhancement Job

Feature description

This API is used to submit a video enhancement job.

Method prototype

public Guzzle\\Service\\Resource\\Model createMediaVideoProcessJobs(array $args = array());

Sample request

Sample 1. Using a template

<?php

require dirname(__FILE__) . '/../vendor/autoload.php';

$secretId = "SECRETID"; //Replace it with the actual `SecretId`, which can be viewed and managed in the CAM console at https://console.tencentcloud.com/cam/capi
$secretKey = "SECRETKEY"; //Replace it with the actual `SecretKey`, which can be viewed and managed in the CAM console at https://console.tencentcloud.com/cam/capi
$region = "ap-beijing"; // Replace it with the actual region, which can be viewed in the console at https://console.tencentcloud.com/cos5/bucket.
$cosClient = new Qcloud\\Cos\\Client(
array(
'region' => $region,
'schema' => 'https', // Protocol, which is `http` by default
'credentials'=> array(
'secretId' => $secretId ,
'secretKey' => $secretKey)));
try {
$result = $cosClient->createMediaVideoProcessJobs(array(
'Bucket' => 'examplebucket-1250000000', // Bucket name in the format of `BucketName-Appid`, which can be viewed in the COS console at https://console.tencentcloud.com/cos5/bucket.
'Tag' => 'VideoProcess',
'QueueId' => 'p81e648afxxxxxxxxxxxxxxxxx',
'Input' => array(
'Object' => 'video01.mp4'
),
'Operation' => array(
'TemplateId' => 't13466f1ea41a14c0xxxxxxxxxxxxx', // Video enhancement template ID
'TranscodeTemplateId' => 't0b6a845f5e42847bd81xxxxxxxxxxxxx', // Transcoding template ID
'WatermarkTemplateId' => 't185e2e24551b24259a0xxxxxxxxxxxxx', // Watermark template ID
'Output' => array(
'Region' => $region,
'Bucket' => 'examplebucket-1250000000', // Bucket name in the format of `BucketName-Appid`, which can be viewed in the COS console at https://console.tencentcloud.com/cos5/bucket.
'Object' => 'VideoProcess.flv',
),
// 'UserData' => 'xxx', // The user information passed through.
// 'JobLevel' => '0', // Job priority. The greater the value, the higher the priority. Valid values: `0`, `1`, `2`. Default value: `0`.
),
'CallBack' => '',
));
// Request succeeded
print_r($result);
} catch (\\Exception $e) {
// Request failed
echo($e);
}

Sample 2. Customizing parameters

<?php

require dirname(__FILE__) . '/../vendor/autoload.php';

$secretId = "SECRETID"; //Replace it with the actual `SecretId`, which can be viewed and managed in the CAM console at https://console.tencentcloud.com/cam/capi
$secretKey = "SECRETKEY"; //Replace it with the actual `SecretKey`, which can be viewed and managed in the CAM console at https://console.tencentcloud.com/cam/capi
$region = "ap-beijing"; // Replace it with the actual region, which can be viewed in the console at https://console.tencentcloud.com/cos5/bucket.
$cosClient = new Qcloud\\Cos\\Client(
array(
'region' => $region,
'schema' => 'https', // Protocol, which is `http` by default
'credentials'=> array(
'secretId' => $secretId ,
'secretKey' => $secretKey)));
try {
$result = $cosClient->createMediaVideoProcessJobs(array(
'Bucket' => 'examplebucket-1250000000', // Bucket name in the format of `BucketName-Appid`, which can be viewed in the COS console at https://console.tencentcloud.com/cos5/bucket.
'Tag' => 'VideoProcess',
'QueueId' => 'p81e648afxxxxxxxxxxxxxxxxx',
'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-1250000000', // Bucket name in the format of `BucketName-Appid`, which can be viewed in the COS console at https://console.tencentcloud.com/cos5/bucket.
'Object' => 'VideoProcess.flv',
),
// 'UserData' => 'xxx', // The user information passed through.
// 'JobLevel' => '0', // Job priority. The greater the value, the higher the priority. Valid values: `0`, `1`, `2`. Default value: `0`.
),
'CallBack' => '',
));
// Request succeeded
print_r($result);
} catch (\\Exception $e) {
// Request failed
echo($e);
}

Parameter description

Request has the following sub-nodes:
Node Name (Keyword)
Parent Node
Description
Type
Required
Tag
Request
Job tag: VideoProcess
String
Yes
Input
Request
Information of the media file to be processed
Container
Yes
Operation
Request
Operation rule
Container
Yes
QueueId
Request
Queue ID of the job
String
Yes
CallBackFormat
Request
Job callback format, which can be JSON or XML (default value). It takes priority over that of the queue.
String
No
CallBackType
Request
Job callback type, which can be Url (default value) or TDMQ. It takes priority over that of the queue.
String
No
CallBack
Request
Job callback address, which takes priority over that of the queue. If it is set to no, no callbacks will be generated at the callback address of the queue.
String
No
CallBackMqConfig
Request
TDMQ configuration for job callback as described in Structure, which is required if CallBackType is TDMQ.
Container
No
Input has the following sub-nodes:
Node Name (Keyword)
Parent Node
Description
Type
Required
Object
Request.Input
Media filename
String
Yes
Operation has the following sub-nodes:
Node Name (Keyword)
Parent Node
Description
Type
Required
VideoProcess
Request.Operation
Video enhancement template parameter. This node and TemplateId cannot be empty at the same time.
Container
No
TemplateId
Request.Operation
Template ID. This node and VideoProcess cannot be empty at the same time.
String
No
Transcode
Request.Operation
Transcoding template parameter. This node and TranscodeTemplateId cannot be empty at the same time.
Container
No
TranscodeTemplateId
Request.Operation
Transcoding template ID. This node and Transcode cannot be empty at the same time. Use this node first.
String array
No
Watermark
Request.Operation
Watermark template parameter. Same as Request.Watermark in the watermark template creation API CreateMediaTemplate. Up to three watermarks can be passed in.
Container array
No
WatermarkTemplateId
Request.Operation
Watermark template ID. Up to three watermark template IDs can be passed in. If Watermark and WatermarkTemplateId exist at the same time, use WatermarkTemplateId first.
String
No
DigitalWatermark
Request.Operation
Specifies the digital watermark parameter
Container
No
Output
Request.Operation
Result output address
Container
Yes
JobLevel
Request.Operation
Job priority. The greater the value, the higher the priority. Valid values: 0, 1, 2. Default value: 0.
String
No
Note:
To submit a video enhancement job, you must pass in the transcoding parameter. For the video enhancement parameter, TemplateId is used first, and if TemplateId is unavailable, VideoProcess is used. For the transcoding parameter, TranscodeTemplateId is used first, and if TranscodeTemplateId is unavailable, Transcode is used. For the watermark parameter, WatermarkTemplateId or Watermark can be used for configuration, and WatermarkTemplateId is used first.
VideoProcess has the following sub-nodes:
Node Name (Keyword)
Parent Node
Description
ColorEnhance
Request.Operation.VideoProcess
Same as Request.ColorEnhance in the video enhancement template creation API CreateMediaTemplate.
MsSharpen
Request.Operation.VideoProcess
Same as Request.MsSharpen in the video enhancement template creation API CreateMediaTemplate.
Transcode has the following sub-nodes:
Node Name (Keyword)
Parent Node
Description
Type
Required
TimeInterval
Request.Operation.Transcode
Same as Request.TimeInterval in the transcoding template creation API CreateMediaTemplate.
Container
No
Container
Request.Operation.Transcode
Same as Request.Container in the transcoding template creation API CreateMediaTemplate.
Container
No
Video
Request.Operation.Transcode
Same as Request.Video in the transcoding template creation API CreateMediaTemplate.
Container
No
Audio
Request.Operation.Transcode
Same as Request.Audio in the transcoding template creation API CreateMediaTemplate.
Container
No
TransConfig
Request.Operation.Transcode
Same as Request.TransConfig in the transcoding template creation API CreateMediaTemplate.
Container
No
AudioMix
Request.Operation.Transcode
Audio mix parameter as described in Structure.
Container array
No
DigitalWatermark has the following sub-nodes:
Node Name (Keyword)
Parent Node
Description
Type
Required
Message
Request.Operation.DigitalWatermark
The string embedded by the digital watermark, which can contain up to 64 letters, digits, underscores (_), hyphens (-), and asterisks (*).
string
Yes
Type
Request.Operation.DigitalWatermark
Watermark type, which currently can be set to Text only
String
Yes
Version
Request.Operation.DigitalWatermark
Watermark version, which currently can be set to V1 only
String
Yes
IgnoreError
Request.Operation.DigitalWatermark
Whether to ignore the watermarking failure and continue the job. Valid values: true, false (default)
string
Yes
Output has the following sub-nodes:
Node Name (Keyword)
Parent Node
Description
Type
Required
Region
Request.Operation.Output
Bucket region
String
Yes
Bucket
Request.Operation.Output
Result storage bucket
String
Yes
Object
Request.Operation.Output
Result file name
String
Yes

Sample response

GuzzleHttp\\Command\\Result Object
(
[Body] => GuzzleHttp\\Psr7\\Stream Object
(
[stream:GuzzleHttp\\Psr7\\Stream:private] => Resource id #88
[size:GuzzleHttp\\Psr7\\Stream:private] =>
[seekable:GuzzleHttp\\Psr7\\Stream:private] => 1
[readable:GuzzleHttp\\Psr7\\Stream:private] => 1
[writable:GuzzleHttp\\Psr7\\Stream:private] => 1
[uri:GuzzleHttp\\Psr7\\Stream:private] => php://temp
[customMetadata:GuzzleHttp\\Psr7\\Stream:private] => Array
(
)

)

[RequestId] => NjI2MjNjYHAOIHDOIADJHOIA18yMjFlMWE=
[ContentType] => application/xml
[ContentLength] => 965
[Bucket] => examplebucket-1250000000
[Location] => examplebucket-1250000000.ci.ap-beijing.myqcloud.com/jobs
[Response] => Array
(
[JobsDetail] => Array
(
[Code] => Success
[CreationTime] => 2022-04-22T11:19:15+0800
[EndTime] => -
[Input] => Array
(
[BucketId] => examplebucket-1250000000
[Object] => video01.mp4
[Region] => ap-beijing
)

[JobId] => jfd27519z8zx90c8z90c7809z9f35eb
[Message] =>
[Operation] => Array
(
[Output] => Array
(
[Bucket] => examplebucket-1250000000
[Object] => VideoProcess.flv
[Region] => ap-beijing
)

[TemplateId] => t13466f1eazx08c09zx8c09zx8e9cd
[TemplateName] => video-process-1
[TranscodeTemplateId] => t0b612860z087xc09zx8c09xz8c095dca38
[WatermarkTemplateId] => t185e2e24zxc780z8c0z98c323c6428a19c
[UserData] => xxx
[JobLevel] => 0
)

[QueueId] => p81e648af2aee496885zx098c09z8xc09zxc086
[StartTime] => -
[State] => Submitted
[Tag] => VideoProcess
)

)

)


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback