# 1. on a dubbed project: confirm the video has a face (runs once, usually automatically)
curl https://api.rask.ai/v2/projects/$ID/lipsync \
-H "Authorization: Bearer $TOKEN"
# "check_face_task_status": "done", "video_has_face": true
# 2. preview one free minute of lip-sync
curl -X PUT https://api.rask.ai/v2/projects/$ID/lipsync \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"is_multiple_speakers": true, "is_free_lipsync": true}'
# 3. lip-sync the full video - billed separately from dubbing
curl -X PUT https://api.rask.ai/v2/projects/$ID/lipsync \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"is_multiple_speakers": true, "is_free_lipsync": false}'# Poll until lipsync_task_status is done, then download lipsync_result_path
while :; do
curl -s https://api.rask.ai/v2/projects/$ID/lipsync -H "Authorization: Bearer $TOKEN" \
| jq '{lipsync_task_status, lipsync_task_progress, tasks_in_lipsync_queue}'
sleep 15
done



Laden Sie das Video hoch oder senden Sie eine öffentliche URL, erstellen Sie ein Projekt mit einer Zielsprache und warten Sie auf den Abschluss. Die Lippensynchronisation benötigt das übersetzte Video dieses Projekts.
Dieser Schritt bestätigt, dass mindestens ein Gesicht im Video zu sehen ist. Er startet normalerweise automatisch. Falls nicht, starten Sie ihn einfach manuell für das Projekt.
Starten Sie den Prozess, verfolgen Sie den Fortschritt von 0 bis 100 und laden Sie anschließend das Video herunter.
# pip install git+ssh://[email protected]/braskai/rask-sdk.git@main
import asyncio
from rask_sdk import clients, enums, schemas
PROJECT_ID = "..." # a project with status merging_done
async def main():
client = clients.RaskSDKClient(client_id=CLIENT_ID, client_secret=CLIENT_SECRET)
info = await client.get_lipsync_info(project_id=PROJECT_ID)
if info.check_face_task_status is not enums.LipsyncStatus.DONE:
await client.run_check_face_task(project_id=PROJECT_ID)
while (info := await client.get_lipsync_info(project_id=PROJECT_ID)).check_face_task_status is not enums.LipsyncStatus.DONE:
await asyncio.sleep(10)
if not info.video_has_face:
raise SystemExit("No face found - lip-sync is not available for this video")
await client.run_lipsync_task(project_id=PROJECT_ID,
data=schemas.LipsyncTaskData(is_multiple_speakers=True, is_free_lipsync=False))
while (info := await client.get_lipsync_info(project_id=PROJECT_ID)).lipsync_task_status is not enums.LipsyncStatus.DONE:
print(info.lipsync_task_progress, info.tasks_in_lipsync_queue)
await asyncio.sleep(15)
print(info.lipsync_result_path)
asyncio.run(main())import time, requests
AUTH = "https://rask-prod.auth.us-east-2.amazoncognito.com/oauth2/token"
URL = f"https://api.rask.ai/v2/projects/{PROJECT_ID}" # a dubbed project
token = requests.post(AUTH, auth=(CLIENT_ID, CLIENT_SECRET),
data={"grant_type": "client_credentials"}).json()["access_token"]
h = {"Authorization": f"Bearer {token}"}
info = requests.get(f"{URL}/lipsync", headers=h).json()
if info["check_face_task_status"] != "done":
requests.put(f"{URL}/check_face", headers=h)
while (info := requests.get(f"{URL}/lipsync", headers=h).json())["check_face_task_status"] != "done":
time.sleep(10)
assert info["video_has_face"], "No face found"
requests.put(f"{URL}/lipsync", headers=h,
json={"is_multiple_speakers": True, "is_free_lipsync": False})
while (info := requests.get(f"{URL}/lipsync", headers=h).json())["lipsync_task_status"] not in ("done", "failed"):
time.sleep(15)
print(info["lipsync_task_status"], info["lipsync_result_path"])// no dependencies, Node 18+ global fetch - PROJECT_ID is a dubbed project
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
const auth = await fetch('https://rask-prod.auth.us-east-2.amazoncognito.com/oauth2/token', {
method: 'POST',
headers: { Authorization: 'Basic ' + btoa(`${CLIENT_ID}:${CLIENT_SECRET}`) },
body: new URLSearchParams({ grant_type: 'client_credentials' }),
}).then((r) => r.json());
const h = { Authorization: `Bearer ${auth.access_token}`, 'Content-Type': 'application/json' };
const url = `https://api.rask.ai/v2/projects/${PROJECT_ID}`;
const info = () => fetch(`${url}/lipsync`, { headers: h }).then((r) => r.json());
let i = await info();
if (i.check_face_task_status !== 'done') {
await fetch(`${url}/check_face`, { method: 'PUT', headers: h });
while ((i = await info()).check_face_task_status !== 'done') await sleep(10000);
}
if (!i.video_has_face) throw new Error('No face found');
await fetch(`${url}/lipsync`, {
method: 'PUT', headers: h,
body: JSON.stringify({ is_multiple_speakers: true, is_free_lipsync: false }),
});
while (!['done', 'failed'].includes((i = await info()).lipsync_task_status)) {
console.log(i.lipsync_task_progress, i.tasks_in_lipsync_queue);
await sleep(15000);
}
console.log(i.lipsync_result_path);# 1. token (valid 1 hour - cache and reuse it)
TOKEN=$(curl -s -X POST https://rask-prod.auth.us-east-2.amazoncognito.com/oauth2/token \
-u "$CLIENT_ID:$CLIENT_SECRET" -d "grant_type=client_credentials" | jq -r .access_token)
# 2. face check on the dubbed project - start it only if it has not run yet
curl -s https://api.rask.ai/v2/projects/$ID/lipsync -H "Authorization: Bearer $TOKEN" \
| jq '{check_face_task_status, video_has_face}'
curl -s -X PUT https://api.rask.ai/v2/projects/$ID/check_face -H "Authorization: Bearer $TOKEN"
# 3. run lip-sync (set is_free_lipsync to true for the free preview minute)
curl -s -X PUT https://api.rask.ai/v2/projects/$ID/lipsync \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"is_multiple_speakers": true, "is_free_lipsync": false}'
# 4. follow progress, then download the result
curl -s https://api.rask.ai/v2/projects/$ID/lipsync -H "Authorization: Bearer $TOKEN" \
| jq '{lipsync_task_status, lipsync_task_progress, lipsync_result_path}'<?php
use GuzzleHttp\Client;
$http = new Client(['base_uri' => 'https://api.rask.ai']);
$json = fn($r) => json_decode($r->getBody(), true);
$auth = $json((new Client)->post('https://rask-prod.auth.us-east-2.amazoncognito.com/oauth2/token',
['auth' => [$clientId, $clientSecret], 'form_params' => ['grant_type' => 'client_credentials']]));
$h = ['Authorization' => 'Bearer ' . $auth['access_token']];
$info = fn() => $json($http->get("/v2/projects/$projectId/lipsync", ['headers' => $h]));
$i = $info();
if ($i['check_face_task_status'] !== 'done') {
$http->put("/v2/projects/$projectId/check_face", ['headers' => $h]);
while (($i = $info())['check_face_task_status'] !== 'done') sleep(10);
}
if (!$i['video_has_face']) exit('No face found');
$http->put("/v2/projects/$projectId/lipsync", ['headers' => $h,
'json' => ['is_multiple_speakers' => true, 'is_free_lipsync' => false]]);
while (!in_array(($i = $info())['lipsync_task_status'], ['done', 'failed'])) sleep(15);
echo $i['lipsync_result_path'];check face check_face_task_status done video_has_face true
queued lipsync_task_status started tasks_in_lipsync_queue 2
processing lipsync_task_progress 0 → 50 → 100
complete lipsync_task_status done
lipsync_result_path https://...

es-mx und es-es gleichermaßen dient. Das Projekt speichert glossary_version, sodass spätere Änderungen bereits fertiggestellte Arbeit nicht unbemerkt verändern.Ja. Die Rask Lipsync-API funktioniert mit jedem Video, das in Ihrem Projekt synchronisiert wurde. Stellen Sie sicher, dass das Video ein Gesicht zeigt, starten Sie den Lipsync-Vorgang und laden Sie das synchronisierte Video herunter, sobald er abgeschlossen ist. Die Authentifizierung erfolgt über OAuth 2.0-Client-Zugangsdaten, sodass sich die API-Integration nahtlos in den Rest der Rask API einfügt.
Lipsync wird auf übersetzte Videos angewendet. Erstellen und synchronisieren Sie zuerst Ihr Projekt und starten Sie Lipsync, sobald das Projekt über einen Link zu einem übersetzten Video (translated_video) und den Status „merging_done“ verfügt.
Lipsync verwendet die synchronisierte Audiospur des Projekts. Um Ihren eigenen Text zu verwenden, bearbeiten Sie den übersetzten Text oder erstellen Sie das Transkript aus einer eigenen .srt-Datei, synchronisieren Sie das Projekt erneut und führen Sie dann Lipsync für die neue Version aus.
Rask synchronisiert echtes Filmmaterial von echten Sprechern in Ihrem Quellvideo. Die Generierung von sprechenden Avataren, digitalen Menschen und KI-Videos aus einem Bild oder Text-Prompt gehört zu einer anderen Produktkategorie. Dafür eignet sich ein KI-Videogenerierungstool besser.
Verwenden Sie Filmmaterial, auf dem das sprechende Gesicht gut sichtbar ist, bei guter Beleuchtung und einem unverschleierten Mund. Vermeiden Sie extreme Profilansichten und Gegenstände, die den Mund verdecken, wie Mikrofone, Hände oder Untertitel. Die Gesichtsüberprüfung bestätigt lediglich das Vorhandensein eines Gesichts – nutzen Sie die Vorschau, um das Ergebnis mit Ihrem Filmmaterial zu bewerten.
Lipsync wird für jede vollständige Videogenerierung separat von der Synchronisation abgerechnet. Das Generieren einer neuen Lipsync-Version nach Bearbeitungen führt zu einer erneuten Berechnung.
Ja. Jedes Konto enthält eine kostenlose Minute für die Lippensynchronisation in den Gratis-Guthaben. Starte die Aufgabe mit der Einstellung „is_free_lipsync = true“, um eine Minute deines Videos zu synchronisieren und zu überprüfen. Der Guthaben-Endpunkt zeigt dies als „lipsync_free_minutes“ an.
Ja. Setze „is_multiple_speakers“ auf „true“, wenn mehrere Gesichter gleichzeitig im Bild zu sehen sein können, wie zum Beispiel bei Interviews oder Podiumsdiskussionen. Wenn im Video immer nur ein Gesicht zu sehen ist, setze es auf „false“, um die Bearbeitung zu beschleunigen.
Rufe GET /v2/projects/{id}/lipsync auf. In der Antwort wechselt „lipsync_task_status“ von „started“ zu „done“ oder „failed“, „lipsync_task_progress“ steigt von 0 auf 100 und „tasks_in_lipsync_queue“ zeigt an, wie viele Aufgaben vor deiner in der Warteschlange stehen.
Die Bearbeitungszeit hängt von der Länge des Videos und der Warteschlange für die Lippensynchronisation ab. Anhand der Position in der Warteschlange und dem Fortschrittswert kannst du deinen Nutzern genau zeigen, wo die Aufgabe gerade steht.
Die Lippensynchronisation wird einmal pro synchronisierter Version erstellt. Nachdem du Text, Zeitstempel, Sprecher oder Stimmen geändert hast, synchronisiere das Projekt erneut, warte auf „merging_done“ und starte die Lippensynchronisation noch einmal. Die Erstellung einer neuen Lippensynchronisation wird separat berechnet. Eine bereits abgeschlossene Gesichtsüberprüfung muss nicht erneut durchgeführt werden.
Wenn „check_face_task_status“ oder „lipsync_task_status“ den Status „failed“ anzeigt, wende dich unter Angabe deiner „project_id“ an [email protected], damit das Team sich darum kümmern kann.
Der API-Zugriff ist in kostenpflichtigen Tarifen enthalten. Sie erstellen Ihre Client-ID und Ihr Geheimnis in der App und können sofort loslegen. Unternehmensbedingungen, Mengenrabatte und kundenspezifische Sprachen werden über unser Team abgewickelt.