Model image-to-video Wan 2.7 mendukung input multimodal (teks, gambar, audio, dan video) serta menjalankan tiga tugas: first-frame-to-video, first-and-last-frame-to-video, dan video continuation.
Referensi: Panduan pengguna
API image-to-video baru (model wan2.7) mendukung ketiga tugas tersebut. API image-to-video dari frame pertama sebelumnya (wan2.6 dan versi lebih lama) hanya mendukung first-frame-to-video.
Ketersediaan
Model, URL endpoint, dan Kunci API harus berada dalam wilayah yang sama. Pemanggilan lintas-wilayah akan gagal.
-
Pilih model: Pastikan model tersedia di wilayah target Anda.
-
Pilih URL: Gunakan URL endpoint yang sesuai dengan wilayah model Anda. URL HTTP dan SDK DashScope didukung.
-
Konfigurasikan Kunci API: Dapatkan Kunci API untuk wilayah tersebut, lalu konfigurasikan Kunci API sebagai Variabel lingkungan.
-
Instal SDK: Untuk melakukan panggilan API menggunakan SDK, instal SDK DashScope.
Kode contoh dalam topik ini berlaku untuk wilayah Singapore.
Domain lama https://dashscope-intl.aliyuncs.com untuk wilayah Singapore akan segera ditinggalkan. Segera migrasikan ke domain baru https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com.
HTTP
API ini menggunakan protokol image-to-video baru dan hanya mendukung model wan2.7.
Tugas image-to-video biasanya memerlukan waktu 1 hingga 5 menit, sehingga API menggunakan pemanggilan asinkron. Alur kerja terdiri dari dua langkah: buat tugas, lalu poll hasilnya.
Langkah 1: Buat tugas dan dapatkan ID tugas
Singapore
POST https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis
Saat memanggil, ganti WorkspaceId dengan Workspace ID yang sebenarnya.
Beijing
POST https://dashscope.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis
-
Setelah tugas dibuat, gunakan
task_idyang dikembalikan untuk mengkueri hasilnya.task_idberlaku selama 24 jam. Jangan membuat tugas duplikat. Sebagai gantinya, gunakan polling untuk mengambil hasilnya. -
Untuk panduan pemula, lihat Postman.
Parameter permintaan |
Generasi video dari frame pertamaBuat video berdasarkan gambar frame pertama dan audio.
Generasi video dari frame pertama dan terakhirGunakan frame pertama dan frame terakhir untuk menghasilkan video.
Kelanjutan videoBuat konten lanjutan berdasarkan klip video awal.
|
|
Content-Type Tipe konten permintaan. Harus berupa |
|
|
Authorization Mengotentikasi permintaan dengan Kunci API Model Studio. Contoh: Bearer sk-xxxx. |
|
|
X-DashScope-Async Mengaktifkan pemrosesan asinkron. Permintaan HTTP hanya mendukung panggilan asinkron. Harus diatur ke Penting
Jika header permintaan ini tidak disertakan, kesalahan "current user api does not support synchronous calls" akan dikembalikan. |
|
Body permintaan |
|
|
model Nama model. Untuk daftar model dan harga, lihat Harga model. Contoh: wan2.7-i2v-2026-04-25. |
|
|
input Informasi input dasar, termasuk prompt. |
|
|
parameters Parameter pemrosesan video: resolusi, durasi, penulisan ulang prompt, dan watermark. |
Parameter respons |
Respons berhasilSimpan
Respons kesalahanPembuatan tugas gagal. Lihat Kode kesalahan.
|
|
output Informasi output tugas. |
|
|
request_id Identifikasi permintaan unik untuk pelacakan dan troubleshooting. |
|
|
code Kode kesalahan. Hanya dikembalikan untuk permintaan yang gagal. Lihat Kode kesalahan. |
|
|
message Pesan kesalahan detail. Hanya dikembalikan untuk permintaan yang gagal. Lihat Kode kesalahan. |
Langkah 2: Kueri hasil berdasarkan ID tugas
Singapore
GET https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/tasks/{task_id}
Saat memanggil, ganti WorkspaceId dengan Workspace ID yang sebenarnya.
Beijing
GET https://dashscope.aliyuncs.com/api/v1/tasks/{task_id}
-
Rekomendasi polling: Generasi video memerlukan beberapa menit. Gunakan mekanisme polling dengan interval yang wajar, misalnya 15 detik.
-
Transisi status tugas: PENDING → RUNNING → SUCCEEDED atau FAILED.
-
Tautan hasil: Setelah tugas berhasil, URL video yang berlaku selama 24 jam dikembalikan. Unduh dan simpan video ke penyimpanan permanen, seperti OSS.
-
task_idmasa berlaku: 24 jam. Setelah periode ini, kueri akan mengembalikan status tugas sebagaiUNKNOWN.
Parameter permintaan |
Kueri hasil tugasGanti |
Header |
|
|
Authorization Mengotentikasi permintaan dengan Kunci API Model Studio. Contoh: Bearer sk-xxxx. |
|
Parameter jalur |
|
|
task_id ID tugas. |
Parameter respons |
Tugas berhasilURL video hanya berlaku selama 24 jam, lalu secara otomatis dihapus. Segera simpan video yang dihasilkan. Tugas gagalSaat tugas gagal,
Kueri tugas kedaluwarsa
|
|
output Informasi output tugas. |
|
|
usage Statistik penggunaan. Dihitung hanya untuk tugas yang berhasil. |
|
|
request_id Identifikasi permintaan unik untuk pelacakan dan troubleshooting. |
DashScope SDK
Nama parameter SDK sesuai dengan API HTTP. Struktur parameter dienkapsulasi berdasarkan konvensi bahasa pemrograman.
Tugas image-to-video biasanya memerlukan waktu 1 hingga 5 menit. SDK mengenkapsulasi proses pemanggilan asinkron HTTP dan mendukung panggilan sinkron maupun asinkron.
Waktu pemrosesan aktual bergantung pada antrian tugas dan beban layanan. Tunggu hasilnya.
SDK Python
Pastikan versi SDK Python DashScope tidak lebih rendah dari 1.25.16 sebelum menjalankan kode berikut.
Jika versinya terlalu lama, kesalahan seperti "url error, please check url!" dapat terjadi. Untuk informasi lebih lanjut, lihat Instal SDK untuk memperbaruinya.
Atur dashscope.base_http_api_url berdasarkan wilayah model:
Singapore
dashscope.base_http_api_url = 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1'
Saat memanggil, ganti WorkspaceId dengan Workspace ID yang sebenarnya.
Beijing
dashscope.base_http_api_url = 'https://dashscope.aliyuncs.com/api/v1'
Panggilan sinkron
Contoh permintaan
# -*- coding: utf-8 -*-
from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope
import os
# Ini adalah URL untuk wilayah Singapore. URL bervariasi berdasarkan wilayah. Untuk informasi lebih lanjut, lihat https://www.alibabacloud.com/help/en/model-studio/image-to-video-general-api-reference
dashscope.base_http_api_url = 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1'
# Jika Anda belum mengonfigurasi variabel lingkungan, ganti baris berikut dengan: api_key="sk-xxx"
# Kunci API bervariasi berdasarkan wilayah. Untuk informasi lebih lanjut, lihat https://www.alibabacloud.com/help/en/model-studio/get-api-key
api_key = os.getenv("DASHSCOPE_API_KEY")
media = [
{
"type": "first_frame",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png"
},
{
"type": "driving_audio",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3"
}
]
def sample_sync_call():
print('----Panggilan sinkron, mohon tunggu sebentar----')
rsp = VideoSynthesis.call(
api_key=api_key,
model="wan2.7-i2v-2026-04-25",
media=media,
resolution="720P",
duration=10,
watermark=True,
prompt="An urban fantasy art scene featuring a dynamic graffiti character. A boy made of spray paint comes to life on a concrete wall. He sings an English rap song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night, lit by a single street lamp. This creates a cinematic atmosphere with high energy and amazing detail. The video's audio consists entirely of the rap, with no other dialogue or noise.",
)
if rsp.status_code == HTTPStatus.OK:
print(rsp.output.video_url)
else:
print('Gagal, status_code: %s, code: %s, message: %s' %
(rsp.status_code, rsp.code, rsp.message))
if __name__ == '__main__':
sample_sync_call()
Contoh respons
video_url berlaku selama 24 jam. Segera unduh video tersebut.
{
"status_code": 200,
"request_id": "ac5faf37-ddfa-9720-a0c5-xxxxxx",
"code": null,
"message": "",
"output": {
"task_id": "b97c6d86-ad73-4bb7-80ff-xxxxxx",
"task_status": "SUCCEEDED",
"video_url": "https://dashscope-a717.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxx",
"submit_time": "2026-04-13 10:45:47.597",
"scheduled_time": "2026-04-13 10:45:56.342",
"end_time": "2026-04-13 10:47:26.273",
"orig_prompt": "An urban fantasy art scene. A dynamic graffiti character. A boy made of spray paint comes to life on a concrete wall. He performs a fast-paced English rap song while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The light comes from a single street lamp, creating a cinematic atmosphere with high energy and incredible detail. The audio consists solely of the rap, with no other dialogue or background noise."
},
"usage": {
"video_count": 1,
"video_duration": 0,
"video_ratio": "",
"duration": 10,
"input_video_duration": 0,
"output_video_duration": 10,
"SR": 720
}
}
Panggilan asinkron
Contoh permintaan
# -*- coding: utf-8 -*-
from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope
import os
# Ini adalah URL untuk wilayah Singapore. URL bervariasi berdasarkan wilayah. Untuk mendapatkan URL wilayah Anda, lihat https://www.alibabacloud.com/help/en/model-studio/image-to-video-general-api-reference
dashscope.base_http_api_url = 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1'
# Jika variabel lingkungan belum diatur, ganti baris berikut dengan: api_key="sk-xxx"
# Kunci API bervariasi berdasarkan wilayah. Untuk mendapatkan Kunci API, lihat https://www.alibabacloud.com/help/en/model-studio/get-api-key
api_key = os.getenv("DASHSCOPE_API_KEY")
media = [
{
"type": "first_frame",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png"
},
{
"type": "driving_audio",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3"
}
]
def sample_async_call():
# Kirim tugas asinkron. Informasi tentang tugas dikembalikan segera.
rsp = VideoSynthesis.async_call(
api_key=api_key,
model="wan2.7-i2v-2026-04-25",
media=media,
resolution="720P",
duration=10,
watermark=True,
prompt="A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life on a concrete wall. He sings an English rap song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The light comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of the rap, with no other dialogue or noise.",
)
print(rsp)
if rsp.status_code == HTTPStatus.OK:
print("task_id: %s" % rsp.output.task_id)
else:
print('Gagal, status_code: %s, code: %s, message: %s' %
(rsp.status_code, rsp.code, rsp.message))
# Kueri status tugas.
status = VideoSynthesis.fetch(task=rsp, api_key=api_key)
if status.status_code == HTTPStatus.OK:
print(status.output.task_status)
else:
print('Gagal, status_code: %s, code: %s, message: %s' %
(status.status_code, status.code, status.message))
# Tunggu hingga tugas selesai.
rsp = VideoSynthesis.wait(task=rsp, api_key=api_key)
print(rsp)
if rsp.status_code == HTTPStatus.OK:
print(rsp.output.video_url)
else:
print('Gagal, status_code: %s, code: %s, message: %s' %
(rsp.status_code, rsp.code, rsp.message))
if __name__ == '__main__':
sample_async_call()
Contoh respons
-
Contoh respons saat membuat tugas
{ "status_code": 200, "request_id": "6dc3bf6c-be18-9268-9c27-xxxxxx", "code": "", "message": "", "output": { "task_id": "686391d9-7ecf-4290-a8e9-xxxxxx", "task_status": "PENDING", "video_url": "" }, "usage": null } -
Contoh respons saat mengkueri hasil tugas
video_url berlaku selama 24 jam. Segera unduh video tersebut.
{ "status_code": 200, "request_id": "ac5faf37-ddfa-9720-a0c5-xxxxxx", "code": null, "message": "", "output": { "task_id": "b97c6d86-ad73-4bb7-80ff-xxxxxx", "task_status": "SUCCEEDED", "video_url": "https://dashscope-a717.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxx", "submit_time": "2026-04-13 10:45:47.597", "scheduled_time": "2026-04-13 10:45:56.342", "end_time": "2026-04-13 10:47:26.273", "orig_prompt": "An urban fantasy art scene. A dynamic graffiti character. A boy made of spray paint comes to life on a concrete wall. He performs a fast-paced English rap song while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The light comes from a single street lamp, creating a cinematic atmosphere with high energy and incredible detail. The audio consists solely of the rap, with no other dialogue or background noise." }, "usage": { "video_count": 1, "video_duration": 0, "video_ratio": "", "duration": 10, "input_video_duration": 0, "output_video_duration": 10, "SR": 720 } }
SDK Java
Pastikan versi SDK Java DashScope tidak lebih rendah dari 2.22.14 sebelum menjalankan kode berikut.
Jika versinya terlalu lama, kesalahan seperti "url error, please check url!" dapat terjadi. Untuk informasi lebih lanjut, lihat Instal SDK untuk memperbaruinya.
Atur Constants.baseHttpApiUrl berdasarkan wilayah model:
Singapore
Constants.baseHttpApiUrl = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1"
Saat memanggil, ganti WorkspaceId dengan Workspace ID yang sebenarnya.
Beijing
Constants.baseHttpApiUrl = "https://dashscope.aliyuncs.com/api/v1"
Panggilan sinkron
Panggilan sinkron akan memblokir hingga generasi video selesai dan hasil dikembalikan.
Contoh permintaan
// Copyright (c) Alibaba, Inc. and its affiliates.
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesis;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisParam;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisResult;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.utils.Constants;
import com.alibaba.dashscope.utils.JsonUtils;
import java.util.ArrayList;
import java.util.List;
public class Image2Video {
static {
// Ini adalah URL untuk wilayah Singapore. Jika Anda menggunakan model di wilayah Beijing, ganti URL dengan: https://dashscope.aliyuncs.com/api/v1
Constants.baseHttpApiUrl = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1";
}
// Jika variabel lingkungan belum dikonfigurasi, ganti baris berikut dengan: apiKey="sk-xxx"
// Kunci API bersifat spesifik wilayah. Untuk mendapatkan Kunci API, kunjungi: https://www.alibabacloud.com/help/en/model-studio/get-api-key
static String apiKey = System.getenv("DASHSCOPE_API_KEY");
public static void syncCall() {
VideoSynthesis videoSynthesis = new VideoSynthesis();
final String prompt = "A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life on a concrete wall. He sings an English rap song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The light comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise.";
List<VideoSynthesisParam.Media> media = new ArrayList<VideoSynthesisParam.Media>(){{
add(VideoSynthesisParam.Media.builder()
.url("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png")
.type("first_frame")
.build());
add(VideoSynthesisParam.Media.builder()
.url("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3")
.type("driving_audio")
.build());
}};
VideoSynthesisParam param =
VideoSynthesisParam.builder()
.apiKey(apiKey)
.model("wan2.7-i2v-2026-04-25")
.prompt(prompt)
.media(media)
.watermark(true)
.duration(10)
.resolution("720P")
.build();
VideoSynthesisResult result = null;
try {
System.out.println("---Panggilan sinkron, mohon tunggu...----");
result = videoSynthesis.call(param);
} catch (ApiException | NoApiKeyException e){
throw new RuntimeException(e.getMessage());
} catch (InputRequiredException e) {
throw new RuntimeException(e);
}
System.out.println(JsonUtils.toJson(result));
}
public static void main(String[] args) {
syncCall();
}
}
Contoh respons
video_url berlaku selama 24 jam. Segera unduh video tersebut.
{
"request_id": "78178b55-8399-9823-8173-xxxxxx",
"output": {
"task_id": "be457e1b-8a79-47ed-aeff-xxxxxx",
"task_status": "SUCCEEDED",
"video_url": "https://dashscope-a717.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxx",
"orig_prompt": "An urban fantasy art scene featuring a dynamic graffiti art character. A boy made of spray paint comes to life on a concrete wall. He rapidly sings an English rap song while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. A single street lamp provides the light, creating a high-energy cinematic atmosphere with incredible detail. The audio consists entirely of his rap, with no other dialogue or background noise.",
"submit_time": "2026-04-13 10:57:36.795",
"scheduled_time": "2026-04-13 10:57:46.280",
"end_time": "2026-04-13 10:59:16.338"
},
"usage": {
"video_count": 1,
"duration": 10.0,
"input_video_duration": 0.0,
"output_video_duration": 10.0,
"SR": "720"
},
"status_code": 200,
"code": "",
"message": ""
}
Panggilan asinkron
Contoh permintaan
// Copyright (c) Alibaba, Inc. and its affiliates.
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesis;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisParam;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisResult;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.utils.Constants;
import com.alibaba.dashscope.utils.JsonUtils;
import java.util.ArrayList;
import java.util.List;
public class Image2Video {
static {
// Ini adalah URL untuk wilayah Singapore. Jika Anda menggunakan model di wilayah Beijing, ganti URL dengan: https://dashscope.aliyuncs.com/api/v1
Constants.baseHttpApiUrl = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1";
}
// Jika variabel lingkungan belum dikonfigurasi, ganti baris berikut dengan: apiKey = "sk-xxx"
// Kunci API bersifat spesifik wilayah. Untuk mendapatkan Kunci API, lihat https://www.alibabacloud.com/help/en/model-studio/get-api-key
static String apiKey = System.getenv("DASHSCOPE_API_KEY");
public static void asyncCall() {
VideoSynthesis videoSynthesis = new VideoSynthesis();
final String prompt = "A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life on a concrete wall. He sings an English rap song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The light comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise.";
List<VideoSynthesisParam.Media> media = new ArrayList<VideoSynthesisParam.Media>(){{
add(VideoSynthesisParam.Media.builder()
.url("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png")
.type("first_frame")
.build());
add(VideoSynthesisParam.Media.builder()
.url("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3")
.type("driving_audio")
.build());
}};
VideoSynthesisParam param =
VideoSynthesisParam.builder()
.apiKey(apiKey)
.model("wan2.7-i2v-2026-04-25")
.prompt(prompt)
.media(media)
.watermark(true)
.duration(10)
.resolution("720P")
.build();
VideoSynthesisResult result = null;
try {
System.out.println("--- Memulai panggilan asinkron. Mohon tunggu... ---");
result = videoSynthesis.asyncCall(param);
} catch (ApiException | NoApiKeyException e){
throw new RuntimeException(e.getMessage());
} catch (InputRequiredException e) {
throw new RuntimeException(e);
}
System.out.println(JsonUtils.toJson(result));
String taskId = result.getOutput().getTaskId();
System.out.println("taskId=" + taskId);
try {
result = videoSynthesis.wait(taskId, apiKey);
} catch (ApiException | NoApiKeyException e){
throw new RuntimeException(e.getMessage());
}
System.out.println(JsonUtils.toJson(result));
System.out.println(JsonUtils.toJson(result.getOutput()));
}
public static void main(String[] args) {
asyncCall();
}
}
Contoh respons
-
Contoh respons saat membuat tugas
{ "request_id": "5dbf9dc5-4f4c-9605-85ea-xxxxxxxx", "output": { "task_id": "7277e20e-aa01-4709-xxxxxxxx", "task_status": "PENDING" } } -
Contoh respons saat mengkueri hasil tugas
video_url berlaku selama 24 jam. Segera unduh video tersebut.
{ "request_id": "78178b55-8399-9823-8173-xxxxxx", "output": { "task_id": "be457e1b-8a79-47ed-aeff-xxxxxx", "task_status": "SUCCEEDED", "video_url": "https://dashscope-a717.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxx", "orig_prompt": "An urban fantasy art scene featuring a dynamic graffiti art character. A boy made of spray paint comes to life on a concrete wall. He rapidly sings an English rap song while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. A single street lamp provides the light, creating a high-energy cinematic atmosphere with incredible detail. The audio consists entirely of his rap, with no other dialogue or background noise.", "submit_time": "2026-04-13 10:57:36.795", "scheduled_time": "2026-04-13 10:57:46.280", "end_time": "2026-04-13 10:59:16.338" }, "usage": { "video_count": 1, "duration": 10.0, "input_video_duration": 0.0, "output_video_duration": 10.0, "SR": "720" }, "status_code": 200, "code": "", "message": "" }
Kode kesalahan
Jika pemanggilan model gagal dan mengembalikan pesan kesalahan, lihat Kode kesalahan untuk menyelesaikan masalah.
FAQ
T: Bagaimana cara menghasilkan video dengan rasio aspek tertentu, seperti 3:4?
J: Rasio aspek output ditentukan oleh materi input (gambar frame pertama atau klip video pertama), tetapi tidak dijamin persis sama. Deviasi kecil dapat terjadi.
Contoh berikut menjelaskan logikanya menggunakan gambar frame pertama sebagai input:
-
Mengapa deviasi terjadi?
-
Logika eksekusi: Sistem menggunakan rasio aspek gambar input sebagai garis dasar, dikombinasikan dengan total piksel target untuk tingkat
resolution. Karena pengkodean video mengharuskan lebar dan tinggi merupakan kelipatan 16, sistem menyesuaikan output ke resolusi valid terdekat. -
Contoh perhitungan: Gambar input 750 x 1000 piksel (rasio 3:4 = 0,75) dengan resolusi "720P" (~920.000 total piksel) menghasilkan output 816 x 1104 piksel (rasio ~0,739, ~900.000 total piksel).
-
-
Rekomendasi:
-
Kontrol input: Gunakan frame pertama atau klip video yang sesuai dengan rasio aspek target Anda.
-
Pasca-pemrosesan: Untuk kebutuhan rasio aspek yang ketat, potong video atau tambahkan batang hitam setelah generasi.
-
T: Bagaimana cara mendapatkan daftar putih nama domain untuk akses penyimpanan video?
J: Video yang dihasilkan model disimpan di OSS. API mengembalikan URL publik sementara. Untuk mengonfigurasi daftar putih firewall untuk URL unduh ini, perhatikan hal berikut: Penyimpanan dasar dapat berubah secara dinamis. Topik ini tidak menyediakan daftar putih nama domain OSS tetap untuk mencegah masalah akses akibat informasi yang kedaluwarsa. Jika Anda memiliki kebutuhan kontrol keamanan, hubungi manajer akun Anda untuk mendapatkan daftar nama domain OSS terbaru.