How to copy existing subtitles

Questions involving a Windows version of FFmpeg.
Post Reply
joegreen
Posts: 5
Joined: Sat Aug 10, 2019 7:30 pm

How to copy existing subtitles

Post by joegreen »

Hello there!

I have an input.mkv file with a video, DTS audio and only one subtitle stream in it. I'm copying video, DTS audio and converting DTS to AC3 and adding ac3 audio to output.mkv file.

How to I copy existing subtitle stream to output.mkv?

Here is my command

Code: Select all

ffmpeg -i input.mkv -map 0:v:0 -c:v copy -map 0:a:0 -c:a:0 copy -map 0:a:0 -c:a:1 ac3 -ar 48k output.mkv
Joe

Reino
Posts: 94
Joined: Thu Aug 22, 2013 5:14 pm
Contact:

Re: How to copy existing subtitles

Post by Reino »

If it only has 1 stream of each type, then...

Code: Select all

ffmpeg -i input.mkv -c copy -c:a ac3 output.mkv
...would do.

joegreen
Posts: 5
Joined: Sat Aug 10, 2019 7:30 pm

Re: How to copy existing subtitles

Post by joegreen »

How do I specify if a specific subtitle stream if there are 3.

Reino
Posts: 94
Joined: Thu Aug 22, 2013 5:14 pm
Contact:

Re: How to copy existing subtitles

Post by Reino »

If for instance you want to copy the 2nd subtitle-stream:

Code: Select all

ffmpeg -i input.mkv -map 0:v:0 -c:v copy -map 0:a:0 -c:a:0 copy -map 0:a:0 -c:a:1 ac3 -ar 48k -map 0:s:1 -c:s copy output.mkv
or

Code: Select all

ffmpeg -i input.mkv -map 0:v:0 -map 0:a:0 -c copy -map 0:a:0 -c:a:1 ac3 -ar 48k -map 0:s:1 -c:s copy output.mkv
or

Code: Select all

ffmpeg -i input.mkv -map 0:0 -map 0:1 -c copy -map 0:1 -c:a:1 ac3 -ar 48k -map 0:3 -c:s copy output.mkv

joegreen
Posts: 5
Joined: Sat Aug 10, 2019 7:30 pm

Re: How to copy existing subtitles

Post by joegreen »

Thank you. It worked.

Post Reply