Log in

View Full Version : x264 1st Pass Log Format?


TheBashar
24th August 2005, 23:26
I've done some searching but I can't seem to find a description of x264 1st pass log format. I'd like the make a compressibility calculator based on the 1st pass log. Can anybody point me to a description of the log format or am I going to have to use the source (Luke)?

Thanks!

Sharktooth
25th August 2005, 12:42
Uhm, dont think the format is explained anywhere (other than the source) but maybe this will be usefull: https://trac.videolan.org/x264/file/trunk/tools/countquant_x264.pl

akupenguin
25th August 2005, 16:40
in:%d out:%d type:%c q:%f itex:%d ptex:%d mv:%d misc:%d imb:%d pmb:%d smb:%d

in: frame number in display order.
out: frame number in coded order.
type: 'I'=>I-frame (IDR), 'i'=>I-frame (non-IDR), 'P'=>P-frame, 'B'=>B-frame (referenced), 'b'=>B-frame (disposable).
q: average QP over all macroblocks in the frame. (currently an integer since we don't do per-MB ratecontrol).
itex: bits spent on DCT residuals in intra MBs.
ptex: bits spent on DCT residuals in inter MBs.
mv: bits spent on MVs, refs, and partitions.
misc: bits spend on MB skip flags, slice header, and alignment.
imb/pmb/smb: number of intra/inter/skip MBs.

dimzon
25th August 2005, 16:54
akupenguin
Have you any idea how to suggest hi-motion/low-motion video fragments using x264 1st Pass Log file? My idea is to create external tool for automatic AVS file tuning (adding spartial filter for hi-motion fragments, adding temporal filter for low-motion etc) in order to increase compressibility/overall quality ?

omion
26th August 2005, 01:01
akupenguin
Have you any idea how to suggest hi-motion/low-motion video fragments using x264 1st Pass Log file? My idea is to create external tool for automatic AVS file tuning (adding spartial filter for hi-motion fragments, adding temporal filter for low-motion etc) in order to increase compressibility/overall quality ?

One way to find that out is to add up the itex, ptex, mv, and misc values. That equals the frame size. Then multiply that by (I think) 2^(qp/6) to factor in the quantization. The number you get out should be a measure of relative frame complexity.

It would probably be a good idea to only consider the P-frames, for example, as I frames are always going to be larger than P and B, but that doesn't mean high-motion.

You might also want to do something with the I-frame interval. If there are a lot of I-frames in a row, that indicates high-motion. If the I-frames are the max number of frames apart (by default 250) that indicates low-motion.
Similarly for B-frames: if there are a lot of B-frames between two P-frames, that indicates low-motion. If there are none, then it's high-motion (or they're turned off :p You need to have a bit more information about the video than what's in the log file for this to work)

None of these methods are sure-fire, so do a bunch of tests first!

chen
12th September 2005, 11:33
[QUOTE=akupenguintype: 'I'=>I-frame (IDR), 'i'=>I-frame (non-IDR), 'P'=>P-frame, 'B'=>B-frame (referenced), 'b'=>B-frame (disposable).[/QUOTE]
What is IDR? And what makes it different from normal I-frames?
What is a disposable B-frame?

foxyshadis
12th September 2005, 12:41
Disposable means that when b-pyramid is turned on, it's not one of the b-reference frames. When it's off, all b-frames are this. (Like divx/xvid b-frames.)

IDR frames start a new GOP, thus they're the easiest to seek to. The distiction is made because p/b frames can reference frames on the other side of a normal I frame in h.264.