Hi everyone,
I want to add 3 chapters to upwards of 35 MKV files at the same time (without having to add them one by one)
- Default chapter 00:00:00
- Intro: The intro time for ALL files is exactly the same.
- Outro: The outro is the same in duration but the files are not the same in length.
Questions:
- Is there a way to add chapters to all the files at the same time instead of one by one?
- Is there a way to make the outro chapter count negatively from the total duration of the video?
i.e. One file is 10 minutes and another is 11 and the outro is 15 seconds, make the outro count -15 seconds from the end of each video so its marker would be at 00:09:45 for the first file but it would be at 00:10:45 for the second (and the same would apply for the rest of the MKVs).
macOS High Sierra 10.13.3 in case there are any software recommendations.
+ Reply to Thread
Results 1 to 16 of 16
-
-
Hard questions!
I can give you some directions, I don't use MKV in years.
- Is there a way to add chapters to all the files at the same time instead of one by one?
Drag all your files in to it, load the chapters at the chapter tab and run, you'll have to try and work it out to fit your needs.
If I remember right, this tool show a command line, you can copy that and do something like this at yout terminal:
Code:for f in *.mkv; do "command $f"; done
Last edited by amaipaipai; 27th May 2018 at 18:38.
-
Thank you for your response!
I know MKVToolnix and I have it, but I'm not sure I understand your instructions. Can you make it more newbie-friendly please? -
Drag and drop all your files over the tool, load the chapters and click apply.
-
I don't think mkvtoolnix has a built-in way to set times as negative integers from the end. You'd have to write a script/program yourself that calculates them from the duration (the duration you can get via e.g. mkvinfo or MediaInfo).
-
As stated, he need to see the tool working and adapt for his needs. There's no magic script to do what he need with one click, he need to calculate and create the chapters he needs to apply to.
-
This thread has many examples of how to use FOR loops in batch files to process many files:
https://forum.videohelp.com/threads/356314-How-to-batch-convert-multiplex-any-files-with-ffmpeg
What you want to do is get the length of the video with MkvInfo or MediaInfo or ffprobe, subtract 15 seconds, then pass that to MkvMerge as a chapter point. -
-
Are you saying there is no way to automate this operation and I have to do the files one by one?
Does that mean programming knowledge is required? Or is that something simple to learn?
Do you think Handbrake is a good alternative? Is there something better you can recommend? -
-
Are you saying there is no way to automate this operation and I have to do the files one by one?
https://forum.videohelp.com/threads/389108-Batch-Adding-Chapters-to-Multiple-MKV-Files#post2520852
Then copy the "command" to a bash script and run:
Code:for f in *.mkv; do "command $f"; done
-
We might be using different versions of MKVToolNix, because on mine you can't open multiple files under the same instance in the chapter editor.
That or I still don't really understand the instructions clearly.
Although I don't have the programming knowledge to try this approach, I think I understand it.
Thank you -
Maybe we are.
You don't need to open multiple instances of the chapter editor, all you have to do is to get the COMMAND
Code:for f in *.mkv; do what_ever_mkvtoonix_command_is_doing_to_mux_your_chapters_to_the_files$f; done
Code:for f in *.mkv; do ""/usr/bin/mkvmerge" --ui-language en --output ^"D:\videos\$f^" --language 0:und --language 1:por ^"^(^" ^"D:\videos\$f^" ^"^)^" --chapter-language eng --chapter-charset UTF-8 --chapters ^"D:\videos\CHAPTER.xml^" --chapter-language eng --generate-chapters when-appending --track-order 0:0,0:1"; done
Sorry, I don't know how to help you with that.
Similar Threads
-
Batch Remove Cover From Multiple MKV Files
By MohamedYousri in forum Newbie / General discussionsReplies: 4Last Post: 5th Oct 2017, 13:27 -
Batch script for removing/adding mkv covers
By piratikxd in forum ProgrammingReplies: 1Last Post: 6th Jun 2017, 08:47 -
Chapters for MKV files with multiple tracks
By mBrane in forum Video ConversionReplies: 3Last Post: 24th Jun 2015, 21:04 -
merge multiple files into MKV container, and autogenerate chapters
By axeon73 in forum Newbie / General discussionsReplies: 0Last Post: 23rd Jun 2015, 18:46 -
Adding chapters and subtitles at the same time for mkv files
By johns0 in forum SubtitleReplies: 14Last Post: 31st Mar 2014, 00:40