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

user33978: 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!"


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

19234: <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>
 33978: <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>
 1871: <p>Use</p>

<pre><code>ffmpeg -i "!original!" -map 0:v -map 0:a -c:v libx265 -preset medium -crf 28 -c:a copy "g:\Prepare\Convert\!file!"
</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>
