<p>If you don't use the <code>-map</code> options, then by <a href="https://video.stackexchange.com/a/27779/18155">ffmpeg Documentation </a>:</p>
<blockquote>
<p>ffmpeg will pick one stream, when available, from among all the inputs.</p>
</blockquote>
<p>It means that it selects only one video stream, <strong>only one audio stream</strong>, and only one subtitle stream (by criteria listed in that doc).</p>
<p>So you have to use <code>-map</code> option:</p>
<pre><code>ffmpeg -i movie.mkv -i subtitles.ass -map 0:v -c copy -map 0:a -c copy -map 1:s -c copy &quot;movie with subtitles.mkv&quot;
</code></pre>
<hr />
<p><em>The detailed explanation:</em></p>
<pre><code>ffmpeg -i movie.mkv -i subtitles.ass ...
</code></pre>
<p><strong>Input files</strong> are introduced with <code>-i</code> options, and are enumerated from <code>0</code>, so</p>
<ul>
<li><code>movie.mkv</code> has the number <code>0</code>,</li>
<li><code>subtitles.ass</code> has the number <code>1</code>.</li>
</ul>
<p>This number is the first one in every <code>-map</code> option:</p>
<pre><code>... -map 0:v -map 0:a:0 - map 0:a:1 -map 1:s ...
</code></pre>
<p>After the semicolon (<code>:</code>) may be the <strong>stream specifier</strong>, in your case:</p>
<ul>
<li><code>v</code> for video stream</li>
<li><code>a</code> for audio stream</li>
<li><code>s</code> for subtitle stream</li>
</ul>
<p>If there is <em>only one</em> video stream or <em>only one</em> audio stream or <em>only one</em> subtitle stream in a particular input file, there is nothing more to specify:</p>
<pre><code>... -map 0:v ... -map 1:s ...
</code></pre>
<p>In your more complicated case with more audio streams, after another semicolon you may specify its <code>ordinal number</code>, enumerated again from <code>0</code>:</p>
<pre><code>... -map 0:a:0 -map 0:a:1 ...
</code></pre>
<p>or – in your case - you my simply omit ordinal number to select <em>all</em> audio streams:</p>
<pre><code>... -map 0:a ...
</code></pre>
<hr />
<p><em>Note:</em></p>
<p>The offered command may be further simplified.</p>
<p>To better understand stream specifiers (as e.g. <code>0:a:1</code>), see <a href="https://video.stackexchange.com/a/27779/18155">my another answer</a> – at least the picture near the end of it.</p>

CC BY-SA 4.0
2023-08-28T23:36:31.633Z
2023-08-29T00:38:25.613Z
2023-08-29T00:38:25.613Z
MarianD
<p>I have a video with 2 audio tracks.</p>
<p>After using the following command line
the other audio track is gone</p>
<pre><code>ffmpeg -i &quot;movie.mkv&quot; -i &quot;subtitles.ass&quot; -c:v copy -c:a copy -c:s copy &quot;movie with subtitles.mkv&quot;
</code></pre>
<p>What am I doing wrong?</p>

CC BY-SA 4.0
2023-08-26T06:05:55.390Z
try to add mapping: `ffmpeg -i "movie.mkv" -i "subtitles.ass" -map 0 -map 1 -c copy "movie with subtitles.mkv"`
Баяр Гончикжапов
<ffmpeg><video><encoding><subtitles>
After adding subtitles the second audio track gone
Natsu07
# After adding subtitles the second audio track gone

(Asked by: username_0 on 2023-08-25)

I have a video with 2 audio tracks.
After using the following command line
the other audio track is gone
ffmpeg -i "movie.mkv" -i "subtitles.ass" -c:v copy -c:a copy -c:s copy "movie with subtitles.mkv"

What am I doing wrong?

**Tags:** ffmpeg, video, encoding, subtitles

> **Comments:**
> **username_1**: try to add mapping: `ffmpeg -i "movie.mkv" -i "subtitles.ass" -map 0 -map 1 -c copy "movie with subtitles.mkv"`  

---

## 1 answers

### Answer by username_2 on 2023-08-28. Score: 0

If you don't use the -map options, then by ffmpeg Documentation :

ffmpeg will pick one stream, when available, from among all the inputs.

It means that it selects only one video stream, only one audio stream, and only one subtitle stream (by criteria listed in that doc).
So you have to use -map option:
ffmpeg -i movie.mkv -i subtitles.ass -map 0:v -c copy -map 0:a -c copy -map 1:s -c copy "movie with subtitles.mkv"


The detailed explanation:
ffmpeg -i movie.mkv -i subtitles.ass ...

Input files are introduced with -i options, and are enumerated from 0, so

movie.mkv has the number 0,
subtitles.ass has the number 1.

This number is the first one in every -map option:
... -map 0:v -map 0:a:0 - map 0:a:1 -map 1:s ...

After the semicolon (:) may be the stream specifier, in your case:

v for video stream
a for audio stream
s for subtitle stream

If there is only one video stream or only one audio stream or only one subtitle stream in a particular input file, there is nothing more to specify:
... -map 0:v ... -map 1:s ...

In your more complicated case with more audio streams, after another semicolon you may specify its ordinal number, enumerated again from 0:
... -map 0:a:0 -map 0:a:1 ...

or – in your case - you my simply omit ordinal number to select all audio streams:
... -map 0:a ...


Note:
The offered command may be further simplified.
To better understand stream specifiers (as e.g. 0:a:1), see my another answer – at least the picture near the end of it.


---

