I'm trying to loop, via batch file, through all my folders and, where external subtitle files are present, merge them into existing files. Subtitles could be srt/sub/idx/etc., basically any format. Most are English, but a few are other languages. The video files could be MP4, MKV, AVI. (Understood that ffmpeg might not support all of these.)
I don't want to "burn in" the subtitles, I just want them available.
If possible, I don't want to reencode any of the files, just add in the subtitles so I don't need the separate subtitle files.
I'd appreciate it someone could share the proper-syntax command line to do this.
I have the (however inelegant) framework (batch file), basically:
For /R %%A in (D:\Movies) Do (
If Exist %%~dpn.srt (
[awaiting ffmpeg CLI syntax]
Del %%~dpn.srt
)
For /R %%B in ("%%~dpn.*Eng.srt") Do (
[awaiting ffmpeg CLI syntax]
Del %%B
)
If Exist %%~dpn.*Ita.srt (
[awaiting ffmpeg CLI syntax]
Del %%~dpn.srt
)
For /R %%B in ("%%~dpn.*Ita.srt") Do (
[awaiting ffmpeg CLI syntax]
Del %%B
)
If Exist %%~dpn.sub (
[awaiting ffmpeg CLI syntax]
Del %%~dpn.srt
)
If Exist %%~dpn.idx (
[awaiting ffmpeg CLI syntax]
Del %%~dpn.srt
)
[repeat for each subtitle format]
)
What I'm missing is a simple clear understanding of the CLI to only embed (but not "burn in") the subtitles, without otherwise re-encoding each file (or, if re-encoding, need to make sure the file does not significantly grow).
Appreciate your help in advance.
Thank you.