MKVMerge Batch edit Mkv files script

July 7, 2010 at 19:52:11
Specs: Windows 7
I have some MKV files that are dual audio/Subtitle and I would like to remove the unnecessary audio/subtitle streams and remux. As there is one hundred episodes I was wondering If I could use a script to do this?

The files are TV series so the things that need to be removed have the same ID.


See More: MKVMerge Batch edit Mkv files script

Report •

July 7, 2010 at 19:54:25
oops I forgot to ask for the script XD If someone could make me a script that does this for MKVMerge or any other program That would be awesome :)

also the files are located at

ID’s that need to be removed are 2, 4,6,7
ID'S That want to be kept are 1,3,5
If you need any other info please ask me :)

If possible I Would like to request another script as well. To Mux mkvs and subtitle files together.

Report •

July 7, 2010 at 22:48:44
What codecs are involved? The reason I ask, I wrote an h264/AC3 script that calls eac3to and mp4creator (or mp4box) that extracts audio and video tracks based on preference, then remuxes them into an mp4 container which is compatible with TiVo. You may be able to use that.


Insomniac at large

Report •

July 7, 2010 at 23:48:18
Well the source Varies, The video is MPEG4/H.264 the audio depending on the show is FLAC, AAC, AC3 or Vorbis and they are all stored inside a MKV.

I would prefer to leave the other tracks untouched and keep the .MKV container. Would it easy/possible to edit the script to have the output in a .mkv container instead of .mp4?

Also does the script support subtitles? as the mkvs have subtitles I want to keep. The subtitles are .ass


Report •

Related Solutions

July 8, 2010 at 05:51:55
I've found a way. Although its a very very long way to do what I want.

1. use a auto renamer to make all files have almost the same file name like "nameep1.mkv" "nameep2.mkv"

2. Do what You want done with the first file in Mkvmerge (Including the output directory) but dont click the start muxing buttion. click muxing on the menu and choose copy command line to clip board.

Now in a text editor, paste what you just copied and copy that command out for how ever many episodes you want done now all you need to do is change the file input and output names in each copy to the other episodes. e.g nameep1.mkv to nameep2.mkv

The only problem now is finding a program that will automatically edit the "ep1" in the copies to "ep2" "ep3" and so on. So this doesnt have to be done Manually. Does anyone know of a program that can do this?

Report •

October 2, 2010 at 19:05:47
In case you're still looking to do this, MKV can do this without a script. After you open your file and deselect any tracks you don't want, click on Muxing at the top and choose add to job queue. Then remove all and add another video file and do the same thing, adding as many jobs as you want. Then go to the Muxing menu and Manage jobs, then start them.

Report •

Ask Question