# 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を送信し、ターゲット言語を指定してプロジェクトを作成したら、処理が完了するのを待ちます。リップシンクには、このプロジェクトで生成された吹き替え動画が必要です。
顔の検出確認により、動画内に少なくとも1つの顔があることが確認されます。通常は自動的に開始されますが、開始されない場合はプロジェクトに対して手動で実行してください。
リップシンクの処理を開始し、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のリップシンクAPIは、プロジェクトで吹き替えを行ったすべての動画でご利用いただけます。動画に顔が映っていることを確認し、POST /v3/projects/{project_id}/lipsync/estimateで処理の見積もりを行い、処理を開始したら完了後にリップシンク済み動画をダウンロードしてください。認証には1つのAPIキーを使用するため、他のRask APIと同じ手順で連携できます。
リップシンクは翻訳・吹き替え済みの動画に対して行われます。まずプロジェクトを作成して吹き替えを行い、その処理が成功してプロジェクトの出力に吹き替え動画が表示されるようになってからリップシンクを開始してください。
リップシンクでは、プロジェクトの吹き替え音声を使用します。独自の表現を使用したい場合は、翻訳テキストを編集するか、ご自身の.srtファイルから文字起こしを作成してプロジェクトの吹き替えをやり直してから、新しいバージョンに対してリップシンクを実行してください。
Raskのリップシンクは、入力された動画に映っている実在の人物の実際の映像を処理します。画像やテキストプロンプトからのトーキングアバター生成、デジタルヒューマン、AI動画生成は別のカテゴリとなるため、AI動画生成ツールの使用をおすすめします。
話している人物の顔がはっきり見え、照明が良好で、口元が遮られていない映像を使用してください。真横からのアングルや、マイク、手、字幕などで唇が隠れているものは避けてください。顔の検出機能によって顔の存在が確認されます。プレビューを使用して、実際の映像での仕上がりを確認してください。
リップシンク(口パク合わせ)の料金は、動画を1本作成するごとに、吹替えとは別にかかります。編集後に新しいリップシンク版を作成すると、改めて料金が発生します。
はい。無料クレジットの中に、リップシンクを1分間お試しいただける分が含まれています。free_trial_runを有効にしてタスクを実行すると、動画の1分間を同期して確認できます。残高はcreditsエンドポイントの「lipsync_free_minutes」でご確認いただけます。
はい。複数人が出演する動画では、プロジェクトの設定で話者数を指定すると、それぞれの声が正しい人物に割り当てられます。指定しない場合は、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.
処理にかかる時間は、動画の長さや混雑状況によって変わります。順番待ちの状況や進捗率を使えば、ユーザーに今の状態を正確に伝えることができます。
リップシンクは吹き替えバージョンごとに生成されます。テキスト、タイムスタンプ、話者、音声を変更した場合は、プロジェクトを再吹き替えし、処理の完了を待ってから再度リップシンクを実行してください。新しいリップシンクの生成は個別に見積もりと請求が行われますが、完了した顔の検出処理をやり直す必要はありません。
処理のステータスが「失敗」と表示された場合は、エラー内容を確認し、サポートが必要な場合はproject_idを添えて [email protected] までご連絡ください。
APIアクセスはCreator Pro、Business、Enterpriseプランでご利用いただけます(機能はプランにより異なります)。アプリでAPIキーを作成すれば、すぐに利用を開始できます。Enterpriseプランのご契約、大量利用時の割引、カスタム言語への対応については、チームまでお問い合わせください。