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.
+ Reply to Thread
Results 1 to 11 of 11
-
-
Google for I, P and B frames and GOP's.
Then you have the answer for your problem. -
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 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)? -
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'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.
-
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.
-
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.
-
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.
Similar Threads
-
Properly Cutting MKVs by Keyframes Using FFmpeg
By simon744 in forum Video ConversionReplies: 4Last Post: 4th Jan 2024, 14:05 -
Avidemux cutting
By techmot in forum EditingReplies: 7Last Post: 11th Aug 2023, 14:10 -
Video Editor That Allows Both Cutting on Keyframes and Viewing Waveform
By Spiralagnus in forum Newbie / General discussionsReplies: 0Last Post: 11th Jun 2022, 12:15 -
Cutting untranslated A/V movies scenes without keyframes
By ilrobbi in forum EditingReplies: 2Last Post: 21st Nov 2021, 16:45 -
Clipping Video Using FFMPEG and KeyFrames - Need More KeyFrames?
By Alan2106 in forum EditingReplies: 1Last Post: 3rd Jun 2021, 08:31