VideoHelp Forum




+ Reply to Thread
Results 1 to 11 of 11
  1. Does anyone know why, when I try to cut a video where there is a clear cut between frames using Avidemux that it says that it's not on a keyframe?. One video I was trying to cut in Avidemux yesterday (the video had been encoded in Handbrake using the h.264 codec and set the 22 quality) it wouldn't cut on a frame where it should have done. However, when I tried this using the same file that I encoded from the original 10gb raw file that I set to 0 (lossless) on the Handbrake quality scale, it was able to cut the frame. It seems to me that once you start to encode and compress a video file that Avidemux finds it hard to cut on a frame where it would've been able to if the video hadn't been compressed or set to a lower quality (I don't bother dragging the original raw avi file into Avidemux has it just crashes due to the size, and so do editing programs like VSDC). I also get this alot with many of VHS captures, I think due to the amount of video defects that are present on the recording (maybe recordings in LP mode as well), that the program can't detect a frame even when there clearly is one.
    Quote Quote  
  2. Google for I, P and B frames and GOP's.
    Then you have the answer for your problem.
    Quote Quote  
  3. Originally Posted by techmot View Post
    Does anyone know why, when I try to cut a video where there is a clear cut between frames using Avidemux that it says that it's not on a keyframe?.
    A shot change doesn't necessarily mean there's a keyframe there. Does AviDemux show there's a keyframe there? At the bottom of the window where it shows "Frame Type". For a keyframe it will show I-FRM. Use the >> and << tools to move to step to the next or previous keyframe.
    Quote Quote  
  4. I digitized some VHS tapes, and now I have so me AVI files, 3h long, video codec "HuffYUV", and audio codec "PCM".

    The last few days I used AvsPmod to get the timings by the millisecond to see where I want to cut the video.

    I used FFMPEG to trim/copy the needed part:
    ffmpeg -ss 00:18:55.079 -i capture.avi -t 00:02:48.921 -c copy cut.avi

    But it looks like that this didn't work as expected because the video didn't start/end where I wanted. (I assume my issue was that I didn't cut on key frames).

    Now I tried to use Avidemux, navigate to the key frame I want, set my start/end marker, set the video/audio output to copy, and save the video.

    This solution looks much easier and more intuitive to me.

    The only difference I noticed was under audio:

    Avidemux:
    Interleave, duration: 25 ms (0.63 video frame)

    FFMPEG:
    Interleave, duration: 17 ms (0.42 video frame)
    Interleave, preload duration: 21 ms


    Is there any disadvantage using Avidemux (copy) for trimming AVI files over FFMPEG (stream copy)?
    Quote Quote  
  5. I think ffmpeg and avspmod can disagree about time codes. Either because audio and video don't start at the same time; or one of them starts timing at the middle of the frame, the other at the start of the frame. It's annoying that some program use frame number and others timecodes. If you wanted to track down the issue you could use ffprobe to get timestamps and frame types for every frame.

    A huffyuv AVI is all keyframes, so you should be able to cut on any frame. There's no reason to avoid AviDemux for cut/paste editing in copy mode.
    Quote Quote  
  6. Originally Posted by jagabo View Post
    I think ffmpeg and avspmod can disagree about time codes. Either because audio and video don't start at the same time; or one of them starts timing at the middle of the frame, the other at the start of the frame. It's annoying that some program use frame number and others timecodes. If you wanted to track down the issue you could use ffprobe to get timestamps and frame types for every frame.

    A huffyuv AVI is all keyframes, so you should be able to cut on any frame. There's no reason to avoid AviDemux for cut/paste editing in copy mode.
    I use utVideo avi for my captures as it reduces the raw capture to about 20gb for around 50 mins capture.
    Quote Quote  
  7. Originally Posted by jagabo View Post
    Originally Posted by techmot View Post
    Does anyone know why, when I try to cut a video where there is a clear cut between frames using Avidemux that it says that it's not on a keyframe?.
    A shot change doesn't necessarily mean there's a keyframe there. Does AviDemux show there's a keyframe there? At the bottom of the window where it shows "Frame Type". For a keyframe it will show I-FRM. Use the >> and << tools to move to step to the next or previous keyframe.
    I'm not sure to be honest. All I know is that with one of the files I'm trimming, when there's a cut from the program to an advert without it fading to black between shots, Avidemux is able to cut on that point. If there's a dissolve or a fade to black or a fade from black between the scene/shot I am trying to trim then it won't cut, it just says it's not on a keyframe. I have been able to trim the adverts out precisely as long as there's a straight cut to the next scene or cut to black. However, when I try doing this with the same file that has been encoded to a lower file size in h.264 it says it can't cut at that point where I could on the lossless file, nothing was edited just the file was encoded.

    Hope this make sense.
    Last edited by techmot; 9th Feb 2025 at 14:15.
    Quote Quote  
  8. Chicken McNewblet
    Join Date
    Sep 2009
    Location
    United States
    Search Comp PM
    The way H.264 (and most lossy video codecs I believe) works is that it fills in frames based on incomplete data from the original video source - if you were to look at the actual frame-by-frame data in an H.264 encode, it would look like splotchy weirdness until you got to an I-Frame which is a whole picture. This is also why H.264 video with little movement/change (e.g. computer screen captures) can be tiny in file size, while videos with a lot of action balloon up quickly. The lower the quality setting on an H.264 encode, the farther and farther apart I-Frames become. You can't cut on a B or P frame because they aren't "real" frames, they're made of predictive data based on the way the H.264 technology works. As was previously mentioned, H.264 will often but not always generate an I-Frame on a total scene cut.

    Someone correct me if I got any of that wrong

    If you can capture losslessly first and then encode later, that would be optimal.
    Last edited by CursedLemon; 9th Feb 2025 at 14:37.
    Quote Quote  
  9. Member The_Doman's Avatar
    Join Date
    Feb 2004
    Location
    Netherlands
    Search PM
    Originally Posted by techmot View Post
    All I know is that with one of the files I'm trimming, when there's a cut from the program to an advert without it fading to black between shots, Avidemux is able to cut on that point. If there's a dissolve or a fade to black or a fade from black between the scene/shot I am trying to trim then it won't cut, it just says it's not on a keyframe. I have been able to trim the adverts out precisely as long as there's a straight cut to the next scene or cut to black. However, when I try doing this with the same file that has been encoded to a lower file size in h.264 it says it can't cut at that point where I could on the lossless file, nothing was edited just the file was encoded.
    Most good/efficient encoders insert Key/I-Frames at the hard scene changes/cuts.
    I see the same when editing some DVB-C recordings from my cable TV here.
    Almost all ads/bumpers start/end with Key/I-frames which makes it easy and efficient to cut them out.
    I always prefer to use the keyboard to navigate quickly by Key/I-frames, cursor up/down in Avidemux.
    Last edited by The_Doman; 9th Feb 2025 at 16:58.
    Quote Quote  
  10. Member
    Join Date
    Jun 2020
    Location
    Houston, TX
    Search PM
    The best software for cutting on any frame accurately is now defunct. Video Redo Suite 6 is the best thing for this, unfortunately you can no longer buy it. I tried to buy it right after the owner died and while the website was still up you could not purchase it. On the forums for VRD6 I found out the owner had died and at that time there were a lot of people freaking out about loosing their lifetime purchase since it required periodic reathentification and the servers would be going down soon. Plus no one would have ever been able to reinstall it. That is when there popped up a version online that solved the issue. I talked with the developer who was still running the website and asked if I could use that version since I could not buy it and he told me it was fine since no one was monetizing this software any more and it was officially dead...but I would have to use it at my own risk. I have been using if for almost 2 and a half years. I am pretty sure anyone could find it if they wanted.
    Quote Quote  



Similar Threads

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