View Full Version : Cut out a 2min clip of existing x264 file?
steve77
9th April 2007, 14:22
Hello,
I'm interested in cutting out a 2 minute clip of an existing x264 video file I just encoded.
I initially thought I'd just use the "Trim()" function in AVISynth and encode the clip seperately, but with 2pass encoding, I'm worried that for the same bitrate, the bits won't be allocated the same way they were in the original 1h encode.
The idea is to create a "sample" of the encode.
I looked at the suite of tools offered in MeGUI, but nothing seems to fit.
Specifically, I want something that will preserve audio and video, and would allow me to specify the start and end frames for the selection.
Thoughts?
Did this get moved or did I post in wrong section?!
S”nTė£
9th April 2007, 14:32
for these things i usually use the split feature of mkvmerge. I know it's a roundabout way of going at it but works for me, and no seperate programs necessary.
Just add the file in the input files list, go to tab global, "enable splitting", "after timecodes", put in the start and end timecodes...
mkvmerge changes the timecodes (moves the time forward) so that the startframe is a keyframe and the endframe is the frame right before a keyframe, so if you are not getting the part you wanted try putting in one second sooner.
Your output will be 3 files, you can delete the first and the third file, the second file will be the part you selected. The audio and video and subtitle streams will remain untouched and have the exact same quality as the original.
If your original file is an mp4 or an avi you can just remux the resulting mkv in your desired container (mp4box etc.)
steve77
9th April 2007, 15:09
Yeah I always encode using the MP4 container, I should switch to MKV I guess...
I guess that's the only way to do this at the momment... how I miss VirutalDub and XviD with "Direct Stream Copy"...
foxyshadis
9th April 2007, 21:04
Since you use mp4, why not give avidemux a try? It may not be completely intuitive to someone used to virtualdub - believe me, I feel the pain - but it allows you to make those sorts of cuts. mkvmerge is sort of annoying, because it'll always write out the entire file's worth of pieces, even if all you want is one piece, so it takes longer and takes up more space temporarily.
You can also cut a section of stats file out, encode using that at the approximate bitrate of the chunk, but that method is much more difficult; I only use it for patching into an existing encode, usually to fix subtitles.
steve77
9th April 2007, 21:48
Yeah, I've looked at it and it doesn't look too painful :-) As long as it takes a section of the video and outputs it's exact copy, I'll be happy.
S”nTė£
9th April 2007, 22:11
I'm not really familiar with avidemux, but does it keep all the stream information intact, things like vfr? Is there no AVI inbetween step? My understanding is that the avi container does not support all x264 features and it is sort of a mess to have x264 in there. If there is no avi inbetween step, then the name of the program is a bit ill chosen :)
steve77
13th April 2007, 14:43
Yeah, tried it, it came out a mess... doesnt' support all of x264's encoding features, me thinks.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.