Skip to content
Use cases

Video Ad Localization AI: Face Swap With Consent

Video ad localization AI with consent: swap each market's local talent into one master ad, keep its sound, lay the local voice-over, then review.

Updated 7 min read

Video ad localization AI lets one shoot serve several markets: the same spot, with a presenter each audience sees as one of its own. On Frameport, Frameport Replace 1 swaps the presenter's face for the face of a local performer who agreed to it, and keeps everything else: the moves, the lips, the scene and the sound. It does not translate or dub. The new language track is recorded or produced elsewhere, then laid under the swapped picture.

Below: planning the master, the consent every face needs, the edit in code, the cost per market and the review before a version goes live.

What video ad localization AI changes, and what it keeps

With Frameport Replace 1
ChangesThe face of each person you name, to the face of the market's performer
KeepsThe moves, the lips, the scene, the clothes (by default) and the sound
Does not doTranslate, dub, move the lips to new words, or change text, signs and packaging in the frame
Per marketOne edit for each shot that shows a face to swap, billed per second of that shot

Without it, a local face means a local shoot. With it, the shoot happens once and each market gets its presenter in the same frames; the voice-over, the supers and the legal lines remain separate work per market.

The lips stay the original performer's, so a line spoken to the camera in a new language would show. Localized spots work when the words are off camera: a voice-over, a song, supers, a presenter who acts rather than speaks to the lens.

Plan the master for every market

  • Voice off camera. Write the master so nobody speaks on screen, or cut so each line lands over a product shot or a back view. The language track then fits any market.
  • No text in the picture. Keep supers, prices and end cards out of the master and add them per market in the edit: the swap changes faces only, so a burned-in English line stays English. The same goes for packaging and signs: shoot them neutral, or plan a local packshot.
  • Faces the edit can read. In the shots to swap, the presenter's face is clear and turned toward the camera for at least part of the shot, without a hand or a prop across it for long.
  • Shots inside the limits. Each edit takes a clip of 2 to 10 seconds, MP4 or MOV up to 64 MB, at 24 fps (the clip). Cut the master into its shots, and convert a cut made at 25 or 30 fps to 24 fps first.
  • A list of the shots with the presenter. Only those are swapped. The packshot, the logo and the shots without a face stay as they are in every version, which is also what keeps the cost down.
One shot of the master, at 24 fps
ffmpeg -i master.mov -ss 00:00:04.0 -t 6 -r 24 -c:v libx264 -crf 16 -c:a aac shots/02-kitchen.mp4

Every person shown has to agree to what this edit does. That means the performer in the master, whose body, voice and performance will carry another face in every market, and each local performer, whose face goes into an ad they did not shoot. Get it in writing before the first edit:

  • The original performer's release names the alteration: their performance shown with another person's face, in which markets, media and period.
  • Each local performer's release covers their face in this ad: the markets, the media (social, TV, outdoor), how long it runs, that the face is applied by AI, and what happens if they withdraw (the version comes down and its files are deleted).
  • Union or guild agreements, where the performers work under one, may set their own terms for digital alteration: check them with the performers' representatives.
  • Disclosure. Ad platforms and some laws have rules for labeling altered or synthetic people in ads. Check each platform's current ad policy, and each market's rules with counsel.

The acceptable use policy applies to every face you send and every clip you get back: never anything involving minors, never a real, identifiable person without their consent, never impersonation, fraud or anything illegal. A lookalike of a public figure who did not agree is ruled out, however the brief puts it. A refused request answers 400 content_policy and costs nothing. If your agency or app takes faces from clients, you answer for what is made with your keys: collect the releases in your product, as the personalized video guide does.

The edit: one master, a face per market

Upload each shot that shows the presenter and each market's face once, then send one edit per market and shot. The script below runs a campaign for three markets, keyed so that a rerun after a crash returns the same edits instead of paying twice (idempotency):

One edit per market and shot
import os
import time
import requests

API = "https://frameport.ai/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['FRAMEPORT_API_KEY']}"}
CAMPAIGN = "spring"
# The shots of the master that show the presenter, cut at 24 fps
SHOTS = ["shots/02-kitchen.mp4", "shots/05-door.mp4"]
# One face per market, from performers who signed a release for this ad
FACES = {"de": "talent/de.jpg", "jp": "talent/jp.jpg", "br": "talent/br.jpg"}


def upload(path, content_type):
    with open(path, "rb") as file:
        res = requests.post(
            f"{API}/uploads",
            params={"filename": os.path.basename(path)},
            headers={**HEADERS, "Content-Type": content_type},
            data=file,
        )
    res.raise_for_status()
    return res.json()["id"]


shots = {path: upload(path, "video/mp4") for path in SHOTS}
pending = {}
for market, face_path in FACES.items():
    face = upload(face_path, "image/jpeg")
    for path, clip in shots.items():
        name = os.path.basename(path)
        gen = requests.post(
            f"{API}/videos/edits",
            headers={**HEADERS, "Idempotency-Key": f"{CAMPAIGN}-{market}-{name}"},
            json={"model": "fp-replace-1", "video": clip, "faces": [face], "resolution": "1080p"},
        ).json()
        if gen.get("error"):
            raise SystemExit(f"{market} {name}: {gen['error']['code']}: {gen['error']['message']}")
        pending[gen["id"]] = (market, name)
        print(market, name, gen["input"]["duration"], "s, held", gen["reserved_usd"])

while pending:
    time.sleep(5)
    for gen_id, (market, name) in list(pending.items()):
        gen = requests.get(f"{API}/videos/edits/{gen_id}", headers=HEADERS).json()
        if gen["status"] in ("queued", "running"):
            continue
        del pending[gen_id]
        if gen["status"] == "failed":
            print(market, name, "failed, nothing charged:", gen["error"]["message"])
            continue
        os.makedirs(market, exist_ok=True)
        with requests.get(f"{API}/generations/{gen_id}/content", headers=HEADERS, stream=True) as res:
            res.raise_for_status()
            with open(os.path.join(market, name), "wb") as out:
                for chunk in res.iter_content(1 << 20):
                    out.write(chunk)
        print(market, name, "saved, charged", gen["cost_usd"])
  • Each edit is priced by its shot. By the time the 202 comes back, the shot has been measured: input.duration is the seconds it bills and reserved_usd its price. To price a campaign before sending anything, quote each shot by its length, {"model": "fp-replace-1", "resolution": "1080p", "seconds": 6}, at POST /v1/generations/quote (quotes).
  • Several people in a shot take one face each, with a targets entry saying who each face replaces. The multiple face swap guide shows how to write them.
  • Up to 20 edits run at once per workspace; past that, the API answers 429 with Retry-After (rate limits). A large campaign goes in waves, or uses webhooks instead of polling.
  • Uploads last 24 hours. Upload a campaign's shots on the day you run it, or point video at an https URL you host (uploads).

Each swapped shot comes back with the master's sound. Put the shots back over the originals in your editing project, one timeline per market, then lay the market's mix under the picture. For a spot made of a single shot, ffmpeg does it in one line, with the picture from the swap and the sound from the new mix:

Picture from the swap, sound from the market's mix
ffmpeg -i de/spot.mp4 -i audio/de-mix.wav -map 0:v -map 1:a -c:v copy -c:a aac -shortest de/spot-final.mp4

The face swap video API guide covers the request field by field, and AI video ads by API the other half of a campaign: hooks, formats and products made from one brief.

What each market version costs

An edit costs the shot's seconds, whole and rounded up with 0.15 s of grace, times the rate at its resolution. The number of faces in a shot does not change the price, and a failed edit costs nothing.

Swapped footage per market768p1080p
Per second$0.12$0.25
A 6-second shot$0.72$1.50
A 10-second shot$1.20$2.50
Sixty seconds of shots$7.20$15.00

A market costs the seconds of its swapped shots, not the length of the spot: a spot whose presenter appears in two 6-second shots bills twelve seconds per market, whatever the packshot and the end card add. For a larger master, send a swapped 1080p shot to Frameport Upscale 1 by its file id: it upscales to 2K. There is no subscription: edits are paid from a prepaid balance (pricing).

Review and publish

Watch every version in full, at full size, with its final sound, before it goes live:

  • The face in every frame: turns of the head, fast moves, a hand passing in front, the frames around each cut.
  • The face with the shot: light, skin and hair read naturally with the rest of the picture.
  • The sound against the picture: the voice-over lands on the right shots, and no mouth on screen speaks words the track does not.
  • The words of the market: supers, prices, claims and disclaimers translated and checked for that market.
  • The paperwork: a signed release on file for every face in the version, matching its markets and its period.

Then keep what you need. Output links are signed and last about an hour, and files are not kept forever (files): store each market's final cut in your own storage, with a record of the generation ids, the face used and its release. When a performer withdraws or a release ends, take that version down everywhere it runs.

For one market or a test, open Frameport Replace 1 in the Studio, add the shot and the face, and run the edit from the same balance. How shots and faces reach the API, by link or upload, is in upload files to an AI generation API.

FAQ

What is video ad localization with AI?

It is adapting one ad for each market with AI instead of a reshoot. Here, that means swapping the presenter's face for a local performer's, with their written consent, then laying a local voice-over and local supers in the edit.

Does Frameport translate or dub the audio?

No. Frameport Replace 1 keeps the clip's sound as it is, along with the moves and the lips. There is no video translation or dubbing API here: record or produce each language track elsewhere, then lay it under the swapped picture.

Will the lips match the new language?

No. The mouth keeps the original performance, so the words should stay off camera: a voice-over, a song, or shots where the presenter does not speak to the lens.

Whose consent do I need to localize an ad with face swap?

Everyone shown: the performer in the master, whose performance will carry another face, and each performer whose face you send. Get it in writing, naming the markets, the media, the period and the use of AI, before the first edit.

How much does a localized version cost?

The seconds of the shots you swap, at $0.12 per second at 768p or $0.25 at 1080p. A 6-second shot at 768p costs $0.72, and a failed edit costs nothing.

Start building.

Your API key is free. Top up from $10 when you are ready.