Log in

View Full Version : Want to use MEGUI/x264 for something but cant.


tomos
4th July 2006, 00:45
Right now, i encode my caps 3 at a time for 1 dvd. i use x264 via vdubmod to encode. basically, i do 1 pass across all 3 clips together, and the 2nd pass to individual clips.

i.e 1st pass frame 1 - 30
and 2nd pass - frame 1 - 10, then another clip from frame 11 - 20, and 3rd clip frame 21 - 30.

to get better quality i would like to use megui with x264 as opposed to vfw but i need to be able to split the encoded mp4 video file.

i cant see any way of doing this in megui. only using zones which afaik, doesnt create seperate files. i've also checked mkvmerge and while it does let me specify a time to split the file, it isnt frame specific. :(

ok, that took a lot more writing than i though :)
anyone know anyway of doing what i need here? either frame specific cutting on mp4 video files, or using megui to split the video as above?

berrinam
4th July 2006, 01:33
You can't do it frame-accurately while also keeping the frame allocation decided by the first pass, unless you are exceptionally lucky, because you can only split on GOP boundaries, which are determined by the first pass.

So you have a few choices:
Encode the whole video as two passes and then cut it. You'll just have to accept the slightly inaccurate splitting.
Encode with CRF (constant quality) and ignore filesize.
Do a test encode of the three segments with CRF. This will then give you an idea of the relative sizes to make each of the files. Then, keep those relative sizes, but scale them down to fit the target size you want. That gives you the 'optimum' bitrate for each of your three segments. Then, just encode 2pass at those bitrates.

tomos
4th July 2006, 14:55
ta for the reply,

constant quality is simply not an option really. the other options of encoding each segment individually is also not something i could do. i want to spread the bitrate over the entire video and this would defeat that purpose.

on a positive note, i tried the splitting in mkvmerge and while it wasnt perfect, it wasnt noticeable to me so i'll use that. as long as i keep the original timestamps i should be ok with that i think :)

sysKin
4th July 2006, 16:00
i.e 1st pass frame 1 - 30
and 2nd pass - frame 1 - 10, then another clip from frame 11 - 20, and 3rd clip frame 21 - 30.

AAAh wait - so you used the original 1st pass all the time but with different clips for second pass? This could never work! unless you cut the first pass manually at corresponding frames (which should not work either because frame-accurate stuff in VfW doesn't work).

tomos
4th July 2006, 18:39
works in VFW with x264 and divx/xvid

berrinam
4th July 2006, 22:47
ta for the reply,

constant quality is simply not an option really. the other options of encoding each segment individually is also not something i could do. i want to spread the bitrate over the entire video and this would defeat that purpose.My third suggestion would allow the bitrate to be spread while encoding properly. Perhaps you misunderstood: use crf to find out the ratio of the required bitrates, and then you take the job of the rate control and choose the bitrates for each segment accordingly. But since you've had success with mkvmerge, it doesn't matter.

works in VFW with x264 and divx/xvidIt probably seemed to work, but the bitrate distribution would be wrong, causing much worse quality than possible.

sysKin
6th July 2006, 10:14
works in VFW with x264 and divx/xvid

It absolutely 100% does not work on XviD ;) I mean sure, encoding kept going, but the result was absolutely random (except for the first clip of course) and quality was horrible.

It's amazing what some people can think of >_<

In short: you could not do it in VfW and you can't do it with MeGUI either........

[edit] this is perhaps a good proof that XviD's 2pass2 must do some sanity checks on video - same resolution and length (+/- couple of frames for b-frame lag safety) are a must...

tomos
7th July 2006, 15:40
the only thing now that i need to fix, is to be able to insert a keyframe to make the splitting a little more precise. would 'zones' help at all in this?

i mean could i just add the different sections into megui as zones but leave settings in there as default, encode as normal with 2 passes and then split with mkvmerge?

berrinam
7th July 2006, 23:53
There's no way to force a keyframe at a specific location in x264 (that I'm aware of).

tomos
8th July 2006, 02:06
i was hoping that since, i assume, zones let you have different quality/bitrate for different sections - wouldnt that *have* to have a keyframe to seperate the zones?