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 » Fri Sep 06, 2019 8:12 pm

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: 78
Joined: Thu Aug 22, 2013 5:14 pm
Contact:

Re: How to copy existing subtitles

Post by Reino » Mon Sep 09, 2019 12:09 am

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 » Tue Sep 17, 2019 11:46 am

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

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

Re: How to copy existing subtitles

Post by Reino » Tue Sep 17, 2019 10:39 pm

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 » Sat Sep 21, 2019 9:20 am

Thank you. It worked.

Post Reply
'