User Tools

Site Tools


ffmpeg:subtitles:add_subtitles_from_another_file

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
ffmpeg:subtitles:add_subtitles_from_another_file [2024/12/30 19:30] – created peterffmpeg:subtitles:add_subtitles_from_another_file [2024/12/30 19:37] (current) peter
Line 1: Line 1:
 ====== ffmpeg - Subtitles - Add subtitles from another file ====== ====== ffmpeg - Subtitles - Add subtitles from another file ======
  
-Assuming a.mkv contains only the **video** and **audio**, but b.mkv contains **subtitle** data to be included.+Assuming 
 + 
 +  * a.mkv contains only the **video** and **audio**
 +  * b.mkv contains some **subtitle** data to be included
  
 <code bash> <code bash>
 ffmpeg -i a.mkv -i b.mkv -c:v copy -c:a copy -c:s copy -map 0:0 -map 0:1 -map 1:2 -y out.mkv ffmpeg -i a.mkv -i b.mkv -c:v copy -c:a copy -c:s copy -map 0:0 -map 0:1 -map 1:2 -y out.mkv
 </code> </code>
 +
 +<WRAP info>
 +**NOTE:**  The mapping syntax is:
 +
 +  * **0:0** refers to stream 0 from file 0 (the first file, which is a.mkv).
 +  * **0:1** refers to stream 1 from file 0 (the first file, which is a.mkv).
 +  * **1:2** refers to stream 2 from file 1 (the second file, which is b.mkv).
 +
 +
 +To determine the mapping for the subtitle, run:
 +
 +<code bash>
 +ffmpeg -i b.mkv
 +</code>
 +
 +and see which stream contains the **subtitle** data.
 +
 +</WRAP>
 +
ffmpeg/subtitles/add_subtitles_from_another_file.1735587017.txt.gz · Last modified: 2024/12/30 19:30 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki