Rendley docs

Lip sync

Match a speaker's mouth movements to a new audio track. Use it to dub footage into another language, or to replace a bad take without a reshoot.

#Lip-sync a video to audio

Enqueue a job to lip-sync a video clip to a separate audio track.

POSThttps://api.rendley.com/v1/ai/lipsync

Don't have one? Create an API key

Body

Which model to use. Changing it updates the params below.

Model-specific parameters. The fields listed for the selected model.

The 'hash' field from the video library media entry, or a public URL.

The 'hash' field from the audio/voiceover library media entry, or a public URL.

const res = await fetch("https://api.rendley.com/v1/ai/lipsync", {
  method: "POST",
  headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json" },
  body: JSON.stringify({
    "params": {
      "video_file_hash": "<video_file_hash>",
      "audio_file_hash": "<audio_file_hash>"
    },
    "model_id": "lipsync"
  }),
});
const { data } = await res.json();
curl -X POST "https://api.rendley.com/v1/ai/lipsync" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "params": {
      "video_file_hash": "<video_file_hash>",
      "audio_file_hash": "<audio_file_hash>"
    },
    "model_id": "lipsync"
  }'
import requests

res = requests.post(
    "https://api.rendley.com/v1/ai/lipsync",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={
        "params": {
            "video_file_hash": "<video_file_hash>",
            "audio_file_hash": "<audio_file_hash>"
        },
        "model_id": "lipsync"
    },
)
data = res.json()["data"]
$ch = curl_init("https://api.rendley.com/v1/ai/lipsync");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Authorization: Bearer YOUR_API_KEY", "Content-Type: application/json"]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(["params" => ["video_file_hash" => "<video_file_hash>", "audio_file_hash" => "<audio_file_hash>"], "model_id" => "lipsync"]));

$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true)["data"];
package main

import (
	"fmt"
	"io"
	"net/http"
	"bytes"
)

func main() {
	body := bytes.NewBufferString(`{
  "params": {
    "video_file_hash": "<video_file_hash>",
    "audio_file_hash": "<audio_file_hash>"
  },
  "model_id": "lipsync"
}`)
	req, _ := http.NewRequest("POST", "https://api.rendley.com/v1/ai/lipsync", body)
	req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
	req.Header.Set("Content-Type", "application/json")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	b, _ := io.ReadAll(res.Body)
	fmt.Println(string(b))
}
require "net/http"
require "json"

uri = URI("https://api.rendley.com/v1/ai/lipsync")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer YOUR_API_KEY"
req["Content-Type"] = "application/json"
req.body = { params: { video_file_hash: "<video_file_hash>", audio_file_hash: "<audio_file_hash>" }, model_id: "lipsync" }.to_json

res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)["data"]

Response

{
  "data": {
    "job_id": "d97241f2-e1e4-4651-b078-8663fc35c584"
  }
}

#Calculate lipsync cost

Calculate the credit cost of lip-syncing a video clip to an audio track.

POSThttps://api.rendley.com/v1/ai/lipsync/cost

Don't have one? Create an API key

Body

Which model to use. Changing it updates the params below.

Model-specific parameters. The fields listed for the selected model.

The 'hash' field from the video library media entry, or a public URL.

The 'hash' field from the audio/voiceover library media entry, or a public URL.

const res = await fetch("https://api.rendley.com/v1/ai/lipsync/cost", {
  method: "POST",
  headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json" },
  body: JSON.stringify({
    "params": {
      "video_file_hash": "<video_file_hash>",
      "audio_file_hash": "<audio_file_hash>"
    },
    "model_id": "lipsync"
  }),
});
const { data } = await res.json();
curl -X POST "https://api.rendley.com/v1/ai/lipsync/cost" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "params": {
      "video_file_hash": "<video_file_hash>",
      "audio_file_hash": "<audio_file_hash>"
    },
    "model_id": "lipsync"
  }'
import requests

res = requests.post(
    "https://api.rendley.com/v1/ai/lipsync/cost",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={
        "params": {
            "video_file_hash": "<video_file_hash>",
            "audio_file_hash": "<audio_file_hash>"
        },
        "model_id": "lipsync"
    },
)
data = res.json()["data"]
$ch = curl_init("https://api.rendley.com/v1/ai/lipsync/cost");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Authorization: Bearer YOUR_API_KEY", "Content-Type: application/json"]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(["params" => ["video_file_hash" => "<video_file_hash>", "audio_file_hash" => "<audio_file_hash>"], "model_id" => "lipsync"]));

$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true)["data"];
package main

import (
	"fmt"
	"io"
	"net/http"
	"bytes"
)

func main() {
	body := bytes.NewBufferString(`{
  "params": {
    "video_file_hash": "<video_file_hash>",
    "audio_file_hash": "<audio_file_hash>"
  },
  "model_id": "lipsync"
}`)
	req, _ := http.NewRequest("POST", "https://api.rendley.com/v1/ai/lipsync/cost", body)
	req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
	req.Header.Set("Content-Type", "application/json")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	b, _ := io.ReadAll(res.Body)
	fmt.Println(string(b))
}
require "net/http"
require "json"

uri = URI("https://api.rendley.com/v1/ai/lipsync/cost")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer YOUR_API_KEY"
req["Content-Type"] = "application/json"
req.body = { params: { video_file_hash: "<video_file_hash>", audio_file_hash: "<audio_file_hash>" }, model_id: "lipsync" }.to_json

res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)["data"]

Response

{
  "data": 0
}