audioJS

Remove or replace video audio

Drop a video. Remove its audio track, or replace it with a file of your own — the video stream is never re-encoded.

Drop a video here
or click to choose, or paste with Ctrl+V

Nothing is uploaded. Everything runs in this tab with @audio/encode-mp4, @audio/decode, @audio/encode.

Swap or strip an audio track without touching the video

Re-encoding a video just to change its soundtrack costs minutes and a generation of quality on the picture for no reason. This page rewrites only the container with @audio/encode-mp4, a pure-JavaScript ISO/IEC 14496-12 (ISOBMFF) muxer and remuxer: it copies the video track byte-for-byte, drops or replaces the audio track, and rebuilds the moov and mdat boxes around what survives. No video codec runs at all, so a two-hour 4K file remuxes about as fast as a ten-second clip.

Removing the audio track

The audio track is left out of the rebuilt file entirely, not muted or replaced with a silent placeholder — the same result as ffmpeg -an -c:v copy, done in the browser.

Replacing the audio track

The replacement file is decoded with @audio/decode, trimmed, padded with silence or looped to the video length, and encoded into the container with @audio/encode: AAC through the browser's own WebCodecs encoder, or Opus, ALAC and FLAC through pure-JavaScript encoders. @audio/encode-mp4 then interleaves the new audio chunks with the untouched video chunks by presentation time, so the file still plays progressively.

What does not work here

Fragmented MP4, the moof-based layout used by DASH and HLS streaming exports, needs a segment-aware muxer and is rejected with a clear error. MKV, WebM and AVI are different container formats altogether; re-encode them to MP4 with ffmpeg or HandBrake before using this page.

Questions

Is the video re-encoded?

No. Only the audio track and the container boxes (moov, mdat) are rewritten; the video stream is copied byte-for-byte from the source. That makes this instant even on a long file, and lossless for the picture.

Which video files work?

MP4, M4V, MOV and 3GP that store a single moov and mdat, the normal export from a phone, camera or editor. Fragmented MP4 (streamed or DASH exports) is not supported. MKV, WebM and AVI are a different container entirely and cannot be remuxed here; re-encode them to MP4 first.

Which audio formats can I use to replace the track?

Anything the decoder reads: MP3, WAV, FLAC, OGG, Opus, AAC, M4A, AIFF, CAF, WMA and AMR. It is decoded, then re-encoded into AAC, Opus, ALAC or FLAC and packed into the MP4 container.

What happens if the replacement audio runs a different length than the video?

By default it is trimmed to the video length, or padded with silence if it runs short. Check "loop the audio" to repeat it instead until the video ends.

Which audio codec should I pick?

AAC plays in every MP4 player and needs a Chromium or Safari browser to encode (WebCodecs). Opus is smaller and plays in modern browsers and VLC. ALAC and FLAC are lossless: ALAC is the safer choice on Apple players, FLAC has the narrowest player support of the four.