Hi,
I am trying to re-encode an H.264 mkv file (no audio/chapters/subs) in pieces using x264. On the first encode, I seek to frame 1, and then encode say 1000 frames. On the second encode i use all of the same parameters but seek to frame 1001 and encode another 1000 frames. When doing this I was doing a 2-pass encode for each, at the same bitrate for both. Each encode would output an MKV file. When I use mkvmerge to append the second file to the first file, when I play the resulting MKV back, there is a slight jerk/pause where the two files meet... How can I fix this? and what would be the cause of this? I have also tried encoding the files to output h264 files and combining them with a simple binary file joiner, but I get the same results after putting the h264 file in an mkv and playing back...
The goal is to encode a different range of frames on 2 separate computers to complete the job quicker, then merge the resulting pieces into one seamless file.
Thanks for the input..
+ Reply to Thread
Results 1 to 5 of 5
-
Last edited by krv; 13th Nov 2010 at 23:26.
-
NEVERMIND. I just tried splitting the original MKV with MKVMERGE first, it seems that it may be splitting it at keyframes, whereas before I was splitting them at a random frame. I then merged these pieces back together and it played seamlessly. Therefore I can just split with mkvmerge and can later re-encode each of these pieces individually with identical parameters, and without seeking (just encode the entire piece). Then I can join these files back together and the final movie should play seamlessly. duh. newbie.
-
Most highly compressed formats have that problem.
You can split anywhere, but you would need to re-encode, at least at the split point to restore the keyframe sequence. Best is to split at keyframes, but not always desired. It gets worse if you want to do a lot of cutting on a video, like removing commercials. Then you would definitely need to re-encode. Or you can convert the video to a lossless or near lossless format, do your editing, then convert back to your compressed format.
-
Just a hunch - When you re-encode, you change the frametype distribution. But when you split, each split is right before an IDR-frame (so each segment after the 1st will always begin with an IDR frame) . However, when you re-encode, frame 0 might not be an IDR-frame (it might be placed later on in coding order). A decoder cannot begin decoding that new section until the that IDR frame is reached (so it has to find that IDR frame, and then go backwards - this might cause a pause). You can force frame 0 of each newly encoded split section to be an IDR frame with a qpfile
The more segments you use, theoretically the more deviation from a regular 2-pass encode - it gets less efficient (lower quality at the same bitrate) because of the change in GOP characteristics
Also, have you tried other builds (maybe you mkvmerge build is buggy) , or maybe mp4box ? and have you tried other players?Last edited by poisondeathray; 15th Nov 2010 at 09:07.
Similar Threads
-
Slight Pause at the End of Each Clip (MTS files)
By Obtong in forum EditingReplies: 4Last Post: 9th Aug 2011, 23:53 -
Breakup a huge mkv file into smaller pieces
By mysts in forum Video ConversionReplies: 7Last Post: 3rd May 2009, 14:34 -
H264/AC3 (MKV) to H264/AAC (MP4) ?
By jccca in forum Video ConversionReplies: 10Last Post: 13th Dec 2008, 19:06 -
Help on merging h264 and aac file
By overground55 in forum Newbie / General discussionsReplies: 5Last Post: 30th Jul 2008, 13:23 -
MKV/H264 will play, but H264 won't ???
By JorgeO in forum Newbie / General discussionsReplies: 2Last Post: 22nd May 2008, 21:20