I have about 12,600 MKV files that I need to do header edits on. Specifically, I want to set the "default" and "forced" flags on the first subtitle track of each, and maybe set the title to match the file name.
I can do this one file at a time with the header editor in mkvtoolnix, but that's far more tedious than I want to do. I'm not unwilling to use mkvmerge to do it if I have to re-write the files.
But, I figured I'd ask if there was a better way. I can script it for Windows or Linux as necessary, since both have access to the files, I just need the magic incantation.
(and the reason is that I finally discovered that the FORCED track flag works with some player to do what the DEFAULT flag is supposed to do.)
Command line MKV header editing
Command line MKV header editing
MakeMKV Frequently Asked Questions
FAQ about BETA and PERMANENT keys.
How to aid in finding the answer to your problem: Activating Debug Logging
FAQ about BETA and PERMANENT keys.
How to aid in finding the answer to your problem: Activating Debug Logging
Re: Command line MKV header editing
JMkvpropedit v1.4.3 - Batch GUI for mkvpropedit
allows you to set flags and generate a command-line. I'd start with this but if it does not work, I have a batch on my system somewhere that could help as well. Gonna check it out if you don't make progress.
allows you to set flags and generate a command-line. I'd start with this but if it does not work, I have a batch on my system somewhere that could help as well. Gonna check it out if you don't make progress.
MultiMakeMKV: MakeMKV batch processing (Win)
MultiShrink: DVD Shrink batch processing
Offizieller Uebersetzer von DVD Shrink deutsch
MultiShrink: DVD Shrink batch processing
Offizieller Uebersetzer von DVD Shrink deutsch
Re: Command line MKV header editing
Hmm... I'd have to re-do my Java configuration to run it, but I can take a look at that (currently only MakeMKV can use/find Java on my system).
Although I just noticed that my copy of mkvpropedit is VERY old. Will have to go fetch the latest.
Thanks!
Although I just noticed that my copy of mkvpropedit is VERY old. Will have to go fetch the latest.
Thanks!
MakeMKV Frequently Asked Questions
FAQ about BETA and PERMANENT keys.
How to aid in finding the answer to your problem: Activating Debug Logging
FAQ about BETA and PERMANENT keys.
How to aid in finding the answer to your problem: Activating Debug Logging
Re: Command line MKV header editing
After over two months, I finally got motivated enough to dig through the MKVPropEdit documents to get the syntax right for my batch file. So I figured I should finish off this topic.
Saved this as SetSubtitleFlags.bat and I can call it with:
It makes a bunch of assumptions, of course - the main one being that the FIRST subtitle track is always the one I want to be forced to play.
I still have to run it against all those files in all those directories, but it definitely will be faster than clicking.
Code: Select all
(path to executable)\mkvpropedit.exe %1 -e track:s1 --set flag-default=1 --set flag-forced=1
Code: Select all
call SetSubtitleFlags "File To Set Flags On.mkv"
I still have to run it against all those files in all those directories, but it definitely will be faster than clicking.
MakeMKV Frequently Asked Questions
FAQ about BETA and PERMANENT keys.
How to aid in finding the answer to your problem: Activating Debug Logging
FAQ about BETA and PERMANENT keys.
How to aid in finding the answer to your problem: Activating Debug Logging
Re: Command line MKV header editing
I updated my SetSubtitleFlags.bat to also set the file title. Some disks I have do not have single-episode playlists, so I break them up with handbrake... except that handbrake's modern iterations will copy the title in the source MKV to the destination MKV, so all the episodes output will appear to be the same name as the input file, when viewed on a media server.
The new batch file copies the file name portion to the title field in the MKV file:
With this, when given the file path "V:\anime\dubbed\Irregular at Magic High School\The Irregular at Magic High School Visitor Arc HD01.mkv", the title is set to The Irregular at Magic High School Visitor Arc HD01 (along with the subtitle track flags being set).
The new batch file copies the file name portion to the title field in the MKV file:
Code: Select all
(path to executable)\mkvpropedit.exe %1 -e track:s1 --set flag-default=1 --set flag-forced=1 --edit info --set "title=%~n1"
MakeMKV Frequently Asked Questions
FAQ about BETA and PERMANENT keys.
How to aid in finding the answer to your problem: Activating Debug Logging
FAQ about BETA and PERMANENT keys.
How to aid in finding the answer to your problem: Activating Debug Logging