Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

External files #1

Open
kenichi512 opened this issue Jun 26, 2018 · 3 comments
Open

External files #1

kenichi512 opened this issue Jun 26, 2018 · 3 comments

Comments

@kenichi512
Copy link

This works to change the internal tracks files from from one container to other. But what happens if I want to add external files like subtitles and audios of several languages? What should be added to the JSON file to continue with the loop conversion?

@Serede
Copy link
Owner

Serede commented Jun 26, 2018

Hi @kenichi512 !

The track multiplexing functionality that is coded in the JSON file belongs to the MKVToolNix project. The main limitation is that the exported options are not file-wise parameterizable, that's why here one must remove the --output setting from the JSON and use -o "mkvmerge_out/%%f" inside the FOR loop of the script (%%f is each original filename). Otherwise, a single output file would be overwritten one time after another for each input file, and only that of the last multiplexed file would remain when the script finishes.

What you are proposing requires a similar workaround: Let %%f be the name of each input MKV file, you could place the respective subtitles as subs/%%f.ass files (for example) and tell mkvmerge to include one each as a subtitle track via additional arguments in the BAT file. You can try manually adding the subtitle track in the GUI and exporting the options JSON file to get an idea of how the command should look like.

Feel free to experiment and submit a pull request when you get it done!

@kenichi512
Copy link
Author

I clarify that my knowledge in DOS are very few, but someone helped me a long time ago with this CLI for the same purpose.

@echo off set "mkvmerge=drive\path\mkvmerge\mkvmerge.exe" FOR %%I in (drive\path\*.MP4) DO "%mkvmerge%" --output "drive\path\output\%%~nI.mkv" --language 0:jpn --track-name 1:"日本語" --language 1:jpn ( "%%I" ) --sub-charset 0:UTF-8 --language 0:spa --track-name 0:"Español (México)" ( "drive\path\input\%%~nI.esLA.ass" ) --sub-charset 0:UTF-8 --language 0:eng ( "drive\path\input\%%~nI.enUS.ass" ) --sub-charset 0:UTF-8 --language 0:por --track-name 0:"Português (Brasil)" ( "drive\path\input\%%~nI.ptBR.ass" ) --track-order 0:0,0:1,1:0,2:0,3:0 PAUSE

However, this has a disadvantage and is the interpretation of code page (the tags on "--track-name"). Although I save the batch file as UTF-8, the metadata of the multiplexed video appear with other symbols. I do not understand how in MKVToolnix these errors do not happen.

@Serede
Copy link
Owner

Serede commented Jan 16, 2021

See possible workaround by @Rice14 in #6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants