VideoHelp Forum




+ Reply to Thread
Results 1 to 17 of 17
  1. Hello,

    I have an MKV file where I want to delete the first 16 seconds.
    If have tried Avidemux but this application crashes. I have also tried SolveigMM AVI Trimmer + MKV but this one doesn't save the edited file for some reason but the the whole file.


    What is the best tool to do this without reencoding ?
    Quote Quote  
  2. I'm a Super Moderator johns0's Avatar
    Join Date
    Jun 2002
    Location
    canada
    Search Comp PM
    I think,therefore i am a hamster.
    Quote Quote  
  3. I have tried that but how does it work with MKVMerge ?

    [EDIT]
    I think I have to use the split option. I will test it. Thanks.
    Last edited by jslegers73; 14th Feb 2013 at 02:48.
    Quote Quote  
  4. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    I have no problems with solveigmm avi trimmer. Open mkv, set and start and save. But it might not work all kinds of mkvs.

    But try mkvtoolnix / mkvmergegui. Add the mkv, under the global table enable splitting, set the after timecodes to 16s and it will create two files, one with the first 16s and the other with the rest.

    See screenshot:
    Image Attached Thumbnails Click image for larger version

Name:	mkvmergegui.png
Views:	7288
Size:	66.0 KB
ID:	16270  

    Quote Quote  
  5. I have tested it and it creates 182 files not what i suspected.

    [EDIT]

    If I set it to two files it works only mkvmerge doesn't cut at the right time. When I enter 16s the first file is 20 seconds long.
    MKVmerge has a limitation on this from the FAQ:

    mkvmerge can only split right before a key frame. This is an intentional limitation that you cannot get around when you use mkvmerge for splitting.

    A key frame is a frame type that can be decoded and shown independently of any other frames in the file. That's how mkvmerge ensures that the next file starts with a key frame and can be played correctly right from the start. If mkvmerge allowed splitting at arbitrary timecodes, and therefore at any frame type, then the next file would show disrupted images until the next key frame is encountered.

    In general there is a way to split video files at arbitrary frame positions. This requires that all non-key frames after the split point up to but excluding the next key frame will have to be re-encoded so that the next file does start with a key frame.

    However, this requires that the program splitting the video file contains video decoders and encoders for all video formats that it can split. mkvmerge is not such a tool as it does not contain a single decoder or encoder, neither for audio nor for video. That's not its purpose. Therefore mkvmerge will never be able to split before arbitrary frame types.
    Last edited by jslegers73; 14th Feb 2013 at 03:41.
    Quote Quote  
  6. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    It can only cut at keyframes.
    Quote Quote  
  7. It looks like if i want to cut it at 16 sec i have to re-encode it.
    Quote Quote  
  8. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Or use an editor that just reconverts at the cut. But I don't think you will find anything free for that.
    Quote Quote  
  9. Originally Posted by Baldrick View Post
    Or use an editor that just reconverts at the cut. But I don't think you will find anything free for that.
    What would you recommend?
    Quote Quote  
  10. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    SolveigMM Video Splitter but as solveigmm avi trimmer doesn't work with your mkv it might also not work. But you can always try the trial.
    Quote Quote  
  11. Click image for larger version

Name:	Untitled.jpg
Views:	5533
Size:	108.9 KB
ID:	24842


    I have done the splitting successfully using mkvmerge GUI v6.9.1
    all you have to do is to put the value "2" in the "Max number of files" field.
    so it will split the files to 2 parts, splitting in the time stamp you have given in "Duration" field.

    If you wanted to remove some part of the video in between,
    For example, you want to remove video part from 0:01:20 to 0:05:45, then do the following steps.

    1. split the file in 2, giving the duration for splitting as 0:05:45 or 345 [ (05min*60)+45sec ] and value "2" in the "Max number of files" field.
    you will get 2 files, one ending at 0:05:45 (FILE A) and other one starting at 0:05:45 (FILE B)

    2. now split the first file which is ending at 0:05:45 (FILE A), in 2, giving the duration for splitting as 0:01:20 or 180 and value "2" in the "Max number of files" field.
    you will get 2 files, one ending at 0:01:20 (FILE C) and other one starting at 0:01:20 (FILE D)
    Here the second file (which is ending at 0:01:20 is the one which you want to remove)
    So you the wanted file parts in 2 files

    3. Append the 2 files [one which is ending at 0:01:20 (FILE C) + one which is starting at 0:05:45(FILE B)] using mkvmerge GUI


    Click image for larger version

Name:	Untitled1.jpg
Views:	5461
Size:	147.4 KB
ID:	24843

    Done
    Quote Quote  
  12. Member
    Join Date
    May 2014
    Location
    Australia
    Search Comp PM
    Hey, bit late to the discussion, but wanted to do the same thing and found Free Video Editor 1.2.1 does the job very nicely, doesnt need to cut at keyframes and doesnt reencode videos. Its a very basic program, merely allowing to cut and join. And iirc one issue is subtitle tracks dont get resaved with it, but will resave multiple audio tracks if present with no sync problems

    and compared to the routine required by mkvmerge (which ive not tried) is ridiculously easy to use
    Quote Quote  
  13. Hmm, free video software that can't possibly work as described, loaded with adware and recommended by a brand new member. Smells like spam.
    Quote Quote  
  14. Member
    Join Date
    May 2014
    Location
    Australia
    Search Comp PM
    smrpix, dont be so cynical, the op wanted a tool to cut out a non keyframe section of video without the need to reencode it, thats pretty much what FVE does, and its been a few installs since getting it but dont recall any adware junk with it

    fwiw, im new because im a noob at video editing, havent used 99% of the programs out there cause theyre beyond my expertise, and probably wont be a big contributer, but figure noob type advice/programs still have a place when simple things like that need doing
    Quote Quote  
  15. nonaz,
    If video isn't cut on keyframes you can remove frames which are needed to decode other frames. Therefore the remaining frames in the group can't be decoded properly, which is why software will generally only cut on keyframes. There's no way around it, regardless of the software being used, unless the software in question re-encodes some of the frames around the cut point. Maybe that's what Free Video Editor does. I had a look at the instructions for using it but couldn't find any mention of "smart cutting", but that doesn't mean it can't cut that way.

    There's a 10 second sample video attached to this post. The first frame is the only keyframe. Please feel free to try to split it without re-encoding.
    Quote Quote  
  16. Member
    Join Date
    May 2014
    Location
    Australia
    Search Comp PM
    hey hello, well trying to open that 10 second mkv in FreeVideoEditor gives the message "cant open media file" . Really dont understand keyframes or smart cutting, only know it cuts at any point ive wanted sofar and audio remains synced in the output file
    Quote Quote  
  17. It might be refusing to open that sample as it can't split it..... given that's what it's designed to do. Here's another. It's 29 seconds long. There's a keyframe at the beginning and keyframes at (roughly) 2, 12, 17, and 19 seconds. See if you can split it somewhere else (ie after 20 seconds).

    If you happen to be a MPC-HC user, you can easily work out where the keyframes are by opening a video and using the Shift key in combination with the left/right arrows on your keyboard. That'll jump backwards and forwards between keyframes. Those would be the only places you can split the video unless the splitter program does "smart cutting" (re-encodes the frames around the cut point if necessary).

    Often you'll get lucky and there'll be a keyframe where you want to split (on a scene change etc) but sometimes that's not the case.
    Image Attached Files
    Quote Quote  



Similar Threads

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