PDA

View Full Version : X264 vs. default Xvid settings at nearly the same speed?


jeffy
28th March 2007, 21:34
I have read so much threads everywhere, yet I am still confused, if what I am searching for is possible:

When I use a simple AVS script dealing with a noisy 720x576 PAL purely interlaced video, I can achieve in VirtualDubMod 1.5.10.2.2542 with the codec: Xvid 1.2-127 (Dec 8, 2006) (as supplied with AutoGK 2.40), all the parameters default, target quantizer=4.00, single pass; the speed 40-50 fps.

(Core 2 Duo, E6600, 3.6 GHz, 1GB RAM DDR2-533/freq. 600MHz=300 MHz real, 5-6-6-18, Asus P5W DH Deluxe)

Is there some set of x264 parameters bringing nearly the same speed (40 fps and more?) and nearly the same quality? Thank you.



SetMemoryMax(384)
LoadPlugin("DGDecode.dll")
LoadPlugin("TomsMoComp.dll")
LoadPlugin("DeGrainMedian.dll")
movie = mpeg2source("file.mpg.d2v")
m1=DeGrainMedian(movie,limitY=2,limitUV=3,mode=4,interlaced=true)
m2=DeGrainMedian(m1,limitY=2,limitUV=3,mode=3,interlaced=true)
m3=DeGrainMedian(m2,limitY=2,limitUV=3,mode=3,interlaced=true)
TomsMoComp(m3,1,5,1)


One of the samples I found:
--crf 17 --deadzone-inter 4 --deadzone-intra 2 --ref 3 --mixed-refs --no-fast-pskip --bframes 2 --b-pyramid --bime --weightb --direct auto --filter -2,-2 --subme 1 --analyse p8x8,b8x8,i8x8 --8x8dct --vbv-maxrate 1000 --threads auto --thread-input --progress --no-dct-decimate --no-psnr --no-ssim --output "" ""
(http://forum.doom9.org/showthread.php?t=123913)

bond
31st March 2007, 13:21
try disabling everything in x264 and tell us what speed it brings

jeffy
31st March 2007, 15:55
try disabling everything in x264 and tell us what speed it brings
Huh, never imagined before turning off all the options :)

original: MPEG-2 720x576, 25 fps, length: 86 seconds, purely interlaced, filesize: 64,395,856 B

All X264=r635.

X264, QP=22, B=2, T=0, filesize: 22,152,574 B
C:\Program Files\megui\tools\x264>x264 --qp 22 -b 2 --thread-input --threads 0 -
o R:\ads\d9\sample_qp_22.mp4 R:\ads\d9\sample.avs
avis [info]: 720x576 @ 25.00 fps (2160 frames)
x264 [info]: using cpu capabilities MMX MMXEXT SSE SSE2
mp4 [info]: initial delay 1 (scale 25)
x264 [info]: slice I:16 Avg QP:19.00 size: 53328 PSNR Mean Y:45.97 U:48.29
V:48.01 Avg:46.57 Global:46.56
x264 [info]: slice P:1268 Avg QP:22.00 size: 13291 PSNR Mean Y:43.20 U:46.66
V:46.44 Avg:44.05 Global:44.00
x264 [info]: slice B:876 Avg QP:24.00 size: 5050 PSNR Mean Y:42.69 U:46.79
V:46.45 Avg:43.65 Global:43.60
x264 [info]: mb I I16..4: 16.3% 0.0% 83.7%
x264 [info]: mb P I16..4: 7.0% 0.0% 8.3% P16..4: 32.6% 19.8% 8.4% 0.0% 0
.0% skip:24.0%
x264 [info]: mb B I16..4: 0.5% 0.0% 1.3% B16..8: 20.9% 2.2% 5.1% direct:
9.0% skip:60.9%
x264 [info]: SSIM Mean Y:0.9843669
x264 [info]: PSNR Mean Y:43.014 U:46.727 V:46.459 Avg:43.906 Global:43.849 kb/s:
2049.10

encoded 2160 frames, 33.75 fps, 2049.20 kb/s

X264, CRF=20, B=2, T=0, filesize: 23,258,903 B
C:\Program Files\megui\tools\x264>x264 --crf 20 -b 2 --thread-input --threads 0
-o R:\ads\d9\sample_crf_20.mp4 R:\ads\d9\sample.avs
avis [info]: 720x576 @ 25.00 fps (2160 frames)
x264 [info]: using cpu capabilities MMX MMXEXT SSE SSE2
mp4 [info]: initial delay 1 (scale 25)
x264 [info]: slice I:16 Avg QP:19.25 size: 51443 PSNR Mean Y:45.73 U:48.15
V:47.83 Avg:46.36 Global:46.23
x264 [info]: slice P:1268 Avg QP:20.98 size: 14309 PSNR Mean Y:43.81 U:47.02
V:46.81 Avg:44.61 Global:44.50
x264 [info]: slice B:876 Avg QP:23.72 size: 4874 PSNR Mean Y:42.94 U:46.94
V:46.60 Avg:43.87 Global:43.71
x264 [info]: mb I I16..4: 20.2% 0.0% 79.8%
x264 [info]: mb P I16..4: 7.4% 0.0% 7.6% P16..4: 39.6% 20.6% 8.2% 0.0% 0
.0% skip:16.5%
x264 [info]: mb B I16..4: 0.5% 0.0% 1.2% B16..8: 21.5% 2.3% 5.0% direct:
10.1% skip:59.4%
x264 [info]: SSIM Mean Y:0.9852101
x264 [info]: PSNR Mean Y:43.473 U:46.996 V:46.731 Avg:44.326 Global:44.171 kb/s:
2151.53

encoded 2160 frames, 33.86 fps, 2151.64 kb/s

Xvid, TQ=4, Xvid 1.2-127 (Dec 8, 2006) (as supplied with AutoGK 2.40), all the parameters default, target quantizer=4.00, single pass; (equals=B-VOPs max. consecutive: 2, Quantizer ratio: 1.50, Quantizer offset: 1.00), threads: 0
VirtualDubMod 1.5.10.2542, fast recompress
Time: 40 seconds=avg. 54 fps, filesize: 15,835,136 B

Sagittaire
31st March 2007, 16:11
It's not really "desactived all the option" ... :search:

1) ME by defaut is not the fastest setting
2) You must use multi-thread mode with multicore CPU.

x264 can be by far faster than the default xvid setting.

jeffy
31st March 2007, 17:05
It's not really "desactived all the option" ... :search:

1) ME by defaut is not the fastest setting
2) You must use multi-thread mode with multicore CPU.

x264 can be by far faster than the default xvid setting.

--threads 0 is what, please? (100% CPU load, x264.exe 94-98%)
x264 - core 54 svn-635M - H.264/MPEG-4 AVC codec - Copyleft 2005 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=5 brdo=0 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 chroma_qp_offset=0 threads=3 nr=0 decimate=1 mbaff=0 bframes=2 b_pyramid=0 b_adapt=1 b_bias=0 direct=1 wpredb=0 bime=0 keyint=250 keyint_min=25 scenecut=40(pre) rc=cqp qp=22 ip_ratio=1.40 pb_ratio=1.30

x264 - core 54 svn-635M - H.264/MPEG-4 AVC codec - Copyleft 2005 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=5 brdo=0 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 chroma_qp_offset=0 threads=3 nr=0 decimate=1 mbaff=0 bframes=2 b_pyramid=0 b_adapt=1 b_bias=0 direct=1 wpredb=0 bime=0 keyint=250 keyint_min=25 scenecut=40(pre) rc=crf crf=20.0 rceq='blurCplx^(1-qComp)' qcomp=0.60 qpmin=10 qpmax=51 qpstep=4 ip_ratio=1.40 pb_ratio=1.30

Did you mean --me=dia?
X264, QP=22, B=2, T=0, ME=DIA, filesize: 22,174,906 B
C:\Program Files\megui\tools\x264>x264 --qp 22 -b 2 --me=dia --thread-input --th
reads 0 -o R:\ads\d9\sample_qp_22_dia.mp4 R:\ads\d9\sample.avs
avis [info]: 720x576 @ 25.00 fps (2160 frames)
x264 [info]: using cpu capabilities MMX MMXEXT SSE SSE2
mp4 [info]: initial delay 1 (scale 25)
x264 [info]: slice I:16 Avg QP:19.00 size: 53328 PSNR Mean Y:45.97 U:48.29
V:48.01 Avg:46.57 Global:46.56
x264 [info]: slice P:1274 Avg QP:22.00 size: 13269 PSNR Mean Y:43.19 U:46.66
V:46.45 Avg:44.05 Global:44.00
x264 [info]: slice B:870 Avg QP:24.00 size: 5051 PSNR Mean Y:42.68 U:46.79
V:46.45 Avg:43.64 Global:43.59
x264 [info]: mb I I16..4: 16.3% 0.0% 83.7%
x264 [info]: mb P I16..4: 6.9% 0.0% 8.3% P16..4: 32.6% 19.7% 8.2% 0.0% 0
.0% skip:24.2%
x264 [info]: mb B I16..4: 0.5% 0.0% 1.4% B16..8: 20.9% 2.2% 5.1% direct:
9.1% skip:60.8%
x264 [info]: SSIM Mean Y:0.9843511
x264 [info]: PSNR Mean Y:43.009 U:46.727 V:46.460 Avg:43.903 Global:43.845 kb/s:
2051.17

encoded 2160 frames, 35.18 fps, 2051.27 kb/s

X264, CRF=20, B=2, T=0, ME=DIA, filesize: 23,279,382 B
C:\Program Files\megui\tools\x264>x264 --crf 20 -b 2 --me=dia --thread-input --t
hreads 0 -o R:\ads\d9\sample_crf_20_dia.mp4 R:\ads\d9\sample.avs
avis [info]: 720x576 @ 25.00 fps (2160 frames)
x264 [info]: using cpu capabilities MMX MMXEXT SSE SSE2
mp4 [info]: initial delay 1 (scale 25)
x264 [info]: slice I:16 Avg QP:19.25 size: 51561 PSNR Mean Y:45.74 U:48.16
V:47.85 Avg:46.36 Global:46.24
x264 [info]: slice P:1274 Avg QP:20.98 size: 14274 PSNR Mean Y:43.81 U:47.02
V:46.80 Avg:44.61 Global:44.49
x264 [info]: slice B:870 Avg QP:23.72 size: 4882 PSNR Mean Y:42.93 U:46.93
V:46.60 Avg:43.87 Global:43.71
x264 [info]: mb I I16..4: 19.8% 0.0% 80.2%
x264 [info]: mb P I16..4: 7.3% 0.0% 7.7% P16..4: 39.6% 20.5% 8.1% 0.0% 0
.0% skip:16.7%
x264 [info]: mb B I16..4: 0.5% 0.0% 1.3% B16..8: 21.4% 2.3% 5.0% direct:
10.1% skip:59.3%
x264 [info]: SSIM Mean Y:0.9852034
x264 [info]: PSNR Mean Y:43.472 U:46.995 V:46.731 Avg:44.325 Global:44.169 kb/s:
2153.43

encoded 2160 frames, 34.29 fps, 2153.54 kb/s

Ranguvar
31st March 2007, 18:11
x264 CAN be faster than Xvid...

But if you want that, Xvid will end up looking better, usually.

Xvid is many times faster than x264, but x264 outputs better compression/quality videos. AVC/H.264 is fairly new, and so is slow as hell to encode to. For now, I prefer Xvid, because I can set extreme options (Quarter Pixel, GMC, 2-pass, Packed Bitstream, 3 BVOPs, unrestricted profile, chroma motion, VHQ for b-frames, no turbo, Level 6 Ultra High motion search precision, Level 4 Wide Search VHQ mode, etc.) and get nice quality at fair speed. x264 will get better, and PCs will get faster, so soon x264 will be close enough in speed to Xvid that it won't matter and I'll use x264 then.

ToS_Maverick
31st March 2007, 19:32
try this, faster than xvid, equal quality:


--crf 20.0 --level 3 --ref 3 --mixed-refs --no-fast-pskip --bframes 3 --b-pyramid --bime --weightb --filter -2,-2 --subme 1 --analyse p8x8,b8x8,i8x8 --8x8dct --vbv-maxrate 10000 --threads auto --thread-input --progress --no-dct-decimate --no-psnr --no-ssim --output


adjust the CRF-Factor to meet your desired size

Sagittaire
31st March 2007, 20:38
x264 CAN be faster than Xvid...

But if you want that, Xvid will end up looking better, usually.



No ... :search:

http://forum.doom9.org/showthread.php?t=105763&highlight=speed

jeffy
31st March 2007, 21:19
try this, faster than xvid, equal quality:


--crf 20.0 --level 3 --ref 3 --mixed-refs --no-fast-pskip --bframes 3 --b-pyramid --bime --weightb --filter -2,-2 --subme 1 --analyse p8x8,b8x8,i8x8 --8x8dct --vbv-maxrate 10000 --threads auto --thread-input --progress --no-dct-decimate --no-psnr --no-ssim --output


adjust the CRF-Factor to meet your desired size

X264, CRF=20, B=3, by ToS_Maverick, filesize: 38,037,037 B
C:\Program Files\megui\tools\x264>x264 --crf 20.0 --level 3 --ref 3 --mixed-ref
s --no-fast-pskip --bframes 3 --b-pyramid --bime --weightb --filter -2,-2 --subm
e 1 --analyse p8x8,b8x8,i8x8 --8x8dct --vbv-maxrate 10000 --threads auto --threa
d-input --no-dct-decimate --no-psnr --no-ssim -o R:\ads\d9\sample_crf_20_ToS_Mav
erick.mp4 R:\ads\d9\sample.avs
avis [info]: 720x576 @ 25.00 fps (2160 frames)
x264 [warning]: DPB size (3732480) > level limit (3110400)
x264 [info]: using cpu capabilities MMX MMXEXT SSE SSE2
x264 [warning]: VBV maxrate specified, but no bufsize.
mp4 [info]: initial delay 2 (scale 25)
x264 [info]: slice I:16 Avg QP:16.44 size: 68932
x264 [info]: slice P:1524 Avg QP:17.97 size: 20448
x264 [info]: slice B:620 Avg QP:22.34 size: 9279
x264 [info]: mb I I16..4: 4.1% 19.3% 76.6%
x264 [info]: mb P I16..4: 2.7% 8.8% 0.0% P16..4: 68.8% 10.1% 6.6% 0.0% 0
.0% skip: 3.0%
x264 [info]: mb B I16..4: 0.5% 2.3% 0.0% B16..8: 22.2% 2.5% 6.8% direct:
22.2% skip:43.6%
x264 [info]: 8x8 transform intra:72.8% inter:48.0%
x264 [info]: ref P 90.2% 6.3% 3.5%
x264 [info]: ref B 85.1% 10.7% 4.1%
x264 [info]: kb/s:3520.2
encoded 2160 frames, 39.13 fps, 3520.28 kb/s


X264, CRF=22, B=3, by ToS_Maverick, filesize: 28,579,037 B
C:\Program Files\megui\tools\x264>x264 --crf 22.0 --level 3 --ref 3 --mixed-ref
s --no-fast-pskip --bframes 3 --b-pyramid --bime --weightb --filter -2,-2 --subm
e 1 --analyse p8x8,b8x8,i8x8 --8x8dct --vbv-maxrate 10000 --threads auto --threa
d-input --no-dct-decimate --no-psnr --no-ssim -o R:\ads\d9\sample_crf_22_ToS_Mav
erick.mp4 R:\ads\d9\sample.avs
avis [info]: 720x576 @ 25.00 fps (2160 frames)
x264 [warning]: DPB size (3732480) > level limit (3110400)
x264 [info]: using cpu capabilities MMX MMXEXT SSE SSE2
x264 [warning]: VBV maxrate specified, but no bufsize.
mp4 [info]: initial delay 2 (scale 25)
x264 [info]: slice I:16 Avg QP:18.44 size: 57159
x264 [info]: slice P:1524 Avg QP:19.97 size: 15388
x264 [info]: slice B:620 Avg QP:24.34 size: 6766
x264 [info]: mb I I16..4: 5.2% 24.0% 70.8%
x264 [info]: mb P I16..4: 3.2% 8.5% 0.0% P16..4: 67.3% 9.2% 5.1% 0.0% 0
.0% skip: 6.7%
x264 [info]: mb B I16..4: 0.4% 2.1% 0.0% B16..8: 20.8% 2.2% 5.5% direct:
17.6% skip:51.4%
x264 [info]: 8x8 transform intra:69.6% inter:48.9%
x264 [info]: ref P 90.3% 6.1% 3.5%
x264 [info]: ref B 84.8% 11.0% 4.3%
x264 [info]: kb/s:2644.4
encoded 2160 frames, 40.61 fps, 2644.54 kb/s

I haven't used the option --progress.

But with this option, it is better :confused:, filesize 28,579,037 B.
C:\Program Files\megui\tools\x264>x264 --crf 22.0 --level 3 --ref 3 --mixed-ref
s --no-fast-pskip --bframes 3 --b-pyramid --bime --weightb --filter -2,-2 --subm
e 1 --analyse p8x8,b8x8,i8x8 --8x8dct --vbv-maxrate 10000 --threads auto --threa
d-input --no-dct-decimate --no-psnr --no-ssim --progress -o R:\ads\d9\sample_crf
_22_progress_ToS_Maverick.mp4 R:\ads\d9\sample.avs
avis [info]: 720x576 @ 25.00 fps (2160 frames)
x264 [warning]: DPB size (3732480) > level limit (3110400)
x264 [info]: using cpu capabilities MMX MMXEXT SSE SSE2
x264 [warning]: VBV maxrate specified, but no bufsize.
mp4 [info]: initial delay 2 (scale 25)
x264 [info]: slice I:16 Avg QP:18.44 size: 57159:00:00
x264 [info]: slice P:1524 Avg QP:19.97 size: 15388
x264 [info]: slice B:620 Avg QP:24.34 size: 6766
x264 [info]: mb I I16..4: 5.2% 24.0% 70.8%
x264 [info]: mb P I16..4: 3.2% 8.5% 0.0% P16..4: 67.3% 9.2% 5.1% 0.0% 0
.0% skip: 6.7%
x264 [info]: mb B I16..4: 0.4% 2.1% 0.0% B16..8: 20.8% 2.2% 5.5% direct:
17.6% skip:51.4%
x264 [info]: 8x8 transform intra:69.6% inter:48.9%
x264 [info]: ref P 90.3% 6.1% 3.5%
x264 [info]: ref B 84.8% 11.0% 4.3%
x264 [info]: kb/s:2644.4

encoded 2160 frames, 40.73 fps, 2644.54 kb/s

:thanks: ToS_Maverick!

akupenguin
1st April 2007, 01:04
You ran an encode with and without --progress, and got identical results. What's the problem again? (no, a 0.3% difference in speed with a sample size of 1 doesn't count as statistically significant)

jeffy
1st April 2007, 16:51
You ran an encode with and without --progress, and got identical results. What's the problem again? (no, a 0.3% difference in speed with a sample size of 1 doesn't count as statistically significant)

I'm sorry, probably nothing :), I was just puzzled at first, when seeing the ouput with this option faster than without it. Statistically insignificant, thanks for pointing out.

Sagittaire
1st April 2007, 17:22
I'm sorry, probably nothing :), I was just puzzled at first, when seeing the ouput with this option faster than without it. Statistically insignificant, thanks for pointing out.

well it's not the max speed ...

--ref 1
--no-fast-pskip
--no-dct-decimate
--bframes 3
--b-pyramid
--bime
--weightb
--filter -1,-1
--subme 1
--analyse "none"
--8x8dct
--me "dia"
--no-chroma-me
--no-psnr
--no-ssim

... will done better speed than defaut XviD setting

jeffy
1st April 2007, 17:50
well it's not the max speed ...

--ref 1
--no-fast-pskip
--no-dct-decimate
--bframes 3
--b-pyramid
--bime
--weightb
--filter -1,-1
--subme 1
--analyse "none"
--8x8dct
--me "dia"
--no-chroma-me
--no-psnr
--no-ssim

... will done better speed than defaut XviD setting

X264, CRF=22, by SGT_Fastest, filesize: 28,811,383 B
C:\Program Files\megui\tools\x264>x264 --crf 22.0 --thread-input --threads 0 --
ref 1 --no-fast-pskip --no-dct-decimate --bframes 3 --b-pyramid --bime --weightb
--filter -1,-1 --subme 1 --analyse "none" --8x8dct --me "dia" --no-chroma-me --
no-psnr --no-ssim --progress -o R:\ads\d9\sample_crf_22_progress_SGT_fastest.mp4
R:\ads\d9\sample.avs
avis [info]: 720x576 @ 25.00 fps (2160 frames)
x264 [info]: using cpu capabilities MMX MMXEXT SSE SSE2
mp4 [info]: initial delay 2 (scale 25)
x264 [info]: slice I:16 Avg QP:18.38 size: 57426:00:00
x264 [info]: slice P:1566 Avg QP:19.98 size: 15287
x264 [info]: slice B:578 Avg QP:24.30 size: 6807
x264 [info]: mb I I16..4: 5.2% 24.0% 70.8%
x264 [info]: mb P I16..4: 8.5% 0.0% 0.0% P16..4: 84.3% 0.0% 0.0% 0.0% 0
.0% skip: 7.2%
x264 [info]: mb B I16..4: 1.2% 0.0% 0.0% B16..8: 27.4% 0.0% 0.0% direct:
20.4% skip:51.1%
x264 [info]: 8x8 transform intra:2.5% inter:51.6%
x264 [info]: kb/s:2666.0

encoded 2160 frames, 49.11 fps, 2666.09 kb/s


X264, CRF=20, by SGT_Fastest, filesize: 38,405,468 B
C:\Program Files\megui\tools\x264>x264 --crf 20.0 --thread-input --threads 0 --
ref 1 --no-fast-pskip --no-dct-decimate --bframes 3 --b-pyramid --bime --weightb
--filter -1,-1 --subme 1 --analyse "none" --8x8dct --me "dia" --no-chroma-me --
no-psnr --no-ssim --progress -o R:\ads\d9\sample_crf_20_progress_SGT_fastest.mp4
R:\ads\d9\sample.avs
avis [info]: 720x576 @ 25.00 fps (2160 frames)
x264 [info]: using cpu capabilities MMX MMXEXT SSE SSE2
mp4 [info]: initial delay 2 (scale 25)
x264 [info]: slice I:16 Avg QP:16.38 size: 69368:00:00
x264 [info]: slice P:1566 Avg QP:17.98 size: 20370
x264 [info]: slice B:578 Avg QP:22.30 size: 9305
x264 [info]: mb I I16..4: 4.0% 18.9% 77.1%
x264 [info]: mb P I16..4: 8.1% 0.0% 0.0% P16..4: 88.8% 0.0% 0.0% 0.0% 0
.0% skip: 3.1%
x264 [info]: mb B I16..4: 1.3% 0.0% 0.0% B16..8: 29.9% 0.0% 0.0% direct:
25.6% skip:43.2%
x264 [info]: 8x8 transform intra:2.0% inter:50.9%
x264 [info]: kb/s:3554.3

encoded 2160 frames, 47.88 fps, 3554.43 kb/s

:thanks:, Sagittaire!