VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors.
Please consider supporting us by disabling your ad blocker or buy PlayOn (record Netflix) :)
+ Reply to Thread
Results 1 to 14 of 14
Thread
  1. Hello

    I used eac3to on an mpls file (ripped blu-ray disc) to produce video, audio, and subtitle streams (H264, DTSMA, PGS formats). I then fed these raw files into mkvtoolnix GUI to remux into an MKV file, but also inserted timecodes into the "splitting" field under the "output" tab. My intention was to split in order to cut out the parts of the film I didn't want by simply deleting the relevant MKV files and re-merging the remaining MKVs using mkvtoolnix again.

    Unfortunately I've noticed an issue with the resulting final product. At the points in the film where the mkv files were stitched together, the audio continues to play seamlessly but the video will pause for a few seconds before skipping ahead. The video and audio then remain in sync.

    Any ideas what could be causing this?

    Thanks

    Odai.
    Quote Quote  
  2. It could be because the Blu-ray uses OpenGOP. Cutting can be problematic at non-IDR-I-frames. Or it is because the cuts are of different lengths (video can only be cut on keyframes). Can't say for sure without samples and knowing the exact procedures.
    Quote Quote  
  3. Many thanks for your reply.

    Apologies, I'm quite a novice when it comes to the technical details. My understanding from your post is that your reference to the cuts being of different lengths means that the video and audio streams in a given file after the split are not equal in duration (that the audio is possibly longer than the video in each file), and that a possible explanation is that the timecodes specified for the splits do not correspond to the location of keyframes in the video stream. My understanding is that, when the split files are re-joined, at the split point the video essentially pauses (while the audio continues) until the next keyframe appears and the video then skips to and resumes at this point in the stream. Is this more or less a correct understanding?

    However, as far as I'm aware, mkvmerge does not support splitting except at keyframes anyway, so if the timecodes I specified do not actually correspond correctly to keyframes wouldn't mkvtoolnix just ignore these timecodes and split at the closest keyframe instead?

    Furthermore, if I try to play each of the individual split files separately before re-joining them they play fine. This includes the first few seconds of each file that is skipped when I try to re-join the ones I want together. If these first few seconds of each file didn't actually start with a keyframe, wouldn't playing them be impossible? I also tried repeating the process of rejoining the separate files but this time leaving out all audio and subtitle streams so that only the single video stream remains. The exact same issue persists however.
    Last edited by Odaik; 19th Mar 2017 at 13:36.
    Quote Quote  
  4. The problem is that for mkvmerge a "keyframe" is a frame you can seek to. For H.264 video that is either an IDR frame or an I frame that's a recovery point. This is ok for playing back a complete file but not for editing. So editing using mkvmerge is not safe for these files. How these are played depends on the player. They may appear fine in one player but garbled or with pauses in a different one.
    But without a sample I cannot say what the problem is.
    Quote Quote  
  5. Thanks again for the input.

    I guess I can read into it a bit more and try and solve the issue myself, maybe after asking a few more specific questions on here. Until today I actually had no idea what I, P, and B frames were.

    If I were to just upload a sample, any suggestions on the best method for this? Just a little concerned on the legal side too, as I'd be uploading a significant amount of footage extracted from a (copyrighted) blu-ray title.
    Quote Quote  
  6. Just cut about 30 to 60 seconds from the beginning of the first m2ts using e.g. DGSplit or TSMuxer.
    Quote Quote  
  7. In the meantime, can you recommend any programs that will allow me to edit mkv files in the way I wish (without re-encoding) and not encounter these issues?

    EDIT: Sorry, posted before refreshing the page there and didn't see your post. Would uploading that footage give you enough information on how the tracks are mastered to determine what the issue could be, or would you also need the split files themselves?
    Quote Quote  
  8. Good question. I actually don't know. Usually, you'd find the IDR frames and only cut at those, at least for the GOPs you want to keep (beginning of a segment). Otherwise try mp4box or SolveigMM Video Splitter.
    Quote Quote  
  9. I think I'm slowly getting my head around it all now. Assuming the issue is all down to not cutting in the right place, is there any software out there with a GUI that will allow me to analyse the video stream composition and determine the timecodes for where the IDR frames are?

    By the way, am I correct in understanding that a GoP is a group of frames that can all be decoded together entirely without reference to frames outside of the GoP, and that therefore they must start with an IDR type I-frame?
    Quote Quote  
  10. Originally Posted by Odaik View Post
    By the way, am I correct in understanding that a GoP is a group of frames that can all be decoded together entirely without reference to frames outside of the GoP...?
    What you are describing is a "closed GOP". As was mentioned earlier there are also "open GOPs" that require frames of the next GOP to decode the last few frames of the GOP.
    Last edited by jagabo; 20th Mar 2017 at 20:50.
    Quote Quote  
  11. Thanks for the explanation, that clears it up a little for me.

    Is there any easy way I can analyse the stream to determine these parameters? I.e whether cuts contain open/closed GOPs, location of IDR frames etc...
    Quote Quote  
  12. l-smash muxer and mp4box will show number of IDR vs "just" I frames during mux. That should give a strong hint about how source was encoded. Other than that you need some kind of stream analyzer like Zond.
    Quote Quote  
  13. OK, so I used a trial of SolveigMM Video Splitter to analyse the video stream and re-attempt the cuts I did with mkvmerge originally.

    By using the "Next K Frame" navigation feature, it seems that throughout the film keyframes occur every second or so. So that's 1 in 24 frames that are keyframes (I'm assuming in this case that this is synonymous with IDR type I frames).

    Does this sound like a stream encoded with Open GoPs? 1 in 24 doesn't sound like a lot of keyframes.

    I did try and cut out the parts I didn't want using this software and it worked fine. So it seems something is going wrong when I attempt to do the same in mkvmerge. I guess one option now is to copy the timecodes for keyframes identified in SolveigMM and use those to split in mkvmerge.
    Quote Quote  
  14. Originally Posted by Odaik View Post
    Does this sound like a stream encoded with Open GoPs? 1 in 24 doesn't sound like a lot of keyframes.
    1 in 24 is quite a bit and common on Blu-ray due to its specifications. For example x264 uses 1 in 250 by default.

    Originally Posted by Odaik View Post
    I did try and cut out the parts I didn't want using this software and it worked fine. So it seems something is going wrong when I attempt to do the same in mkvmerge. I guess one option now is to copy the timecodes for keyframes identified in SolveigMM and use those to split in mkvmerge.
    SolveigMM Video Splitter has smart re-encoding. You may find it working on cuts mkvmerge does not.
    Quote Quote  



Similar Threads