ffmpeg:subtitles:add_subtitles_from_another_file
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
ffmpeg:subtitles:add_subtitles_from_another_file [2024/12/30 19:30] – created peter | ffmpeg: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 | ||
<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 | ||
</ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | * **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 | ||
+ | </ | ||
+ | |||
+ | and see which stream contains the **subtitle** data. | ||
+ | |||
+ | </ | ||
+ |
ffmpeg/subtitles/add_subtitles_from_another_file.1735587017.txt.gz · Last modified: 2024/12/30 19:30 by peter