Answers.Body: <p>You can find detailed answer on your question <a href="https://askubuntu.com/questions/214199/how-do-i-add-and-or-keep-subtitles-when-converting-video">here</a></p>
  <p><strong>Basically you need to add &quot;-map&quot; parameter to your command.</strong></p>
  <pre><code>ffmpeg -i myMovie.mkv -c copy -map 0:v:0 -map 0:a:0 -map 0:s:0 myMovieMP4.mp4
  </code></pre>
  <p><code>-map 0:v:0</code> means, that you want to pick first video track from first input file &quot;myMovie.mkv&quot;.</p>
  <p><code>-map 0:a:0</code> means, that you want to pick first audio track from first input file &quot;myMovie.mkv&quot;.</p>
  <p><code>-map 0:s:0</code> means, that you want to pick first subtitles track from first input file &quot;myMovie.mkv&quot;.</p>
  <p>You can can input ffmpeg &quot;myMovie.mkv&quot; to look at the list of streams in the file.</p>
  <p><strong>This command with &quot;-map 0&quot; will put all available tracks into the output file:</strong></p>
  <pre><code>ffmpeg -i input.mkv -map 0 -c:v libx264 -c:a aac -c:s mov_text output.mp4
  </code></pre>
  <p><a href="https://trac.ffmpeg.org/wiki/Map" rel="nofollow noreferrer">Selecting streams with the -map option</a></p>
  <p>To burn-in subtitles you can read the link at the top of the message or find another subject here at the stackexchange.</p>
  <p><strong>Basically you can burn-in subtitles from MKV to MP4 using this command</strong></p>
  <pre><code>ffmpeg -i input.mkv -filter_complex &quot;[0:v:0]subtitles=input.mkv:si=0[v]&quot; `-map &quot;[v]&quot;` -map 0:a:0 -c:a copy output.mp4
  </code></pre>
  <p><code>[0:v:0]</code> - means, that you want to take first video stream from input file.</p>
  <p><code>:si=0</code> - means, that you want to take first subtitle stream from input file</p>
  <p><code>-map &quot;[v]&quot;</code> - means, that you want to put into your output video processed by filter_complex stream (video + subtitles).</p>
  <p><code>-map 0:a:0</code> - means, that you want to take first audio stream from input file</p>
  <p>Audio will be copied, video stream will be reencoded.
  <code>-c:v libx264</code> - reencode to x264</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-13T09:30:56.273Z
Answers.LastActivityDate: 2022-05-13T09:30:56.273Z
Answers.UserDisplayName: Viktor Liashenko
Body: <p>I have an MKV with integrated subtitles as such:</p>
  <p><a href="https://i.sstatic.net/XmKly.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/XmKly.png" alt="enter image description here" /></a></p>
  <p>I want to keep &quot;English [Full] - [English]&quot; when converting to MP4.</p>
  <p>Currently I use this command:</p>
  <pre><code>ffmpeg -i myMovie.mkv -vcodec copy -acodec copy myMovieMP4.mp4
  </code></pre>
  <p>The conversion works but the subtitles don't show up on the screen and if I go in &quot;Subtitles&quot; and select this, it still doesn't show up:</p>
  <p><a href="https://i.sstatic.net/bIjio.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/bIjio.png" alt="enter image description here" /></a></p>
  <p>Ideally, I would like to those subtitles to automatically show up when running the .mp4 (as though it was hardcoded into the video). Is there any known way of doing that?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-14T11:51:31.047Z
Comments.Text: [What should I do when someone answers my question?](https://video.stackexchange.com/help/someone-answers)
Comments.UserDisplayName: MarianD
Tags: <ffmpeg><mp4><conversion><subtitles><mkv>
Title: How can we keep the subtitle track when converting from MKV to MP4 with ffmpeg?
UserDisplayName: user38357
ThreadText: # How can we keep the subtitle track when converting from MKV to MP4 with ffmpeg?
  
  (Asked by: username_0 on 2022-05-10)
  
  I have an MKV with integrated subtitles as such:
  
  [![enter image description here](https://i.sstatic.net/XmKly.png)](https://i.sstatic.net/XmKly.png)
  
  I want to keep "English [Full] - [English]" when converting to MP4.
  
  Currently I use this command:
  
  ```
  ffmpeg -i myMovie.mkv -vcodec copy -acodec copy myMovieMP4.mp4
  
  ```
  
  The conversion works but the subtitles don't show up on the screen and if I go in "Subtitles" and select this, it still doesn't show up:
  
  [![enter image description here](https://i.sstatic.net/bIjio.png)](https://i.sstatic.net/bIjio.png)
  
  Ideally, I would like to those subtitles to automatically show up when running the .mp4 (as though it was hardcoded into the video). Is there any known way of doing that?
  
  **Tags:** ffmpeg, mp4, conversion, subtitles, mkv
  
  > **Comments:**
  > **username_1**: [What should I do when someone answers my question?](https://video.stackexchange.com/help/someone-answers)  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2022-05-13. Score: 2
  
  You can find detailed answer on your question [here](https://askubuntu.com/questions/214199/how-do-i-add-and-or-keep-subtitles-when-converting-video)
  
  **Basically you need to add "-map" parameter to your command.**
  
  ```
  ffmpeg -i myMovie.mkv -c copy -map 0:v:0 -map 0:a:0 -map 0:s:0 myMovieMP4.mp4
  
  ```
  
  `-map 0:v:0` means, that you want to pick first video track from first input file "myMovie.mkv".
  
  `-map 0:a:0` means, that you want to pick first audio track from first input file "myMovie.mkv".
  
  `-map 0:s:0` means, that you want to pick first subtitles track from first input file "myMovie.mkv".
  
  You can can input ffmpeg "myMovie.mkv" to look at the list of streams in the file.
  
  **This command with "-map 0" will put all available tracks into the output file:**
  
  ```
  ffmpeg -i input.mkv -map 0 -c:v libx264 -c:a aac -c:s mov_text output.mp4
  
  ```
  
  [Selecting streams with the -map option](https://trac.ffmpeg.org/wiki/Map)
  
  To burn-in subtitles you can read the link at the top of the message or find another subject here at the stackexchange.
  
  **Basically you can burn-in subtitles from MKV to MP4 using this command**
  
  ```
  ffmpeg -i input.mkv -filter_complex "[0:v:0]subtitles=input.mkv:si=0[v]" `-map "[v]"` -map 0:a:0 -c:a copy output.mp4
  
  ```
  
  `[0:v:0]` - means, that you want to take first video stream from input file.
  
  `:si=0` - means, that you want to take first subtitle stream from input file
  
  `-map "[v]"` - means, that you want to put into your output video processed by filter\_complex stream (video + subtitles).
  
  `-map 0:a:0` - means, that you want to take first audio stream from input file
  
  Audio will be copied, video stream will be reencoded.
  `-c:v libx264` - reencode to x264
  
  
  ---
  
  