Bundle multiple processing parameters into a reusable style to simplify media, document, or image processing.
Data processing APIs and SDKs are available in regions with Intelligent Media Management (IMM) endpoints.
Use custom styles
Create a style
A bucket supports up to 50 styles, which apply only to files in that bucket. To request more styles, contact technical support.
-
Based on your file type, choose IMG, Document Processing, or Media Processing.
-
Select the Style Management tab, and then click Create Style.
-
In the Create Style panel, configure the style.
-
Click OK.
Use a style
Use a style to process files through an object URL (synchronous) or an asynchronous request.
Synchronous processing with an object URL
To process an object synchronously, append the style to its URL: http(s)://BucketName.Endpoint/ObjectName?x-oss-process=style/StyleName. The following table describes the parameters.
|
Parameter |
Description |
Example |
|
|
The object URL. Obtain URLs for one or more files. |
|
|
|
Fixed prefix for style-based processing. |
|
|
|
The name of the custom style. |
Simplify the URL with a custom separator and a custom domain name:
-
Use the separator
!to replacex-oss-process=style/. -
Map a custom domain name to the bucket to further simplify the URL.
For example, if you map the custom domain name example.com to the bucket, you can use https://example.com/example.jpg!small to process the image.
Since October 9, 2022 (UTC+8), online preview is disabled for new buckets without a mapped custom domain. Official announcement.
Asynchronous processing with a style
Use x-oss-async-process=style/StyleName to asynchronously process a file:
POST /ObjectName?x-oss-async-process HTTP/1.1
Host: video-demo.oss-cn-hangzhou.aliyuncs.com
Date: Fri, 28 Oct 2022 06:40:10 GMT
Authorization: OSS4-HMAC-SHA256 Credential=LTAI********************/20250417/cn-hangzhou/oss/aliyun_v4_request,Signature=a7c3554c729d71929e0b84489addee6b2e8d5cb48595adfc51868c299c0c218e
// Asynchronously process the file example.avi with the StyleName style and save the output to oss://outbucket/outobjprefix.mp4.
x-oss-async-process=style/StyleName|sys/saveas,b_b3V0YnVja2V0,o_b3V0b2JqcHJlZml4LnthdXRvZXh0fQ
The following table describes the parameters.
|
Parameter |
Description |
|
|
The name of the object. |
|
|
Fixed prefix for style-based processing. |
|
|
The name of the custom style. |
Use built-in styles
OSS also provides built-in styles for file processing.
Asynchronous processing with a style
Use x-oss-async-process=style/::systemStyleName to asynchronously process a file with a built-in style:
POST /ObjectName?x-oss-async-process HTTP/1.1
Host: video-demo.oss-cn-hangzhou.aliyuncs.com
Date: Fri, 28 Oct 2022 06:40:10 GMT
Authorization: OSS4-HMAC-SHA256 Credential=LTAI********************/20250417/cn-hangzhou/oss/aliyun_v4_request,Signature=a7c3554c729d71929e0b84489addee6b2e8d5cb48595adfc51868c299c0c218e
// Asynchronously process the file example.avi with the built-in style h264-mp4-1080p and save the output to oss://outbucket/outobjprefix.mp4.
x-oss-async-process=style/::h264-mp4-1080p|sys/saveas,b_b3V0YnVja2V0,o_b3V0b2JqcHJlZml4LnthdXRvZXh0fQ
The following table describes the parameters.
|
Parameter |
Description |
|
|
The name of the object. |
|
|
Fixed prefix for style-based processing. |
|
|
Prefix for a built-in style. |
|
|
The built-in style name. Note
You can view all supported built-in style parameters on the Data Processing>Media Processing page. |
Import styles between buckets
This feature supports only IMG styles.
Export styles from a source bucket and import them into a destination bucket to reuse the same image processing styles.
-
Export the styles from the source bucket.
-
On the management page of the source bucket, choose Data Processing>IMG.
-
On the IMG page, click Export Style.
-
In the dialog box that appears, select a location to save the style file, and then click Save.
-
-
Import the styles into the destination bucket.