user27330: 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

user1871: 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.

27330: <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>
 1871: <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>
