# 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



استورد الفيديو أو أرسل رابطاً عاماً، وأنشئ مشروعاً بلغة مستهدفة وانتظر حتى تكتمل المهمة بنجاح. تتطلب مزامنة الشفاه الفيديو المدبلج الذي أنشأه هذا المشروع.
تؤكد مهمة التحقق من الوجه وجود وجه واحد على الأقل في الفيديو. وعادة ما تبدأ تلقائياً، وإذا لم تبدأ، يمكنك تشغيلها بنفسك مرة واحدة للمشروع.
ابدأ مهمة مزامنة الشفاه، وتابع التقدم من 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، بحيث لا تؤدي التعديلات لاحقاً إلى تغيير العمل المكتمل دون ملاحظة ذلك.نعم. تعمل واجهة برمجة تطبيقات مزامنة الشفاه من Rask على أي فيديو دبلجه مشروعك. تحقق من أن الفيديو يحتوي على وجه، وقدر المهمة باستخدام POST /v3/projects/{project_id}/lipsync/estimate، وابدأها وقم بتنزيل الفيديو المتطابق عندما تنتهي المهمة. المصادفة تتم عبر مفتاح API واحد، لذا يتبع التكامل نفس النمط المعتمد في باقي واجهات برمجة تطبيقات Rask.
تعمل مزامنة الشفاه على فيديو مترجم. أنشئ مشروعك ودبلجه أولاً، وابدأ مزامنة الشفاه بمجرد نجاح تلك المهمة وعرض المشروع لفيديو مدبلج ضمن مخرجاته.
تستخدِم مزامنة الشفاه الصوت المُدبلج للمشروع. لاستخدام صياغتك الخاصة، قم بتعديل النص المترجم أو أنشئ النص المكتوب من ملف srt. الخاص بك، ثم أعد دبلجة المشروع، وبعدها قم بتشغيل مزامنة الشفاه على الإصدار الجديد.
تقوم ميزة مزامنة الشفاه في Rask بمزامنة اللقطات الحقيقية للمتحدثين الحقيقيين في الفيديو الخاص بك. يُعد إنشاء الصور الرمزية المتحدثة، والأشخاص الرقميين، وإنشاء فيديوهات بالذكاء الاصطناعي من صورة أو نص فئة منتجات مختلفة، وتعتبر أدوات إنشاء الفيديو بالذكاء الاصطناعي الخيار الأفضل لها.
استخدم لقطات يظهر فيها وجه المتحدث بوضوح، مع إضاءة جيدة وفم غير محجوب. تجنب اللقطات الجانبية القوية وأي شيء يغطي الشفاه مثل الميكروفون أو اليد أو التعليقات التوضيحية. يؤكد فحص الوجه وجود وجه؛ واستخدم معاينة للتعرف على النتائج في لقطاتك.
يتم محاسبة ميزة مزامنة الشفاه بشكل منفصل عن الدبلجة لكل فيديو كامل يتم إنشاؤه. إنشاء نسخة جديدة متزامنة الشفاه بعد التعديلات يتطلب رسوم مزامنة شفاه إضافية.
نعم. يتضمن كل حساب دقيقة واحدة مجانية لمزامنة الشفاه ضمن رصيدك المجاني. قم بتشغيل المهمة مع تفعيل خيار التجربة المجانية لمزامنة دقيقة واحدة من الفيديو الخاص بك ومراجعتها. يوضح قسم الرصيد ذلك كدقائق مجانية لمزامنة الشفاه.
نعم. قم بتحديد عدد المتحدثين في المشروع عندما يكون هناك أكثر من شخص يتحدث أمام الكاميرا، ليتم مطابقة كل صوت مع المتحدث الخاص به. يمكنك ترك هذا الخيار وسيقوم 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، وتسعير الكميات، وتغطية اللغات المخصصة تتم من خلال فريقنا.