← All tools
Add audio to video
Videovideo.add_audio
in: video, audioout: video
Attach an audio track to a video (replace the existing audio or mix with it).
Pricing
- Price
- 6.25 cr / second
Prices in credits (1 credit = $0.01).
Add Audio to Video
Attach an audio track to a video, either replacing the existing audio entirely or mixing it with the audio already present in the video.
When to use
- Add a voiceover or narration to a silent or muted video clip.
- Replace a shaky on-camera audio track with a studio-recorded version.
- Mix in background music alongside the original dialogue/audio.
Inputs & outputs
| Input modality | Video file (URL) + Audio file (URL) |
| Output modality | Video file (GCS URL) |
| Max input duration | 30 min |
| Max input size | 5 GB |
Parameters
| Param | Required | Description |
|---|---|---|
mode | no (default replace) | replace drops the video's original audio and uses the new track; mix combines both audio tracks. |
shortest | no | When true, trims the output to the length of the shorter of the two inputs. |
Examples
Replace the original audio track
{
"type": "video.add_audio",
"input": { "video_url": "gs://infery-prod-media/example/input.mp4", "audio_url": "gs://infery-prod-media/example/voiceover.mp3" },
"params": { "mode": "replace" }
}
Mix a music bed under the existing audio
{
"type": "video.add_audio",
"input": { "video_url": "gs://infery-prod-media/example/input.mp4", "audio_url": "gs://infery-prod-media/example/music.mp3" },
"params": { "mode": "mix", "shortest": true }
}
Related capabilities
video.extract_audio— pull the existing audio track out before replacing itvideo.trim— trim the video or audio to matching lengths beforehandvideo.pipeline— chain add_audio with other operations in one step
Examples
Replace audio track
{
"mode": "replace"
}