Hey guys,
I'm trying to join a couple of mkv files. Let's say for instance these are called V1, V2, V3 and V4.
I know that they need to be identical in terms of video resolution and codec, so I am to be able to append one to another.
I have checked each video and compared the details using MediaInfo with every other video and they seem identical (apart from overall bitrate, which is to be expected).
However, when trying to append them using MKVToolNix or AVIdemux it doesn't work.
Then I noticed there was a small difference when opening them in MKVExtractGUI:
V1: [video][V_MPEG4/ISO/AVC][H.264 1904x1072 L4.1][eng][1904x1072][length 44 (h.264 profile: High @L4.1)][0 ms][0 ms] Duration: 00:00:30
V2: [video][V_MPEG4/ISO/AVC][H.264 1904x1072 L4.1][eng][1904x1072][length 41 (h.264 profile: High @L4.1)][0 ms][0 ms] Duration: 00:01:30
V3: [video][V_MPEG4/ISO/AVC][H.264 1904x1072 L4.1][eng][1904x1072][length 44 (h.264 profile: High @L4.1)][0 ms][0 ms] Duration: 00:30:00
V4: [video][V_MPEG4/ISO/AVC][H.264 1904x1072 L4.1][eng][1904x1072][length 45 (h.264 profile: High @L4.1)][0 ms][0 ms] Duration: 00:01:30
My question is how can I change V2 and V4 to match the rest of the video files. BTW i joined V1 and V3 and they worked, so the issue is definitely this 'length'. Unfortunately i have no idea what it is.
All suggestions are appreciated.
Thanks
+ Reply to Thread
Results 1 to 11 of 11
-
Last edited by thufz; 29th Jan 2016 at 19:28.
-
H.264 can have more underlying differences than what can be seen in MediaInfo. The most "proper" solution is to re-encode all (minus 1) parts so they match exactly.
What works in many (but not all players) is to append them anyways while making sure the H.264 headers are repeated throughout the stream. You can try to use ffmpeg's "concat demuxer" for that: https://trac.ffmpeg.org/wiki/Concatenate
"doesn't work" as in "video becomes b0orked in my player" or as in "I see an mkvmerge warning message"? Because the warning message alone does not necessarily mean there's a problem. Test in your player. -
-
If you don't know how you have to re-encode all parts using exactly the same settings in x264 with the added parameter "--stitchable" in the encoding software of your choice. Then you should be able no append them using mkvmerge without the screen becoming green.
Or you try the ffmpeg method I mentioned above. -
if you really want to join them put them all onto the timeline of a video editor and render them out to a single new video. or find the original source and make your own.
--
"a lot of people are better dead" - prisoner KSC2-303 -
I read through the ffmpeg method and honestly I don't understand it.
Isn't there a simpler way of doing this. All I want to do is combine the four videos into one output file. that will play as normal with no faults (e.g. green screen)
As you suggested above I could re-encode the shorter video files to match the bigger one and then append using mkvmerge. Could you tell me how to do this (in simple terms).
I really don't want to re-encode every part and go through hours of re-encoding.
Would really appreciate it. Thanks -
Thank you. FFmpeg Concat demux worked perfectly.
To anyone who comes onto this thread and requires a more detailed explanation, just follow these steps:- Download FFmpeg for the operating system you are using (e.g. Windows)
- Extract it
- Create a mylist.txt
Note: you can call it anything, just make sure to correctly put down the name of the file in the ff-prompt - Open the .txt file and enter the following:
file '/path/to/file1' (e.g. 'C:\Videos\V1.mkv')
file '/path/to/file2' (e.g. 'C:\Videos\V2.mkv')
file '/path/to/file3' (e.g. 'C:\Videos\V3.mkv')
file '/path/to/file4' (e.g. 'C:\Videos\V4.mkv')
etc. - Save the .txt file
- Open ff-prompt
- Enter:
ffmpeg -f concat -i mylist.txt -c copy output
(e.g. ffmpeg -f concat -i C:\Videos\ffmpeg 2.8.6\mylist.txt -c copy C:\Videos\output.mkv)
Note: Make sure to put down the correct path to your .txt file and put down the file extension for the output video file. Also, the output file can be called anything, does not have to be output. - Hit ENTER. That's it, let the program run and you should have a single concatenated video file.
Hope this helps. Thanks again sneakerLast edited by thufz; 2nd Feb 2016 at 02:57.
-
Another question.
sneaker if you could help me out again would really appreciate it.
Is there a way of cutting or splitting a video without re-encoding?
Thanks -
You can use mkvtoolnixgui to cut without reconverting, under the output tab enable splitting and type in time. See: https://forum.videohelp.com/threads/359121-How-to-extract-cut-parts-from-a-mkv-includin...ubtitle-tracks
-
Hello.
I have the same problem as you, so I followed your direction.
But, I got this "unsafe file name" issue instead.
Honestly, I have no idea as to why it is "unsafe", and the article in https://www.ffmpeg.org/ffmpeg-formats.html#Options is just too technical for me to follow, seeing that this is the first time I've even touched FFmpeg.
Can you or someone here help me, please?
Similar Threads
-
ffmpeg: Concatenating MP4 files adding chapters for each one
By Keyser in forum Video ConversionReplies: 6Last Post: 12th May 2022, 18:19 -
Concatenating MKV Chapters
By VidElp in forum Video ConversionReplies: 1Last Post: 28th Nov 2015, 09:53 -
Problem with joining 2 mkv files
By lascetic in forum EditingReplies: 7Last Post: 30th Jun 2014, 07:13 -
Joining MKV Files Without Loosing Alternate Audio/Subtitles
By AbrogateAnon in forum Newbie / General discussionsReplies: 1Last Post: 11th Jan 2014, 05:54 -
problem with appending translated subtitles to MKV
By Heliooos in forum SubtitleReplies: 0Last Post: 7th Mar 2011, 04:36