# Extract a Video's Audio Track (Lossless)

Demux a video's audio track in your browser with no re-encode — lossless stream-copy into MKA, M4A or OGG. Pick the track, keep the original codec, nothing uploaded.

## Run it

- **CLI:** `gizza tool video-extract-audio-track 'url=https://example.com/input' 'container=mka' 'track=0'`
- **Web:** https://gizza.ai/tools/video-extract-audio-track/
- **Agents:** machine-readable descriptor (parameters JSON Schema) at https://gizza.ai/tools/video-extract-audio-track/tool.json

## Inputs

- `file` — Video _(file; accept: video/*)_
- `container` — Container _(field)_
- `track` — Audio track (0 = first) _(field)_

## Output

- Extracted audio (audio)

## Query parameters

Open the tool pre-filled and auto-run via URL:

- `container` — Container
- `track` — Audio track (0 = first)
- `url` — fetch the input file from a public URL (CORS-permitting)

Example: `https://gizza.ai/tools/video-extract-audio-track/?url=https://example.com/input&container=mka&track=0`

---

## Extract a video’s audio track without re-encoding

Use this when you already like the audio codec inside a video and just want the soundtrack as a standalone file. The tool runs ffmpeg locally in your browser with `-vn -map 0:a:<track> -c:a copy`, so it drops the video stream and copies the selected audio packets into a new container without changing quality.

### What to choose

- **Container** — `mka` is the safest default because Matroska audio accepts almost any codec. Choose `m4a` for AAC or ALAC audio from MP4/MOV files, and `ogg` for Vorbis or Opus audio from WebM/OGG-style sources.
- **Audio track** — `0` extracts the first audio stream. Use `1`, `2`, and so on for alternate language, commentary, or described-audio tracks in multi-track files.

### Worked example

For a normal MP4 with AAC audio, choose **M4A** and keep **track `0`**. The generated ffmpeg plan is equivalent to:

`ffmpeg -i in.mp4 -vn -map 0:a:0 -c:a copy out.m4a`

That remuxes the AAC stream into an M4A file without transcoding. If you are not sure which codec the source has, start with **MKA**.

### Limits and edge cases

- Max input and output size are **16 MB**.
- This is a demux/remux tool, not a converter. It does not change codec, bitrate, loudness, sample rate, or channels.
- Container compatibility still matters: AAC usually belongs in M4A, Vorbis/Opus in OGG, and unusual codecs in MKA.
- If the selected track does not exist, ffmpeg returns an error. Try track `0` first, then `1` for the second audio stream.

<details>
<summary>Is this lossless?</summary>

Yes. The audio stream is copied with ffmpeg’s `-c:a copy`, so samples are not decoded and encoded again. The output quality is the same as the selected audio track in the source video.

</details>

<details>
<summary>Why does the default output use MKA?</summary>

MKA is the audio-only Matroska container and can hold many codecs. It is the safest default when you do not know whether the source audio is AAC, Opus, Vorbis, ALAC, or something else.

</details>

<details>
<summary>When should I choose M4A or OGG?</summary>

Choose M4A for AAC or ALAC audio, especially from MP4 and MOV files. Choose OGG for Vorbis or Opus audio, commonly found in WebM-style workflows. If you pick a container that cannot hold the source codec, use MKA instead.

</details>

<details>
<summary>How is this different from extracting MP3 or WAV?</summary>

MP3 and WAV extraction requires re-encoding or decoding the audio into a new format. This tool keeps the original codec untouched; use the separate extract-audio-from-video or audio-convert tools when you want conversion instead of lossless demuxing.

</details>

## Related tools

- [Extract M4A Audio from MP4](https://gizza.ai/tools/mp4-to-m4a/): Extract an MP4's audio track to M4A in your browser. Lossless stream-copy remux — no re-encode, no quality loss, nothing uploaded.
- [Convert MP4 to MKV](https://gizza.ai/tools/mp4-to-mkv/): Free MP4 to MKV converter in your browser. Lossless stream-copy remux — keeps video, audio and subtitle tracks, nothing re-encoded or uploaded.
- [Convert an Audio File](https://gizza.ai/tools/audio-convert/): Convert any audio file to MP3, WAV, OGG, FLAC or M4A right in your browser — pick a bitrate for lossy formats. Runs locally, nothing is uploaded, free.
- [Extract Audio from a Video](https://gizza.ai/tools/extract-audio-from-video/): Pull the audio track out of any video as MP3 or WAV, right in your browser — pick a format and bitrate. Runs locally with ffmpeg, nothing is uploaded, free.
- [Audio Waveform Video Generator](https://gizza.ai/tools/audio-waveform-video/): Turn audio into an animated waveform MP4 in your browser. Pick mirror, bars or wave styles, colors, gradient, size and fps. Nothing uploaded.
