title: Use ffmpeg to add text subtitles
body: <p>I am trying to add text subtitles to an .mp4 container using ffmpeg:</p>
  
  <pre><code>ffmpeg -i input.mp4 -i input.srt -map 0.0 -map 0.1 -map 1.0 output.mp4
  </code></pre>
  
  <p>When I am trying to run this line, it gives me an error : </p>
  
  <blockquote>
    <p>Nmber of stream maps must match number of output streams. </p>
  </blockquote>
  
  <p>If I try to change the mp4 to mkv (although mp4 supports text subtitles), like this:</p>
  
  <pre><code>ffmpeg -i input.mp4 -i input.srt -map 0.0 -map 0.1 -map 1.0 output.mkv
  </code></pre>
  
  <p>It correctly maps the streams, but gives an error :</p>
  
  <blockquote>
    <p>Encoder (codec id 94210) not found for output stream #0.2 </p>
  </blockquote>
  
  <p>When I launch</p>
  
  <pre><code>ffmpeg -codecs
  </code></pre>
  
  <p>I can see that srt codec is supported as decoder and encoder, however I am not sure what is used for mp4 and mkv subs encoding, and whether I need to switch it on or compile separately.</p>