Bu konuda sys/saveas parametresinin kavramı, kullanım notları ve parametre açıklaması ele alınır; ayrıca parametrenin nasıl kullanılacağına ilişkin örnekler sunulur.
sys/saveas nedir?
Varsayılan olarak eşzamanlı işlenen bir nesne kaydedilmez. İşlenmiş nesneyi belirli bir pakette kaydetmek için istekte sys/saveas parametresini belirtmeniz gerekir. Eşzamansız işleme bir görev biçiminde yürütülür. İstek için yalnızca görev kimliği döndürülür. Bu nedenle isteği göndermeden önce isteğe sys/saveas parametresini eklemeniz gerekir. Bu durumda işlenmiş nesne sonraki erişimler için belirli bir pakette saklanır.
Kullanım notları
-
Gerekli izinler:
-
İşlenmiş bir nesneyi kaydetmek için kaynak nesnenin depolandığı kaynak paket üzerinde
oss:PostProcessTaskiznine ve işlenmiş nesne üzerindeoss:PutObjectiznine sahip olmanız gerekir. -
İşlenmiş bir nesnenin erişim kontrol listesi (ACL), nesneyi kaydetmek istediğiniz paketin ACL'si ile aynıdır ve değiştirilemez.
-
-
Bölge gereksinimleri: İşlenmiş nesneyi kaynak nesnenin depolandığı aynı pakete veya farklı bir pakete kaydedebilirsiniz. Ancak kaynak paket ve hedef paket aynı Alibaba Cloud hesabına ait olmalı ve aynı bölgede bulunmalıdır.
-
Depolama yöntemi: Nesne URL'leri kullanılarak işlenen nesneleri doğrudan belirli bir pakete kaydedemezsiniz. İşlenmiş nesneleri yerel bilgisayarınıza kaydedip ardından hedef pakete yükleyebilirsiniz.
-
İşlenmiş nesnelerin depolama süresi: İşlenmiş bir nesneyi belirli bir süre boyunca depolamak istiyorsanız nesnenin ne zaman sona ereceğini belirtmek için nesne üzerinde bir yaşam döngüsü kuralı yapılandırın. Daha fazla bilgi için bkz. Overview.
Parametre açıklaması
Bir istekte sys/saveas parametresini belirtirseniz aşağıdaki tabloda açıklanan seçenekleri belirtmeniz gerekir.
|
Seçenek |
Açıklama |
|
o |
İşlenmiş nesnenin adı. Bu seçeneğin değeri URL safe Base64 kodlu olmalıdır. Daha fazla bilgi için bkz. Watermark encoding. Not
o seçeneği değişkenleri destekler. Değişkenler {varname} biçiminde veya dizeler ile {varname} kombinasyonu şeklindedir. Daha fazla bilgi için bkz. Variables. |
|
b |
İşlenmiş nesneyi kaydetmek istediğiniz paketin adı. Bu seçeneğin değeri URL safe Base64 kodlu olmalıdır. Bu seçenek belirtilmezse işlenmiş nesne kaynak nesnenin depolandığı pakete kaydedilir. Not
b seçeneği değişkenleri destekler. Değişkenler {varname} biçiminde veya dizeler ile {varname} kombinasyonu şeklindedir. Daha fazla bilgi için bkz. Variables. |
OSS SDK'larını kullanma
OSS SDK'ları kullanılarak işlenen nesneyi belirli bir pakete kaydetmek için bir istekte sys/saveas parametresini belirtebilirsiniz. Aşağıdaki örnek kod, yaygın programlama dilleri için OSS SDK'ları kullanılarak gerçekleştirilen görüntü işleme sonucunun nasıl kaydedileceğine ilişkin örnekler sunar. Diğer programlama dilleri için OSS SDK'ları kullanılarak işlenen nesnenin nasıl kaydedileceği hakkında daha fazla bilgi için bkz. SDK'ye Genel Bakış.
import com.aliyun.oss.*;
import com.aliyun.oss.common.auth.*;
import com.aliyun.oss.common.comm.SignVersion;
import com.aliyun.oss.common.utils.BinaryUtil;
import com.aliyun.oss.common.utils.IOUtils;
import com.aliyun.oss.model.GenericResult;
import com.aliyun.oss.model.ProcessObjectRequest;
import java.util.Formatter;
public class Demo {
public static void main(String[] args) throws Throwable {
// Specify the endpoint of the region. In this example, the endpoint of the China (Hangzhou) region is used. Specify your actual endpoint.
String endpoint = "https://oss-cn-hangzhou.aliyuncs.com";
// Specify the ID of the region that maps to the endpoint. Example: cn-hangzhou.
String region = "cn-hangzhou";
// We recommend that you do not save access credentials in the project code. Otherwise, access credentials may be leaked, which compromises the security of all resources in your account. In this example, access credentials are obtained from environment variables. Before you run the sample code, make sure that the environment variables are configured.
EnvironmentVariableCredentialsProvider credentialsProvider = CredentialsProviderFactory.newEnvironmentVariableCredentialsProvider();
// Specify the name of the bucket. Example: examplebucket.
String bucketName = "examplebucket";
// Specify the full path of the object that you want to process. Do not include the bucket name in the full path.
String sourceImage = "exampleimage.png";
// Create an OSSClient instance.
// Call the shutdown method to release resources when the OSSClient is no longer in use.
ClientBuilderConfiguration clientBuilderConfiguration = new ClientBuilderConfiguration();
// Explicitly declare the use of the V4 signature algorithm.
clientBuilderConfiguration.setSignatureVersion(SignVersion.V4);
OSS ossClient = OSSClientBuilder.create()
.endpoint(endpoint)
.credentialsProvider(credentialsProvider)
.clientConfiguration(clientBuilderConfiguration)
.region(region)
.build();
try {
// Resize the image to 100 × 100 pixels.
StringBuilder sbStyle = new StringBuilder();
Formatter styleFormatter = new Formatter(sbStyle);
String styleType = "image/resize,m_fixed,w_100,h_100";
// Save the processed image as example-resize.png to the current bucket.
// Specify the full path of the object that you want to process. Do not include the bucket name in the full path.
String targetImage = "example-resize.png";
styleFormatter.format("%s|sys/saveas,o_%s,b_%s", styleType,
BinaryUtil.toBase64String(targetImage.getBytes()),
BinaryUtil.toBase64String(bucketName.getBytes()));
System.out.println(sbStyle.toString());
ProcessObjectRequest request = new ProcessObjectRequest(bucketName, sourceImage, sbStyle.toString());
GenericResult processResult = ossClient.processObject(request);
String json = IOUtils.readStreamAsString(processResult.getResponse().getContent(), "UTF-8");
processResult.getResponse().getContent().close();
System.out.println(json);
} catch (OSSException oe) {
System.out.println("Caught an OSSException, which means your request made it to OSS, "
+ "but was rejected with an error response for some reason.");
System.out.println("Error Message:" + oe.getErrorMessage());
System.out.println("Error Code:" + oe.getErrorCode());
System.out.println("Request ID:" + oe.getRequestId());
System.out.println("Host ID:" + oe.getHostId());
} catch (ClientException ce) {
System.out.println("Caught an ClientException, which means the client encountered "
+ "a serious internal problem while trying to communicate with OSS, "
+ "such as not being able to access the network.");
System.out.println("Error Message:" + ce.getMessage());
} finally {
if (ossClient != null) {
ossClient.shutdown();
}
}
}
}<?php
if (is_file(__DIR__ . '/../autoload.php')) {
require_once __DIR__ . '/../autoload.php';
}
if (is_file(__DIR__ . '/../vendor/autoload.php')) {
require_once __DIR__ . '/../vendor/autoload.php';
}
use OSS\OssClient;
// Obtain access credentials from environment variables. Before you run the sample code, make sure that the OSS_ACCESS_KEY_ID and OSS_ACCESS_KEY_SECRET environment variables are configured.
$accessKeyId = getenv("OSS_ACCESS_KEY_ID");
$accessKeySecret = getenv("OSS_ACCESS_KEY_SECRET");
// Specify the endpoint of the region in which the bucket is located. For example, if the bucket is located in the China (Hangzhou) region, set the endpoint to https://oss-cn-hangzhou.aliyuncs.com.
$endpoint = "yourEndpoint";
// Specify the name of the bucket. Example: examplebucket.
$bucket= "examplebucket";
// Specify the full path of the source object. Example: exampledir/exampleobject.jpg. Do not include the bucket name in the full path.
$object = "exampledir/exampleobject.jpg";
// Specify the full path to which you want to save the processed object. Example: example-new.jpg.
$save_object = "example-new.jpg";
function base64url_encode($data)
{
return rtrim(strtr(base64_encode($data), '+/', '-_'), '=');
}
$ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint, false);
// If the source image that you want to process does not exist in the source bucket, you must upload the image to the source bucket from D:\\localpath\\exampleobject.jpg.
// $ossClient->uploadFile($bucket, $object, "D:\\localpath\\exampleobject.jpg");
// Resize the image to 100 × 100 pixels and rotate the image 90 degrees.
$style = "image/resize,m_fixed,w_100,h_100/rotate,90";
$process = $style.
'|sys/saveas'.
',o_'.base64url_encode($save_object).
',b_'.base64url_encode($bucket);
// Save the processed image as example-new.png to the current bucket.
$result = $ossClient->processObject($bucket, $object, $process);
// Display the processing result.
print($result);const OSS = require('ali-oss');
const client = new OSS({
// Specify the region in which the bucket is located. For example, if the bucket is located in the China (Hangzhou) region, set the region to oss-cn-hangzhou.
region: 'yourregion',
// Obtain access credentials from environment variables. Before you run the sample code, make sure that the OSS_ACCESS_KEY_ID and OSS_ACCESS_KEY_SECRET environment variables are configured.
accessKeyId: process.env.OSS_ACCESS_KEY_ID,
accessKeySecret: process.env.OSS_ACCESS_KEY_SECRET,
// Specify the name of the source bucket.
bucket: 'yourbucketname'
});
const sourceImage = 'sourceObject.png';
const targetImage = 'targetObject.jpg';
async function processImage(processStr, targetBucket) {
const result = await client.processObjectSave(
sourceImage,
targetImage,
processStr,
targetBucket
);
console.log(result.res.status);
}
// Resize the image and save the processed image.
processImage("image/resize,m_fixed,w_100,h_100")
// Crop the image and save the processed image.
processImage("image/crop,w_100,h_100,x_100,y_100,r_1")
// Rotate the image and save the processed image.
processImage("image/rotate,90")
// Sharpen the image and save the processed image.
processImage("image/sharpen,100")
// Add watermarks to the image and save the processed image.
processImage("image/watermark,text_SGVsbG8g5Zu-54mH5pyN5YqhIQ")
// Convert the image format and save the processed image.
processImage("image/format,jpg")
// Convert the format of the image and configure the destination bucket to which you want to save the processed image.
processImage("image/format,jpg", "target bucket")# -*- coding: utf-8 -*-
import os
import base64
import oss2
from oss2.credentials import EnvironmentVariableCredentialsProvider
# Obtain access credentials from environment variables. Before you run the sample code, make sure that the OSS_ACCESS_KEY_ID and OSS_ACCESS_KEY_SECRET environment variables are configured.
auth = oss2.ProviderAuth(EnvironmentVariableCredentialsProvider())
# Specify the endpoint of the region in which the bucket is located. For example, if the bucket is located in the China (Hangzhou) region, set the endpoint to https://oss-cn-hangzhou.aliyuncs.com.
endpoint = 'https://oss-cn-hangzhou.aliyuncs.com'
# Specify the name of the bucket in which the source image is stored.
source_bucket_name = 'srcbucket'
# Specify the name of the bucket to which you want to save the processed image. The bucket must be located in the same region as the source bucket.
target_bucket_name = 'destbucket'
# Specify the name of the source image. If the image is not stored in the root directory of the bucket, you must specify the full path of the image. Example: example/example.jpg.
source_image_name = 'example/example.jpg'
# Specify the bucket client. You must use the bucket client to call all object-related methods.
bucket = oss2.Bucket(auth, endpoint, source_bucket_name)
# Resize the image to 100 × 100 pixels.
style = 'image/resize,m_fixed,w_100,h_100'
# Specify the name of the processed image. If the image is not stored in the root directory of the bucket, you must specify the full path of the image. Example: exampledir/example.jpg.
target_image_name = 'exampledir/example.jpg'
process = "{0}|sys/saveas,o_{1},b_{2}".format(style,
oss2.compat.to_string(base64.urlsafe_b64encode(oss2.compat.to_bytes(target_image_name))),
oss2.compat.to_string(base64.urlsafe_b64encode(oss2.compat.to_bytes(target_bucket_name))))
result = bucket.process_object(source_image_name, process)
print(result)package main
import (
"encoding/base64"
"fmt"
"os"
"github.com/aliyun/aliyun-oss-go-sdk/oss"
)
// HandleError handles an error: it prints the error and exits.
func HandleError(err error) {
fmt.Println("Error:", err)
os.Exit(-1)
}
func main() {
/// Obtain access credentials from environment variables. Before you run the sample code, make sure that the OSS_ACCESS_KEY_ID and OSS_ACCESS_KEY_SECRET environment variables are configured.
provider, err := oss.NewEnvironmentVariableCredentialsProvider()
if err != nil {
fmt.Println("Error:", err)
os.Exit(-1)
}
// Create an OSSClient instance.
// Specify the endpoint of the region in which the bucket is located. For example, if the bucket is located in the China (Hangzhou) region, set the endpoint to https://oss-cn-hangzhou.aliyuncs.com. Specify your actual endpoint.
client, err := oss.New("yourEndpoint", "", "", oss.SetCredentialsProvider(&provider))
if err != nil {
fmt.Println("Error:", err)
os.Exit(-1)
}
// Specify the name of the bucket in which the source image is stored. Example: srcbucket.
bucketName := "srcbucket"
bucket, err := client.Bucket(bucketName)
if err != nil {
HandleError(err)
}
// Specify the name of the source image. If the source image is not stored in the root directory of the bucket, you must specify the full path of the image. Example: example/example.jpg.
sourceImageName := "example/example.jpg"
// Specify the name of the destination bucket. The destination bucket must be located in the same region as the source bucket.
targetBucketName := "destbucket"
// Specify the name of the processed image. If the image is not stored in the root directory of the bucket, you must specify the full path of the image. Example: exampledir/example.jpg.
targetImageName := "exampledir/example.jpg"
// Resize the image to 100 × 100 pixels and save the image to a specific bucket.
style := "image/resize,m_fixed,w_100,h_100"
process := fmt.Sprintf("%s|sys/saveas,o_%v,b_%v", style, base64.URLEncoding.EncodeToString([]byte(targetImageName)), base64.URLEncoding.EncodeToString([]byte(targetBucketName)))
result, err := bucket.ProcessObject(sourceImageName, process)
if err != nil {
HandleError(err)
} else {
fmt.Println(result)
}
} #include <alibabacloud/oss/OssClient.h>
#include <sstream>
using namespace AlibabaCloud::OSS;
int main(void)
{
/* Initialize information about the account that is used to access OSS. */
/* Specify the endpoint of the region in which the bucket is located. For example, if the bucket is located in the China (Hangzhou) region, set the endpoint to https://oss-cn-hangzhou.aliyuncs.com. */
std::string Endpoint = "yourEndpoint";
/* Specify the name of the source bucket. Example: examplebucket. */
std::string BucketName = "examplebucket";
/* Specify the name of the source image. If the source image is not stored in the root directory of the bucket, you must specify the full path of the image. Example: example/example.jpg. */
std::string SourceObjectName = "example/example.jpg";
/* Specify the name of the processed image. If the image is not stored in the root directory of the bucket, you must specify the full path of the image. Example: exampledir/example.jpg. */
std::string TargetObjectName = "exampledir/example.jpg";
/* Initialize resources, such as network resources. */
InitializeSdk();
ClientConfiguration conf;
/* Obtain access credentials from environment variables. Before you run the sample code, make sure that the OSS_ACCESS_KEY_ID and OSS_ACCESS_KEY_SECRET environment variables are configured. */
auto credentialsProvider = std::make_shared<EnvironmentVariableCredentialsProvider>();
OssClient client(Endpoint, credentialsProvider, conf);
/* Resize the image to 100 × 100 pixels and save the image to the current bucket. */
std::string Process = "image/resize,m_fixed,w_100,h_100";
std::stringstream ss;
ss << Process
<<"|sys/saveas"
<< ",o_" << Base64EncodeUrlSafe(TargetObjectName)
<< ",b_" << Base64EncodeUrlSafe(BucketName);
ProcessObjectRequest request(BucketName, SourceObjectName, ss.str());
auto outcome = client.ProcessObject(request);
/* Release resources, such as network resources. */
ShutdownSdk();
return 0;
}RESTful API'yi kullanma
İşletmenizin yüksek düzeyde özelleştirme gerektirmesi durumunda doğrudan OSS RESTful API'lerini çağırabilirsiniz. Bunun için imza hesaplamasını kodunuza dahil etmeniz gerekir.
Bir görüntüyü işlemek için PostObject işlemini çağırabilir ve PostObject isteğinin ileti gövdesinde x-oss-process parametresini iletebilirsiniz. Ardından işlenmiş görüntüyü belirli bir pakete kaydetmek için istekte sys/saveas parametresini belirtin. Daha fazla bilgi için bkz. PostObject.
Aşağıdaki örnek kod, işlenmiş bir nesneyi belirli bir pakete kaydetmeye ilişkin örnekler sunar:
Bir görüntüyü işlemek için işleme parametrelerini kullanma ve işlenmiş nesneyi belirli bir pakete kaydetme
POST /ObjectName?x-oss-process HTTP/1.1
Host: oss-example.oss.aliyuncs.com
Content-Length: 247
Date: Fri, 04 May 2012 03:21:12 GMT
Authorization: OSS4-HMAC-SHA256 Credential=LTAI********************/20250417/cn-hangzhou/oss/aliyun_v4_request,AdditionalHeaders=content-length,Signature=a7c3554c729d71929e0b84489addee6b2e8d5cb48595adfc51868c299c0c218e
// Proportionally resize the source image named test.jpg to a width of 100 pixels and save the processed image to the test bucket.
x-oss-process=image/resize,w_100|sys/saveas,o_dGVzdC5qcGc,b_dGVzdA
Bir görüntüyü işlemek için stil parametrelerini kullanma ve işlenmiş nesneyi belirli bir pakete kaydetme
POST /ObjectName?x-oss-process HTTP/1.1
Host: oss-example.oss.aliyuncs.com
Content-Length: 247
Date: Fri, 04 May 2012 03:22:13 GMT
Authorization: OSS4-HMAC-SHA256 Credential=LTAI********************/20250417/cn-hangzhou/oss/aliyun_v4_request,AdditionalHeaders=content-length,Signature=a7c3554c729d71929e0b84489addee6b2e8d5cb48595adfc51868c299c0c218e
// Use a style named examplestyle to process the source image named test.jpg and save the processed image to the test bucket.
x-oss-process=style/examplestyle|sys/saveas,o_dGVzdC5qcGc,b_dGVzdA
Bir belgeyi dönüştürmek için işleme parametrelerini kullanma ve işlenmiş nesneyi belirli bir pakete kaydetme
Kaynak ve hedef nesnelere ilişkin bilgiler
-
Kaynak nesne
-
Nesne biçimi: DOCX
-
Kaynak nesne adı:
example.docx
-
-
Hedef nesne
-
Nesne biçimi: PNG
-
Depolama yolu:
oss://test-bucket/doc_images/
-
Örnek istek
POST /exmaple.docx?x-oss-async-process HTTP/1.1
Host: doc-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
// Change the format of the example.docx object from DOCX to PNG and store the processed image in oss://test-bucket/doc_images/.
x-oss-async-process=doc/convert,target_png,source_docx|sys/saveas,b_dGVzdC1idWNrZXQ,o_ZG9jX2ltYWdlcy97aW5kZXh9LnBuZw
Bir belgeyi dönüştürmek için stil parametrelerini kullanma ve işlenmiş nesneyi belirli bir pakete kaydetme
Kaynak ve hedef nesnelere ilişkin bilgiler
-
Kaynak nesne
-
Nesne biçimi: DOCX
-
Kaynak nesne adı:
example.docx
-
-
Hedef nesne
Depolama yolu:
oss://test-bucket/doc_images/
Örnek istek
POST /exmaple.docx?x-oss-async-process HTTP/1.1
Host: doc-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
// Use the examplestyle style to process the example.docx object and store the processed object in oss://test-bucket/doc_images/.
x-oss-async-process=style/examplestyle|sys/saveas,b_dGVzdC1idWNrZXQ,o_ZG9jX2ltYWdlcy97aW5kZXh9LnBuZw
Bir videoyu transkode etmek için işleme parametrelerini kullanma ve işlenmiş nesneyi belirli bir pakete kaydetme
Kaynak ve hedef nesnelere ilişkin bilgiler
-
Kaynak nesne
-
Video biçimi: AVI
-
Video adı:
example.avi
-
-
Hedef nesne
-
Video bilgileri
-
Video biçimi: MP4
-
Video adı:
outobjprefix.mp4 -
Video akış biçimi: H.265
-
Video çözünürlüğü: 1920 × 1080
-
Video kare hızı: 30 fps
-
Video bit hızı: 2 Mbit/s
-
-
Ses bilgileri
-
Ses akış biçimi: AAC
-
Ses bit hızı: 100 Kbit/s
-
Altyazı akışı: devre dışı bırakıldı
-
-
Video depolama yolu:
oss://outbucket/outobj.mp4
-
Örnek istek
POST /exmaple.avi?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
// Transcode the example.avi object to change the object format to MP4, video stream format to H.265, resolution to 1920 × 1080, frame rate to 30 fps, video bit rate to 2 Mbit/s, audio stream format to AAC, and the audio bit rate to 100 Kbit/s, and disable the subtitle stream. After transcoding, save the processed object as oss://outbucket/outobj.mp4.
x-oss-async-process=video/convert,f_mp4,vcodec_h265,s_1920x1080,vb_2000000,fps_30,acodec_aac,ab_100000,sn_1|sys/saveas,o_b3V0b2JqLnthdXRvZXh0fQo,o_b3V0b2JqcHJlZml4LnthdXRvZXh0fQ
Bir videoyu transkode etmek için stil parametrelerini kullanma ve işlenmiş nesneyi belirli bir pakete kaydetme
Kaynak ve hedef nesnelere ilişkin bilgiler
-
Kaynak nesne
-
Video biçimi: AVI
-
Video adı:
example.avi
-
-
Hedef nesne
-
Video biçimi: MP4
-
Video adı:
outobjprefix.mp4 -
Video depolama yolu:
oss://outbucket/outobjprefix.mp4
-
Örnek istek
POST /exmaple.avi?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
// Use the examplestyle style to transcode the example.avi object and save the processed object as oss://outbucket/outobjprefix.mp4.
x-oss-async-process=style/examplestyle|sys/saveas,b_b3V0YnVja2V0,o_b3V0b2JqcHJlZml4LnthdXRvZXh0fQ
Bir videoyu animasyonlu çıkartmaya dönüştürmek için işleme parametrelerini kullanma ve işlenmiş nesneyi belirli bir pakete kaydetme
Kaynak ve hedef nesnelere ilişkin bilgiler
-
Kaynak nesne
-
Video adı: example.mkv
-
-
Hedef nesne
-
Animasyonlu çıkartma
-
Biçim: GIF
-
Video aralığı: 1 sn
-
Çözünürlük: 100 × 100
-
-
Nesne depolama yolu
-
oss://outbucket/outobjprefix.gif
-
-
Örnek istek
POST /exmaple.mkv?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
// Transform the example.mkv object into an animated sticker whose format is GIF, size is 100 × 100 pixels, and interval is 1 second. After the transformation is complete, save the processed object as oss://outbucket/outobjprefix.gif.
x-oss-async-process=video/animation,f_gif,w_100,h_100,inter_1000|sys/saveas,b_b3V0YnVja2V0,o_b3V0b2JqcHJlZml4LnthdXRvZXh0fQ
Bir videoyu animasyonlu çıkartmaya dönüştürmek için stil parametrelerini kullanma ve işlenmiş nesneyi belirli bir pakete kaydetme
Kaynak ve hedef nesnelere ilişkin bilgiler
-
Kaynak nesne
-
Video adı: example.mkv
-
-
Animasyonlu çıkartma
-
Biçim: GIF
-
-
Hedef nesne
-
Nesne depolama yolu
-
oss://outbucket/outobjprefix.gif
-
-
Örnek istek
POST /example.mkv?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
// Use the examplestyle style to transform the example.mkv object into an animated sticker. After the transformation is complete, save the processed object as oss://outbucket/outobjprefix.gif.
x-oss-async-process=style/examplestyle|sys/saveas,b_b3V0YnVja2V0,o_b3V0b2JqcHJlZml4LnthdXRvZXh0fQ
Bir videodan sprite anlık görüntüler yakalamak için işleme parametrelerini kullanma ve sprite anlık görüntüleri belirli bir pakete kaydetme
Kaynak ve hedef nesnelere ilişkin bilgiler
-
Kaynak nesne
-
Video adı: example.mkv
-
-
Hedef nesne
-
Sprite anlık görüntüler
-
Biçim: JPG
-
Sprite anlık görüntü yakalama zaman aralığı: 10 sn
-
Alt görüntü çözünürlüğü: 100 × 100
-
Sprite anlık görüntü yapılandırmaları: Bir satırda 10 görüntü. Bir sütunda 10 görüntü. Dolgu ve kenar boşluğu her ikisi de 0'dır.
-
-
Nesne depolama yolu
-
oss://outbucket/outobjprefix-%d.jpg
-
-
Örnek istek
POST /example.mkv?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
// Capture sprite snapshots from the example.mkv object.
x-oss-async-process=video/sprite,f_jpg,sw_100,sh_100,inter_10000,tw_10,th_10,pad_0,margin_0|sys/saveas,b_b3V0YnVja2V0,o_b3V0b2JqcHJlZml4LXtpbmRleH0ue2F1dG9leHR9Cg
Bir videodan sprite anlık görüntüler yakalamak için stil parametrelerini kullanma ve sprite anlık görüntüleri belirli bir pakete kaydetme
Kaynak ve hedef nesnelere ilişkin bilgiler
-
Kaynak nesne
-
Video adı: example.mkv
-
-
Hedef nesne
-
Sprite anlık görüntüler
-
Biçim: JPG
-
-
Nesne depolama yolu
-
oss://outbucket/outobjprefix-%d.jpg
-
-
Örnek istek
POST /example.mkv?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
// Use the examplestyle style to capture sprite snapshots from the example.mkv object.
x-oss-async-process=style/examplestyle|sys/saveas,b_b3V0YnVja2V0,o_b3V0b2JqcHJlZml4LXtpbmRleH0ue2F1dG9leHR9Cg
Bir videodan anlık görüntüler yakalamak için işleme parametrelerini kullanma ve anlık görüntüleri belirli bir pakete kaydetme
Kaynak ve hedef nesnelere ilişkin bilgiler
-
Kaynak nesne
-
Video adı: example.mkv
-
-
Hedef nesne
-
Anlık görüntü bilgileri
-
Biçim: JPG
-
Anlık görüntü yakalama zaman aralığı: 10 sn
-
Çözünürlük: 100 × 100
-
-
Nesne depolama yolu
-
oss://outbucket/outobjprefix-%d.jpg
-
-
Örnek istek
POST /example.mkv?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
// Capture video snapshots from the example.mkv object.
x-oss-async-process=video/snapshots,f_jpg,w_100,h_100,scaletype_crop,inter_10000|sys/saveas,b_b3V0YnVja2V0,o_b3V0b2JqcHJlZml4LXtpbmRleH0ue2F1dG9leHR9Cg
Bir videodan anlık görüntüler yakalamak için stil parametrelerini kullanma ve anlık görüntüleri belirli bir pakete kaydetme
Kaynak ve hedef nesnelere ilişkin bilgiler
-
Kaynak nesne
-
Video adı: example.mkv
-
-
Hedef nesne
-
Anlık görüntü bilgileri
-
Biçim: JPG
-
-
Nesne depolama yolu
-
oss://outbucket/outobjprefix-%d.jpg
-
-
Örnek istek
POST /example.mkv?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
// Use the examplestyle style to capture video snapshots from the example.mkv object.
x-oss-async-process=style/examplestyle|sys/saveas,b_b3V0YnVja2V0,o_b3V0b2JqcHJlZml4LXtpbmRleH0ue2F1dG9leHR9Cg
Videoları birleştirmek için işleme parametrelerini kullanma ve birleştirilmiş videoyu belirli bir pakete kaydetme
Kaynak ve hedef nesnelere ilişkin bilgiler
-
Kaynak nesneler
-
Video adları: pre.mov, example.mkv, sur.mov
-
-
Birleştirme yöntemi
-
Süre ve sıra:
Video adı
Sıra
Süre
pre.mov
1
Tüm video
example.mkv
2
10. saniyeden videonun sonuna kadar
sur.mov
3
Videonun başlangıcından 10. saniyeye kadar
-
-
Hedef nesne
-
Video bilgileri
-
Video biçimi: h264
-
Video kare hızı: 25 fps
-
Video bit hızı: 1 Mbit/s
-
-
Ses bilgileri
-
Ses biçimi: AAC
-
Ses yapılandırmaları: 48 kHz örnekleme hızı ve stereo ses kanalları
-
Ses bit hızı: 96 Kbit/s
-
-
Nesne depolama yolu
-
oss://outbucket/outobjprefix.mp4
-
-
Örnek istek
POST /example.mkv?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
// Merge pre.mov, example.mkv, and sur.mov into a new video based on the preceding requirements.
x-oss-async-process=video/concat,ss_10000,f_mp4,vcodec_h264,fps_25,vb_1000000,acodec_aac,ab_96000,ar_48000,ac_2,align_1/pre,o_cHJlLm1vdgo/sur,o_c3VyLm1vdg,t_10000|sys/saveas,b_b3V0YnVja2V0,o_b3V0b2JqcHJlZml4LnthdXRvZXh0fQ
Bir ses nesnesini transkode etmek için işleme parametrelerini kullanma ve işlenmiş nesneyi belirli bir pakete kaydetme
Kaynak ve hedef nesnelere ilişkin bilgiler
-
Kaynak nesne
-
Ses biçimi: MP3
-
Ses adı: example.mp3
-
-
İşleme yöntemi
-
Transkod süresi: Ses nesnesinin 1.000. milisaniyesinden başlar ve 60.000 milisaniye sürer
-
-
Hedef nesne
-
Ses bilgileri
-
Ses biçimi: AAC
-
Ses yapılandırmaları: Orijinal örnekleme hızını ve ses kanallarını koru
-
Ses bit hızı: 96 Kbit/s
-
-
Nesne depolama yolu
-
oss://outbucket/outobjprefix.aac
-
-
Örnek istek
POST /exmaple.mp3?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
// Perform audio transcoding on example.mp3.
x-oss-async-process=audio/convert,ss_10000,t_60000,f_aac,ab_96000|sys/saveas,b_b3V0YnVja2V0,o_b3V0b2JqcHJlZml4LnthdXRvZXh0fQ
Bir ses nesnesini transkode etmek için stil parametrelerini kullanma ve işlenmiş nesneyi belirli bir pakete kaydetme
Kaynak ve hedef nesnelere ilişkin bilgiler
-
Kaynak nesne
-
Ses biçimi: MP3
-
Ses adı: example.mp3
-
-
Hedef nesne
-
Ses bilgileri
-
Ses biçimi: AAC
-
-
Nesne depolama yolu
-
oss://outbucket/outobjprefix.aac
-
-
Örnek istek
POST /exmaple.mp3?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
// Use the examplestyle style to perform audio transcoding on the example.mp3 object.
x-oss-async-process=style/examplestyle|sys/saveas,b_b3V0YnVja2V0,o_b3V0b2JqcHJlZml4LnthdXRvZXh0fQ
Ses nesnelerini birleştirmek için işleme parametrelerini kullanma ve birleştirilmiş sesi belirli bir pakete kaydetme
Kaynak ve hedef nesnelere ilişkin bilgiler
-
Kaynak nesneler
-
Ses adları: pre1.mp3, pre2.wav, example.mp3, sur1.aac ve sur2.wma
-
-
Birleştirme yöntemi
-
Süre ve sıra:
Ses adı
Sıra
Süre
pre1.mp3
1
Tüm ses nesnesi
pre2.wav
2
İlk 2 saniye
example.mp3
3
Tüm ses nesnesi
sur1.aac
4
4. saniyeden 10. saniyeye kadar
sur2.wma
5
10. saniyeden ses nesnesinin sonuna kadar
-
-
Hedef nesne
-
Ses bilgileri
-
Ses biçimi: AAC
-
Ses yapılandırmaları: 48 kHz örnekleme hızı ve mono ses kanalı
-
Ses bit hızı: 96 Kbit/s
-
-
Nesne depolama yolu
-
oss://outbucket/outobjprefix.aac
-
-
Örnek istek
POST /exmaple.mp3?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
// Merge pre1.mp3, pre2.wav, example.mp3, sur1.aac, and sur2.wma into a new audio object based on the preceding requirements.
x-oss-async-process=audio/concat,f_aac,ab_96000,ar_48000,ac_1,align_2/pre,o_cHJlMS5tcDMK/pre,o_cHJlMi53YXYK,t_2000/sur,o_c3VyMS5hYWMK,ss_4000,t_10000/sur,o_c3VyMi53bWEK,ss_10000|sys/saveas,b_b3V0YnVja2V0,o_b3V0b2JqcHJlZml4LnthdXRvZXh0fQ