Take a ten-second MP4 with speech at the start and music in the middle. Muting the player still hands the original conversation to the recipient. This example delivers the first H.264 picture stream in a new MP4.
Procedure
-
Open a local-processing editor with a harmless sample. Allow its codec modules to load, switch the network panel offline, then import the clip. A stall while fetching Wasm means the editor needs additional cached assets.
-
Choose removal of all audio tracks on export. In an implementation using ffmpeg.wasm, write the input to its virtual file system, pass the arguments below to the engine, read the output bytes and create a downloadable Blob.
-
Use stream copy when the video codec is compatible with the output container. For multiple camera angles or subtitle tracks, enumerate streams and map the ones the recipient needs. The example deliberately keeps only the first picture stream.
-i input.mp4 -map 0:v:0 -c:v copy -an muted.mp4
Export from the browser editor
This function uses the ffmpeg.wasm 0.12-style API. Load a locally served core and Wasm bundle first, then pass the initialized instance and a File from the picker. Give each job its own worker or serialize jobs to keep file names from colliding.
async function removeAudio(ffmpeg, file) {
await ffmpeg.writeFile("source.mp4", new Uint8Array(await file.arrayBuffer()));
try {
const rc = await ffmpeg.exec(["-i", "source.mp4", "-map", "0:v:0",
"-c:v", "copy", "-an", "result.mp4"]);
if (rc !== 0) throw new Error("Mux failed: " + rc);
const bytes = await ffmpeg.readFile("result.mp4");
return new Blob([bytes], {type: "video/mp4"});
} finally {
await ffmpeg.deleteFile("source.mp4");
await ffmpeg.deleteFile("result.mp4").catch(() => {});
}
}
Use the returned Blob for the download link. Export offline and inspect the audio-stream count afterward. The first check covers the runtime path; the second covers what the recipient receives.
Choosing an approach
| Method | Output audio | Delivery use |
|---|---|---|
| Mute player | Original stream remains | Private preview |
| Encode at zero volume | Usually retains a silent stream | Pipeline requires audio |
| Map video only | No audio stream | Silent footage |
Check the result
Close the editor and reopen the result in another player. Its media inspector should list zero audio streams. Check duration, rotation and both ends of the picture. Release object URLs and virtual files after download so the next job can reuse memory.
Follow the browser file-flow check to inspect what happens after reconnection.
Frequently asked questions
Can the editor start offline on its first visit?
Only if the page and codec assets are already available locally. Finish one offline test export before handling the real footage.
Why is the output almost as large?
Video can account for most of the bytes. Inspect the stream list to establish that the audio was removed.
References
Related reading
- Designing a private media tool in the browser
- Extract video frames into a contact sheet you can trace back to the shot