VideoHelp Forum
+ Reply to Thread
Results 1 to 7 of 7
Thread
  1. Member
    Join Date
    Aug 2018
    Location
    Phoenix
    Search Comp PM
    Hello,

    I wasn't sure where to put this post, perhaps the editing section? I placed it in general because I wasn't sure.

    I deal with a lot of content in the mkv container, some of it is mpeg (e.g., OTA recordings) but usually it is h264. I am getting increasingly frustrated with how difficult it is to accurately cut material (because of keyframe restrictions) without reencoding. Then I had an idea...rather than imprecisely cutting material, is there a tag or other metadata that could be entered which will direct the player to skip over portions? Presumably this could be more exact and not run into decoding issues because all the frames would still be present in the file. The file size would naturally be larger than if I cut the material, but it might be worth it to me because of simplicity.

    I think this could be accomplished with the ChaptersFlagEnabled flag if I were creating chapters for the content. But if the content already has chapters, and I don't want to skip the whole chapter, would this work by making a subchapter?

    Any ideas about other tag/metadata workarounds?
    Quote Quote  
  2. You'd still run into the same issues when seeking because the entire GOP has to be decoded for seeking within a GOP . That's the same basis for the cutting issues. GOP boundaries, IDR frames. Seeking will be slower (higher latency) proportional to the size of the GOP

    Chapters are placed on IDR frames, that's why you can seek to them directly, and quickly. You're essentially jumping by keyframes

    You can't insert seekpoints (or keyframes) without re-encoding... so back to square 1

    But you're asking sort of for display metadata, to skip over sections and display only specific frames - I don't think it's universally possible (won't work in all scnearios for all players), but mplayer has an edl and cutlist option , but not sure how accurate it is either

    Not sure of the background information on how you are using this (is this for editing, or playback only, or how are you planning on using it, is it for usage in other programs ?), but you can playback an avisynth script using Trim() to specify segments. If you use a frame accurate source filter, this does work accurately with multiple players, such as mpv, mpchc, even ffmpeg/ffplay . But it requires avisynth installation (mostly windows limited, although there are ways to run it on linux)



    You can also use smart rendering editors, that only re-encode the few frames around the cutsite . eg. videoredo, solveigmm video splitter, tmpg smart renderer
    Last edited by poisondeathray; 6th Aug 2018 at 14:11.
    Quote Quote  
  3. Member
    Join Date
    Aug 2018
    Location
    Phoenix
    Search Comp PM
    Ah, my feelings of genius are once again thwarted!

    Just to clarify my understanding....A cut on an IDR frame should always be seamless. Depending on whether the encode has closed or open GOPs, cuts on i frames can be possible. mkvmerge (and ffmpeg) don't always know the difference between an i frame and and IDR frame and so sometimes cuts are still a little messy.

    What is the easiest way to find IDR frames? I've looked at ffprobe output a few times and get overwhelmed quickly, and what I see is a sequence of frame types, but no indication of timestamp, etc. Ideally I'd be able to see a timestamp at least, or even better be able to view the video and find the nearest IDR frame. Does something like that exist?
    Quote Quote  
  4. Originally Posted by Travillion View Post
    Just to clarify my understanding....A cut on an IDR frame should always be seamless. Depending on whether the encode has closed or open GOPs, cuts on i frames can be possible. mkvmerge (and ffmpeg) don't always know the difference between an i frame and and IDR frame and so sometimes cuts are still a little messy.
    Yes


    What is the easiest way to find IDR frames? I've looked at ffprobe output a few times and get overwhelmed quickly, and what I see is a sequence of frame types, but no indication of timestamp, etc. Ideally I'd be able to see a timestamp at least, or even better be able to view the video and find the nearest IDR frame. Does something like that exist?
    For freeware, visually with a GUI, something like avidemux would be easy to use, you can navigate by keyframes. But unfortunately, because it's based on libav/ffmpeg libraries, it's not always 100% accurate. Sometimes, if you navigate back and forth, you can "lose your place" as it sort of mixes up frames , you sometimes have to go back a larger section then creep your way forward, jumping by keyframes. It's also buggy sometimes. Frustrating. But most of the time on simple common streams, it should work ok.



    If you're cutting a lot (as in frequently) , as your 1st post stated, then you should look at something like videoredo or solveigmm video splitter. They will save you lots of headache and more importantly, time . This is one area that freeware doesn't really have an equivalent. Selur has a utility mkv cutter that does smart render, but honestly it's not as good as the payware alternatives
    https://www.videohelp.com/software/MKV-Cutter
    https://forum.selur.net/showthread.php?tid=6
    Quote Quote  
  5. Member
    Join Date
    Aug 2018
    Location
    Phoenix
    Search Comp PM
    Originally Posted by poisondeathray View Post
    For freeware, visually with a GUI, something like avidemux would be easy to use, you can navigate by keyframes. But unfortunately, because it's based on libav/ffmpeg libraries, it's not always 100% accurate. Sometimes, if you navigate back and forth, you can "lose your place" as it sort of mixes up frames , you sometimes have to go back a larger section then creep your way forward, jumping by keyframes. It's also buggy sometimes. Frustrating. But most of the time on simple common streams, it should work ok.
    Thanks for the tip, I'll give that a try!

    If you're cutting a lot (as in frequently) , as your 1st post stated, then you should look at something like videoredo or solveigmm video splitter. They will save you lots of headache and more importantly, time . This is one area that freeware doesn't really have an equivalent. Selur has a utility mkv cutter that does smart render, but honestly it's not as good as the payware alternatives
    https://www.videohelp.com/software/MKV-Cutter
    https://forum.selur.net/showthread.php?tid=6
    I've seen Videoreo mentioned a few times. I might have to make that jump. This is all personal hobby stuff but I might be able to justify the cost . A smart renderer like videoredo only re-encodes the GOPs that need it right by the cut points, correct? I know that I'm being a little rigid, but I like to keep things as close to source as possible.
    Quote Quote  
  6. Creating virtual timelines is possible with Matroska: "101 things you never knew you could do with Matroska". But as poisondeathray said you might run into problems, not all players support it, especially not if you don't cut on keyframes. So for such a job I would agree to use a solution like MKV-Cutter, SolveigMM Video Splitter, VideoReDo etc. It's overall the best compromise.
    Quote Quote  
  7. Member
    Join Date
    Aug 2018
    Location
    Phoenix
    Search Comp PM
    Hmmm... I am mainly interested in playback from Plex and VLC. If it does work for those two players, it might be worth it to me just because of simplicity, at least in some use cases. If nothing else, you all have given me many things to try
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!