Mix audio with FFmpeg

Use the ready-now ffmpeg.audio_mix.v1 service to layer music or voice over a video and retrieve the completed MP4.

Use the live audio-mix service

Confirm ffmpeg.audio_mix.v1 in GET /v1/services. The FFmpeg API is ready now for mixing audio into source footage you already have.

Upload video and audio

Call POST /v1/assets for the MP4 and for each M4A or WAV track, with public_intent set to true. Each file can be up to 32 MiB. Upload each file and save its input_url. Input links last 24 hours.

Submit the mix

Send the video in input_url and each audio source in tracks to POST /v1/jobs with an Idempotency-Key. Save the returned job ID.

Request body
{
  "service_id": "ffmpeg.audio_mix.v1",
  "input": {
    "input_url": "<video input_url>",
    "tracks": [
      {
        "input_url": "<audio input_url>",
        "role": "music"
      }
    ]
  }
}

Retrieve the MP4

When the job status is succeeded, request GET /v1/jobs/{id}/output and download the file from the returned URL.