Log in

View Full Version : mkvmerge batch file


Cman21
31st May 2011, 14:17
hello, first off i would like to say im new to trying command line operations and it is kinda confusing with the way it was presented to me here: http://www.bunkus.org/videotools/mkvtoolnix/doc/mkvmerge.html

any way my question is how can i change the FPS on my video track, which is a .264 file, from the defaulted 25fps to 23.976fps?

i read this parts that look to be the right things to do but i just cant seem to get them to work right, prob due to the way im typin it.
--default-duration TID:x
Forces the default duration of a given track to the specified value. Also modifies the track's timecodes to match the default duration. The argument x must be postfixed with 's', 'ms', 'us', 'ns' or 'fps' to specify the default duration in seconds, milliseconds, microseconds, nanoseconds or 'frames per second' respectively. The number x itself can be a floating point number or a fraction.

If the default duration is not forced then mkvmerge will try to derive the track's default duration from the container and/or codec used. One case in which this option is of use is when adding AVC/h.264 elementary streams because these do not contain information about their number of frames or a default duration for each frame. For such files mkvmerge(1) will assume a default duration of '25fps' unless overridden.

This option can also be used to change the FPS of video tracks without having to use an external timecode file.

i have tried a few things so i'll just give you my latest try
"C:\Program Files (x86)\MKVtoolnix\mkvmerge.exe" -o "Ep 01.mkv" -A --default-duration TID:23.976fps "Ep 01 1080p.264" "Ep 01.ac3"

it errors out saying something about TID but i dont find anything useful on the site listed about as to what that is or could be. so if i could get this thing straighted out on how to properly change the fps on the .264 video track it will be a GREAT help over trying to do this individually over the gui interface.

also does anyone know if there is a gui that can give you the batch commands like mkvextract 2? as i quite often have more complicated merges that i would also like to make into a batch process.

Groucho2004
31st May 2011, 14:31
TID is the track ID. So, to set the fps to 23.976 use:
--default-duration 0:24000/1001fps

Cman21
31st May 2011, 14:36
thank you, that did the trick. so now does anyone know anything about my second question?

Groucho2004
31st May 2011, 14:41
thank you, that did the trick. so now does anyone know anything about my second question?

I'm not sure what you mean by "a gui that can give you the batch commands like mkvextract 2".

Cman21
31st May 2011, 14:51
MKVExtractGUI2 has a button you can press that will give you the batch command to do the extraction that you have set up. i was wanting to know if there is anything like that for mkvmerge to where i set up everything and it will give me the batch command in order to simple copy it over to a batch file, edit file names, and then run it across many files doing the same thing.

Groucho2004
31st May 2011, 14:52
MMG has that option in the "Muxing" menu.

Chumbo
31st May 2011, 15:16
This won't actually change the fps on the video stream, but works great as I do this all the time with 25fps material. Just drag your file on the UI, select the video track and click the Format specific options tab. Then set FPS to 24000/1001 and click the Copy to clipboard to copy the command line to the clipboard which you can then paste and edit as needed into your text editor.

Note the obvious, that you'll need to reencode the audio from 25 down to 23.976. I do this with wavi and aften, but you can do it with eac3to, BeHappy and other ways. If you have a lot of files, then the batch file is handy for doing batches. If you just do one file at a time every so often, then stick to the mkvmerge GUI.

Cman21
31st May 2011, 17:51
well the .264 video was encoded @ 23.976fps but the .264 doesn't contain any meta data for mkvmerge to determine the fps which is why i needed to know how to change mkvmerge from defaulting it to 25 fps and making the video play faster and making the audio get out of sync. so there is no actual change in the video fps for what i needed to do.

and about that option in the muxing menu, WTF i swear i check all the menus for that kind of thing! -_- guess i was looking for batch and not command line and just glanced over it. anyway...

Thank you for all your help, it is greatly appreciated.