<p>Use</p>

<pre><code>ffmpeg -i input.mkv -map_metadata 0 -map 0 -c copy -c:a:0 ac3 -vbr 3 output.mkv
</code></pre>

<p>See <a href="https://superuser.com/a/1219824">https://superuser.com/a/1219824</a> for an illustrated guide to how stream options are parsed.</p>

CC BY-SA 4.0
2020-01-10T19:58:19.040Z
2020-01-10T19:58:19.040Z
Gyan
<p>Input: </p>

<pre><code> * One Video
 * 4 audio streams
 * Many subtitles
 * Chapters
</code></pre>

<p>I want to re-encode one of the audio streams (the first one) and keep everything else as-of (copy).<br>
Is it possible to do that in one command-line in ffmpeg?</p>

<p>So far my best 2 guesses don't work:</p>

<p><code>ffmpeg -i input.mkv -map_metadata 0 -map 0:v -c:v copy -map 0:s -c:s copy -map 0:a:0 -c:a ac3 -vbr 3 -map 0:a:1 -c:a copy -map 0:a:2 -c:a copy -map 0:a:3 -c:a copy output.mkv</code><br>
Copies everything</p>

<p><code>ffmpeg -i input.mkv -map_metadata 0 -map 0:v -c:v copy -map 0:s -c:s copy -map 0:a -c:a copy -map 0:a:0 -c:a ac3 -vbr 3 output.mkv</code><br>
Re-encodes all audio streams</p>

<ffmpeg><audio><encoding>
How to tell ffmpeg to copy all streams except one audio stream (to encode)?
Thomas
# How to tell ffmpeg to copy all streams except one audio stream (to encode)?

(Asked by: username_0 on 2020-01-10)

Input: 
 * One Video
 * 4 audio streams
 * Many subtitles
 * Chapters

I want to re-encode one of the audio streams (the first one) and keep everything else as-of (copy).
Is it possible to do that in one command-line in ffmpeg?
So far my best 2 guesses don't work:
ffmpeg -i input.mkv -map_metadata 0 -map 0:v -c:v copy -map 0:s -c:s copy -map 0:a:0 -c:a ac3 -vbr 3 -map 0:a:1 -c:a copy -map 0:a:2 -c:a copy -map 0:a:3 -c:a copy output.mkv
Copies everything
ffmpeg -i input.mkv -map_metadata 0 -map 0:v -c:v copy -map 0:s -c:s copy -map 0:a -c:a copy -map 0:a:0 -c:a ac3 -vbr 3 output.mkv
Re-encodes all audio streams

**Tags:** ffmpeg, audio, encoding


---

## 1 answers

### Answer by username_1 on 2020-01-10. Score: 6 | Accepted answer

Use
ffmpeg -i input.mkv -map_metadata 0 -map 0 -c copy -c:a:0 ac3 -vbr 3 output.mkv

See https://superuser.com/a/1219824 for an illustrated guide to how stream options are parsed.


---

