# 1. the lip-sync state of a dubbed project
curl https://api.rask.ai/v3/projects/$ID/lipsync \
-H "Authorization: Bearer $RASK_API_KEY"
# "video_has_face": true, "free_trial_run_available": true
# 2. the price first - free, and it changes nothing
curl -X POST https://api.rask.ai/v3/projects/$ID/lipsync/estimate \
-H "Authorization: Bearer $RASK_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "enhanced"}'
# 3. lip-sync the full video - the price you accepted is the ceiling
curl -X POST https://api.rask.ai/v3/projects/$ID/lipsync \
-H "Authorization: Bearer $RASK_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "enhanced", "expected_cost_minutes": 12}'# Starting lip-sync returns a job. Wait on it instead of polling:
# one request, up to 20 seconds, and it returns the moment the task is done.
curl -s "https://api.rask.ai/v3/jobs/$JOB_ID?wait_seconds=20" \
-H "Authorization: Bearer $RASK_API_KEY" | jq .status



นำเข้าวิดีโอต้นฉบับหรือส่ง URL สาธารณะ สร้างโปรเจกต์พร้อมระบุภาษาที่ต้องการ แล้วรอจนกว่ากระบวนการจะเสร็จสมบูรณ์ การซิงค์ริมฝีปากต้องใช้วิดีโอที่มีการพากย์เสียงจากโปรเจกต์นี้
งานตรวจสอบใบหน้ายืนยันว่ามีใบหน้าอย่างน้อยหนึ่งใบหน้าในวิดีโอ ซึ่งมักจะเริ่มทำงานโดยอัตโนมัติ หากยังไม่เริ่ม ให้เรียกใช้งานด้วยตนเองหนึ่งครั้งสำหรับโปรเจกต์นั้น
เริ่มงานซิงค์ริมฝีปาก ติดตามความคืบหน้าจาก 0 ถึง 100 และดาวน์โหลดวิดีโอจากผลลัพธ์ของโปรเจกต์
import os, requests
API = "https://api.rask.ai/v3"
h = {"Authorization": f"Bearer {os.environ['RASK_API_KEY']}"}
# lip-sync runs on a project that has already been dubbed
state = requests.get(f"{API}/projects/{project_id}/lipsync", headers=h).json()
assert state["video_has_face"]
# the price first - free, and it changes nothing
estimate = requests.post(f"{API}/projects/{project_id}/lipsync/estimate", headers=h,
json={"model": "enhanced"}).json()
# the price you accepted is the ceiling
job = requests.post(f"{API}/projects/{project_id}/lipsync", headers=h,
json={"model": "enhanced",
"expected_cost_minutes": estimate["total_minutes"]}).json()
requests.get(f"{API}/jobs/{job['id']}?wait_seconds=20", headers=h).json()
for o in requests.get(f"{API}/projects/{project_id}/outputs", headers=h).json()["data"]:
print(o["kind"], o["url"])# pip install rask-sdk
from rask_sdk import Rask
rask = Rask() # reads RASK_API_KEY
# the price first - free, and it changes nothing
estimate = rask.projects.estimate_project(
media_id=media_id, target_language="es-mx"
)
# dub, then lip-sync what it produced
created = rask.projects.create_project(
media_id=media_id,
target_language="es-mx",
expected_cost_minutes=estimate.total_minutes,
)
dubbed = rask.jobs.wait(created.id)
for o in rask.exports.list_project_outputs(dubbed.result.project_id).data:
print(o.kind, o.url)// no dependencies, Node 18+ global fetch
const API = 'https://api.rask.ai/v3';
const h = {
Authorization: `Bearer ${process.env.RASK_API_KEY}`,
'Content-Type': 'application/json',
};
// lip-sync runs on a project that has already been dubbed
const state = await fetch(`${API}/projects/${projectId}/lipsync`, { headers: h })
.then(r => r.json());
// the price first - free, and it changes nothing
const estimate = await fetch(`${API}/projects/${projectId}/lipsync/estimate`, {
method: 'POST', headers: h, body: JSON.stringify({ model: 'enhanced' }),
}).then(r => r.json());
// the price you accepted is the ceiling
const job = await fetch(`${API}/projects/${projectId}/lipsync`, {
method: 'POST', headers: h,
body: JSON.stringify({ model: 'enhanced', expected_cost_minutes: estimate.total_minutes }),
}).then(r => r.json());
await fetch(`${API}/jobs/${job.id}?wait_seconds=20`, { headers: h }).then(r => r.json());
const outputs = await fetch(`${API}/projects/${projectId}/outputs`, { headers: h })
.then(r => r.json());
outputs.data.forEach(o => console.log(o.kind, o.url));API=https://api.rask.ai/v3
AUTH="Authorization: Bearer $RASK_API_KEY"
JSON="Content-Type: application/json"
# 1. the dubbed video must have a usable face
curl -s $API/projects/$ID/lipsync -H "$AUTH" | jq .video_has_face
# 2. the price first - free, and it changes nothing
CAP=$(curl -s -X POST $API/projects/$ID/lipsync/estimate -H "$AUTH" -H "$JSON" \
-d '{"model": "enhanced"}' | jq -r .total_minutes)
# 3. start lip-sync - the price you accepted is the ceiling
JOB=$(curl -s -X POST $API/projects/$ID/lipsync -H "$AUTH" -H "$JSON" \
-d "{\"model\":\"enhanced\",\"expected_cost_minutes\":$CAP}" | jq -r .id)
# 4. wait on the job, then collect the lip-synced video
curl -s "$API/jobs/$JOB?wait_seconds=20" -H "$AUTH" | jq .status
curl -s $API/projects/$ID/outputs -H "$AUTH" \
| jq -r '.data[] | "\(.kind)\t\(.url)"'<?php
use GuzzleHttp\Client;
$http = new Client([
'base_uri' => 'https://api.rask.ai/v3/',
'headers' => ['Authorization' => 'Bearer ' . getenv('RASK_API_KEY')],
]);
// lip-sync runs on a project that has already been dubbed
$state = json_decode($http->get("projects/{$projectId}/lipsync")->getBody(), true);
// the price first - free, and it changes nothing
$estimate = json_decode($http->post("projects/{$projectId}/lipsync/estimate",
['json' => ['model' => 'enhanced']])->getBody(), true);
// the price you accepted is the ceiling
$job = json_decode($http->post("projects/{$projectId}/lipsync", ['json' => [
'model' => 'enhanced',
'expected_cost_minutes' => $estimate['total_minutes'],
]])->getBody(), true);
$http->get("jobs/{$job['id']}?wait_seconds=20");
$outputs = json_decode(
$http->get("projects/{$projectId}/outputs")->getBody(), true); 0s queued lip-sync task accepted
8s running face check
40s running generating
180s running merging
210s succeeded the lip-synced video is in the project outputs

es-mx และ es-es เหมือนกัน บันทึกของโปรเจกต์ glossary.versionดังนั้นการแก้ไขในภายหลังจึงไม่ส่งผลกระทบต่อAงานที่เสร็จสมบูรณ์แล้วใช่ Rask lip sync API สามารถทำงานกับวิดีโอใดก็ได้ที่ผ่านการพากย์เสียงในโปรเจกต์ของคุณ ตรวจสอบว่าวิดีโอนั้นมีใบหน้า ประเมินค่างานด้วย POST /v3/projects/{project_id}/lipsync/estimate เริ่มต้นใช้งาน และดาวน์โหลดวิดีโอที่ซิงค์ริมฝีปากแล้วเมื่อกระบวนการเสร็จสิ้น การยืนยันตัวตนใช้ API key เพียงตัวเดียว การรวมระบบจึงใช้รูปแบบเดียวกันกับส่วนอื่นๆ ของ Rask API
การซิงค์ริมฝีปากจะทำงานบนวิดีโอที่แปลแล้ว สร้างและพากย์เสียงโปรเจกต์ของคุณก่อน จากนั้นจึงเริ่มซิงค์ริมฝีปากเมื่อกระบวนการนั้นสำเร็จและโปรเจกต์แสดงวิดีโอพากย์เสียงในรายการผลลัพธ์
ระบบซิงค์ปากจะใช้เสียงพากย์ของโปรเจกต์ หากคุณต้องการใช้เสียงหรือคำพูดของคุณเอง ให้แก้ไขข้อความที่แปลแล้วหรือสร้างสคริปต์จากไฟล์ .srt ของคุณเอง จากนั้นพากย์เสียงโปรเจกต์ใหม่อีกครั้ง แล้วค่อยรันระบบซิงค์ปากกับเวอร์ชันใหม่
ระบบซิงค์ปากของ Rask จะทำงานกับฟุตเทจจริงของบุคคลจริงในวิดีโอที่คุณอัปโหลด สำหรับการสร้างอวาตาร์พูดได้ มนุษย์ดิจิทัล หรือการสร้างวิดีโอด้วย AI จากรูปภาพหรือข้อความ จะจัดอยู่ในหมวดหมู่ผลิตภัณฑ์ที่แตกต่างกัน ซึ่งเครื่องมือสร้างวิดีโอ AI จะตอบโจทย์ในส่วนนั้นมากกว่า
ใช้วิดีโอที่เห็นใบหน้าของผู้พูดชัดเจน มีแสงสว่างเพียงพอ และไม่มีสิ่งกีดขวางบริเวณปาก หลีกเลี่ยงมุมข้างที่ชัดเจนและสิ่งใดก็ตามที่บังริมฝีปาก เช่น ไมโครโฟน มือ หรือคำบรรยาย การตรวจสอบใบหน้ายืนยันว่ามีใบหน้าอยู่ในวิดีโอ ใช้ตัวอย่างก่อนพิมพ์เพื่อประเมินผลลัพธ์ในวิดีโอของคุณ
การซิงค์ริมฝีปากจะคิดค่าใช้จ่ายแยกต่างหากจากการพากย์เสียงสำหรับวิดีโอฉบับเต็มแต่ละชุด การสร้างวิดีโอเวอร์ชันซิงค์ริมฝีปากใหม่หลังจากการแก้ไขจะมีค่าใช้จ่ายเพิ่มเติม
ใช่ ทุกบัญชีมีนาทีซิงค์ริมฝีปากฟรีในเครดิตฟรี รันงานโดยตั้งค่า free_trial_run เป็น true เพื่อซิงค์วิดีโอของคุณหนึ่งนาทีและตรวจสอบดู คุณสามารถดูได้ที่เอนด์พอยต์เครดิตในชื่อ lipsync_free_minutes
ใช่ ตั้งค่า num_speakers ในโปรเจกต์เมื่อมีคนพูดมากกว่าหนึ่งคนหน้ากล้อง เพื่อให้เสียงแต่ละเสียงตรงกับผู้พูดแต่ละคน หรือปล่อยว่างไว้เพื่อให้ Rask ตรวจจับผู้พูดให้เอง
GET /v3/projects/{project_id}/lipsync returns the state: video_has_face, whether a free trial run is available, and the latest job. Starting lip-sync returns a job that reports its stage, progress and queue position, and GET /v3/jobs/{job_id}?wait_seconds=20 returns the moment it is done.
เวลาในการประมวลผลจะแตกต่างกันไปตามความยาวของวิดีโอและคิวการซิงค์ริมฝีปาก ตำแหน่งในคิวและค่าความคืบหน้าช่วยให้คุณแสดงให้ผู้ใช้เห็นสถานะของงานได้อย่างแม่นยำ
การซิงค์ริมฝีปากจะถูกสร้างขึ้นหนึ่งครั้งต่อเสียงพากย์แต่ละเวอร์ชัน หลังจากที่คุณเปลี่ยนข้อความ ไทม์สเตมป์ ผู้พูด หรือเสียง ให้พากย์เสียงโปรเจกต์ใหม่อีกครั้ง รอให้กระบวนการเสร็จสมบูรณ์ แล้วเรียกใช้การซิงค์ริมฝีปากใหม่อีกครั้ง การสร้างการซิงค์ริมฝีปากครั้งใหม่จะมีการประเมินราคาและเรียกเก็บเงินแยกต่างหาก โดยไม่ต้องตรวจสอบใบหน้าซ้ำ
หากสถานะงานแสดงว่าล้มเหลว โปรดอ่านข้อความแสดงข้อผิดพลาด และติดต่อ [email protected] พร้อมระบุ project_id ของคุณ หากต้องการให้ทีมงานช่วยเหลือตรวจสอบ
สามารถใช้งาน API ได้ในแพ็กเกจ Creator Pro, Business และ Enterprise โดยความสามารถจะขึ้นอยู่กับแพ็กเกจที่คุณเลือก คุณสามารถสร้างคีย์ API ในแอปและเริ่มใช้งานได้ทันที สำหรับเงื่อนไขของระดับ Enterprise, ส่วนลดตามปริมาณการใช้งาน และภาษาพิเศษ โปรดติดต่อทีมงานของเรา