<p>I have found that using -map 0 will select <em>all</em> tracks, including subtitles if available.</p>
<pre><code>ffmpeg -i &quot;!original!&quot; -map 0 -c:v libx265 -preset medium -crf 28 -c:a copy &quot;g:\Prepare\Convert\!file!&quot;
</code></pre>

CC BY-SA 4.0
2021-05-21T08:15:10.863Z
Saved my day !!
Toodoo
CC BY-SA 4.0
2021-02-20T11:28:16.800Z
2021-02-20T11:28:16.800Z
Uncle Graham
<p>Use</p>
<pre><code>ffmpeg -i &quot;!original!&quot; \
    -map 0:v \
    -map 0:a \
    -c:v libx265 \
    -preset medium \
    -crf 28 \
    -c:a copy \
    &quot;g:\Prepare\Convert\!file!&quot;
</code></pre>
<p>FFmpeg by default only picks one video, audio and subtitle track (if they are present) from among the sources. Express map assignments are required in order to include other streams. <code>0:a</code> selects all audio streams.</p>

CC BY-SA 4.0
2017-06-20T10:02:16.797Z
2023-11-20T04:03:25.653Z
2023-11-20T04:03:25.653Z
Gyan
<p>I am converting an mkv h.264 video to HEVC. The file has two audio tracks. How can I copy all audio tracks?</p>

<p>I used this command (from a <code>.bat</code> file):</p>

<pre><code>ffmpeg -i "!original!" -c:v libx265 -preset medium -crf 28 -c:a copy "g:\Prepare\Convert\!file!"
</code></pre>

<p>This exports only one audio track, but I always I need to copy all audio tracks.</p>

<ffmpeg>
ffmpeg - video conversion with multiple audio tracks
koca2000
# ffmpeg - video conversion with multiple audio tracks

(Asked by: username_0 on 2017-06-20)

I am converting an mkv h.264 video to HEVC. The file has two audio tracks. How can I copy all audio tracks?
I used this command (from a .bat file):
ffmpeg -i "!original!" -c:v libx265 -preset medium -crf 28 -c:a copy "g:\Prepare\Convert\!file!"

This exports only one audio track, but I always I need to copy all audio tracks.

**Tags:** ffmpeg


---

## 2 answers

### Answer by username_3 on 2017-06-20. Score: 9 | Accepted answer

Use
ffmpeg -i "!original!" \
    -map 0:v \
    -map 0:a \
    -c:v libx265 \
    -preset medium \
    -crf 28 \
    -c:a copy \
    "g:\Prepare\Convert\!file!"

FFmpeg by default only picks one video, audio and subtitle track (if they are present) from among the sources. Express map assignments are required in order to include other streams. 0:a selects all audio streams.


---

### Answer by username_1 on 2021-02-20. Score: 5

I have found that using -map 0 will select all tracks, including subtitles if available.
ffmpeg -i "!original!" -map 0 -c:v libx265 -preset medium -crf 28 -c:a copy "g:\Prepare\Convert\!file!"

> **Comments:**
> **username_2**: Saved my day !!  

---

