mux_media
Combine or replace video and audio streams, offset audio timing, and use stream copy or replace/add mapping to create a muxed output file without re-encoding video.
Instructions
Combine or replace video and audio streams. Takes a video file and an audio track, with optional audio delay offset, stream-copy mode for zero quality loss, and 'replace' or 'add' stream mapping.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"videoPath": "<videoPath>",
"audioPath": "<audioPath>",
"outputPath": "<outputPath>"
},
"name": "mux_media"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Muxing mode: 'replace' drops existing video audio and uses new audio; 'add' keeps original audio and adds new audio as secondary track. Default: 'replace'. | replace |
| shortest | No | End output when the shorter input stream finishes. Default: true. | |
| audioPath | Yes | Path to the source audio file (.mp3, .wav, .aac, .m4a, etc.) to mux. | |
| videoPath | Yes | Path to the source video file. | |
| outputPath | Yes | Target output video path (.mp4, .mov, or .mkv). | |
| streamCopyVideo | No | Use stream copy (-c:v copy) for instantaneous video multiplexing without quality loss. Default: true. | |
| audioOffsetSeconds | No | Audio delay or advance in seconds. Positive numbers delay audio; negative numbers advance it. Default: 0. | |
| hardwareAcceleration | No | Use hardware-accelerated video encoding when streamCopyVideo is false. Default: true. |