Log in

View Full Version : How do i Merge/Joining MKV files?


wthreex
2nd July 2018, 21:41
I have several mkv videos that their resolution and audio are the same(want to be merge respectively like clip1,clip,2,...) is it possible to handle it with avisynth? :thanks:

amichaelt
2nd July 2018, 22:27
Why do you need to use Avisynth for this? Just use MKVToolNix to do this.

FranceBB
2nd July 2018, 23:27
is it possible to handle it with avisynth

Sure thing, but remember that Avisynth is a frame-server, so it will output an uncompressed audio/video stream that you'll need to encode.
What you are looking for is called "append". Many people do it on a daily basis, but... there's a catch: in order to append files together, they have to be at the same resolution, in the same color space, at the same frame-rate, at the same bit-depth, with the same number of audio channels and at the same sample rate.

Simple example (video1 and video2 are shot the same way):

video=FFVideoSource("video.mkv")
audio=FFAudioSource("video.mkv")
AudioDub(video, audio)
video1=last

video=FFVideoSource("video2.mkv")
audio=FFAudioSource("video2.mkv")
AudioDub(video, audio)
video2=last

video1++video2

This way video1 and video2 are gonna be one after another.
After you used the append function, which is "video1++video2", anything you do after that line is gonna apply to the sequence.
Now, let's suppose that video1 and video2 are different:

Video1 is: 1280x720, 23.976fps, YUY2, 1CH. 44100Hz, progressive, 8bit.

Video2 is 1920x1080, 29.970fps, yv12, 2CH. 48000Hz, progressive, 8bit.

video=FFVideoSource("video.mkv")
audiook=FFAudioSource("video.mkv")
audio=MergeChannels(audiook, audiook)
AudioDub(video, audio)
Converttoyv12()
ResampleAudio(48000)
ConvertFPS(29.970)
Spline64Resize(1920, 1080)
video1=last

video=FFVideoSource("video2.mkv")
audio=FFAudioSource("video2.mkv")
AudioDub(video, audio)
video2=last

video1++video2

In other words, you gotta make sure that videos are at the same resolution, in the same color space, at the same frame-rate, at the same bit-depth, with the same number of audio channels and at the same sample rate before you "append" them together.

That's about it. I hope this helps. ^_^

wthreex
3rd July 2018, 08:09
Thank you man, another thing that i newbie in avisynth and i just only works with MeGui, it's just Encode, how do i export uncompressed merged file with MeGui without encoding...? is it another way to that with other apps? i hears about virtualdub but have no idea what it is...

amichaelt
3rd July 2018, 13:15
Just use MKVToolNix to join the files.

kuchikirukia
3rd July 2018, 23:34
MKVToolnix GUI.

Drag and drop first file into window.
Right-click on it and select "Append files."
Select files you want to join.
Then mux.

wthreex
4th July 2018, 12:34
Ehh thank you guys! I always thought MkvMerge couldn't do that! cuz I did not see the "Append" option:helpful: