View Full Version : Inserting 2 seconds of video without reencoding
Makaveli84
3rd July 2012, 19:23
I want to insert a 2 seconds clip in the middle of a 40 mins video. The long video is encoded in avc/h264. The short clip is of different dimensions, but also encoded in avc/h264, although in different settings than the long one. I applied resizing filter on the 2 seconds clip and reencoded it with the same settings as the long video, then tried inserting it with Avidemux in copy mode (no reencoding) but the output video is clearly "corrupt" (it stutters at points, and stops playing at other points). All this was done with no audio. Am i doing something wrong? Can this be done in the first place, and more specifically, using Avidemux?
Also, maybe it would work with ffmpeg, but what would be the needed command to do it?
Thx for your help.
hello_hello
4th July 2012, 08:09
As long as the video (and/or audio) types match, and you're happy with MKV, MKVMergeGUI might be able to do it.
Well it does join and split files.... I'm not sure if there's a minimum video duration required for it to work. Probably not. Naturally it'll only split on key frames.
Sorry, but I've not used Avidemux much so I can't help you there.
roozhou
4th July 2012, 08:31
You can only insert the 2-second clip between two GOPs in the long video. If the point you want to insert is in the middle of a GOP, you have to reencode the GOP.
Make a 2 second blank video with whatever software. (Same resolution, codec)
Use mkvmerge and merge this.
Makaveli84
6th July 2012, 20:49
I'm not sure how to go about this whole thing in mkvmerge, but maybe i didn't explain clearly what i'm doing:
I want to insert a specific 2 seconds clip (not any blank clip) that i have reencoded to the same resolution and settings of the original clip.
Also, i want to insert it at a very specific location (frame accurate operation).
So i'm not sure.. Avidemux is very troublesome when it comes to x264, and as i am finding out the hard way, it's no where near frame accurate, as it always seems to introduce 2 bogus frames. I tried Avidemux 2.6 beta but it's virtually inoperable at this stage of development, so it didnt do me any good.
Is there some frame accurate free video editor out there that plays nice with x264/b-frames/idr-frames??
Also
You can only insert the 2-second clip between two GOPs in the long video. If the point you want to insert is in the middle of a GOP, you have to reencode the GOP.I'm not sure what this means exactly, but this seems to be a frame accurate operation, so no good with avidemux. And how could i encode a single GOP rather than the whole video anyways?
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.