Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.


Go Back   Doom9's Forum > Announcements and Chat > General Discussion

Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 20th January 2019, 22:21   #1  |  Link
Registered User
Join Date: Aug 2018
Posts: 4
Cutting on IDR frames in mkvmerge

Hello all,

I thought this would probably go better in the editing sub-forum but couldn't find an appropriate category as it doesn't related to avisynth or NLE, etc. So I placed it here.....

I am trying to cut out sections from an h264 source. I understand I need to cut on the IDR frames so I extracted the raw file, ran it through FrameCounter to identify the IDR frames, and selected the appropriate frames. To test my identification of IDR frames, I cut each desired segment out as an individual file and checked playback. Each file played perfectly. To further test the cuts were appropriate, I combined them and they played seamlessly as a single file. All this was done in mkvmerge command line, so no re-encoding is occurring.

Now, I want to do the inverse. In other words, instead of keeping the sections as separate files, I want to discard those portions and leave the remainder of the film intact. But when I do this, using those same ranges, the film now has playback errors (a/v sync issues, black screen with ongoing audio, etc.). So, for whatever reason, I am extracting on IDRs, but I am not discarding on IDRs, if that makes sense.

Here are some concrete details:
Sections (note, each range below begins and ends on an IDR frame):

To extract the sections, I use: mkvmerge -o output.mkv --split parts-frames:56073-56193,77924-77948,80221-80341 input.mkv
(The frames referenced here are each -2 from the IDR frames identified above because mkvmerge begins counting frames at 1 and FrameCounter begins at 0, so I subtract 2 in order to be safe.)
As I said above, this works flawlessly. The individual files play great and they can be merged with no issues, because they are each an independent GOP.

To try and discard the sections, I use: mkvmerge -o output.mkv --split parts-frames:-56073,+56193-77924,+77948-80223,+80343- input.mkv
For whatever reason, the resulting output file is not cutting on the IDR frames and the playback is funky. I have tried adjusting those frame ranges a few, never going above the IDR # (e.g., 56071, 56072, 56074, but not 56075+), and it doesn't make any difference.

Any ideas?

Last edited by Travillion; 20th January 2019 at 22:37.
Travillion is offline   Reply With Quote

cut, idr, mkvmerge

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +1. The time now is 11:51.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.