so, i have a folder full of .mkv's, i have a one liner which can convert them all to mp4's these new files now have multiple audio and subtitle streams, one eng, one ger one jap and for subtitles the same, is there an way with which i can easily specify use f.e. German audio and burn eng subtitles. My One Liner:
for /R %f IN (*.mkv) DO ffmpeg -i "%f" -c copy "%~nf.mp4"
How would i have to modify this one Liner for it to work. I found out that with -vf subtitles=foo.ass i can hardcode subtitles, but how do i select one audio and or subtitle stream from included with the file? and how would i select f.e. a audio atream but none subtitle stream
I found out, that with
-map 0:V -map 0:a:m:language:ger -map 0:s
I can get a file with which only has the german audio files, but now i need the same for the subtitles, to only include the english ones
I can get a file with which only has the german audio files, but now i need the same for the subtitles, to only include the english ones
ffmpeg -i input.mkv -map 0:v -map 0:a:m:language:ger -map 0:s:m:language:eng -c copy output.mkv
For burning subtitles you must provide the file name, and optionally a stream index. You can use ffprobe
to determine the subtitle index of the desired subtitle language:
ffprobe -v error -select_streams s -show_entries tags=language -of default=nw=1:nk=1 input.mkv
Example output:
ger
eng
So ger
is index #0 and eng
is index #1.
Final ffmpeg
command:
ffmpeg -i input.mkv -filter_complex "subtitles=f=input.mkv:si=1[v]" -map "[v]" -map 0:a:m:language:ger -c:a copy -movflags +faststart output.mp4