Hi.
I've been using MKVToolNix for a while, I know how to add an srt file to an mkv video and create a new file so that the sub file is no longer a separate one. But now I need to do that with about 50 files. Does someone know how to batch remux those files? the mkvs and the srt files already have the same names, I just need to combine them all at once now.
Thank you.
+ Reply to Thread
Results 1 to 13 of 13
-
-
Put this (change the path to mkvmerge.exe) in a batch file and put the file in the folder with all you MKV and SRT files. The double click on it. All the new files with the subs muxed in will be in a subfolder called New.
Code:md New for %%F in (*.mkv) do ("G:/Program Files/mkvtoolnix\mkvmerge.exe" --output "New\%%~nF.mkv" "%%~dpnxF" "%%~dpnF.srt" ) pause
-
Hi.
I'd like to slightly change this command line so that the new subtitles are the first subs track in the file (when the file has other tracks), how can I do that?Last edited by Nico Darko; 17th Mar 2021 at 10:42.
-
This will copy all video and audio tracks from the original mp4, then the new srt (converted to timed text), then the subtitles from the original mp4:
Code:for %%f in (*.mp4) do ( ffmpeg -i "%%~f" -i "%%~dpnf.srt" -c:v copy -c:a copy -c:s mov_text -map 0:v -map 0:a -map 1:s -map 0:s "%%~dpnf+srt%%~xf" )
-
It's for a mkv, so I've changed the extension, but it doesn't work, it says:
subtitle codec 94213 is not supported. could not write headerfor output file #0 (incorrect codec parameter ?) : function not implemented.
The command line you gave me last time (for mkvtoolnix) does work though. -
-
Try this one in CMD:
Code:for %f in (*.mkv) do (ffmpeg -hide_banner -i "%f" -i "%~dpnf.srt" -map 0 -map 1 -c copy -c:s srt "%~dpnf+srt%~xf")
Last edited by JKyle; 18th Mar 2021 at 08:43.
-
@JKyle: that one didn't work either.
@jagobo: I made the change, the new file was completed but the new subtitle track is completely empty, the track was added but with no text. -
That's the command line:
Code:for %%f in (*.mkv) do ( ffmpeg -i "%%~f" -i "%%~dpnf.srt" -c:v copy -c:a copy -c:s srt -map 0:v -map 0:a -map 1:s -map 0:s "%%~dpnf+srt%%~xf" ) pause
So I don't know if something's wrong with the srt file but it works fine when I use this previous command line (the sub track is just not number 1):
md New
for %%F in (*.mkv) do ("G:/Program Files/mkvtoolnix\mkvmerge.exe" --output "New\%%~nF.mkv" "%%~dpnxF" "%%~dpnF.srt" )
Similar Threads
-
MKVmerge batch remuxing and removing subtitles?
By TE16 in forum Newbie / General discussionsReplies: 2Last Post: 23rd Sep 2017, 06:55 -
Aegisub - batch support? or better way to batch process/edit subtitles?
By Restricted in forum SubtitleReplies: 7Last Post: 5th Sep 2017, 22:10 -
Making clips from MKVs with subtitles?
By OrtegaSeason in forum Video ConversionReplies: 2Last Post: 29th Mar 2017, 13:36 -
Best choice for specific task: burning MKVs with embedded subtitles to BD
By Selenium in forum Authoring (Blu-ray)Replies: 13Last Post: 8th Jul 2016, 22:50 -
Remuxing MKV for play on PS3 with subtitles
By Gibush in forum Video ConversionReplies: 3Last Post: 17th Oct 2014, 02:38