View Full Version : XviD presets - preliminary thoughts and suggestions
Pages :
1
2
3
4
5
6
[
7]
8
foxyshadis
3rd August 2006, 04:57
Oh, that's needed? I'd have included it in my last xvid patch if I'd known. >.> You can add it to custom command-line though now.
Wait, I don't see it in xvid_encraw at all. Looked and looked! Is it just not implemented there yet? MeGUI can't support it unless it is.
I also saw that it's a per-zone option in vfw, but if it is supported, it would probably have to be global (added to all zones) to fit MeGUI's structure, unless it's really important that it be per-zone.
squid_80
3rd August 2006, 06:18
Just like in vfw, it's a zone option in encraw.
E.G. -zones 0,w,1,O if you want chroma optimizer for the whole movie.
Other zone flags: K=start on keyfame, C=cartoon mode, G=greyscale, number=b-frame sensitivity. Flags can be in any order.
kurt
3rd August 2006, 07:21
Just like in vfw, it's a zone option in encraw.
E.G. -zones 0,w,1,O if you want chroma optimizer for the whole movie.
Other zone flags: K=start on keyfame, C=cartoon mode, G=greyscale, number=b-frame sensitivity. Flags can be in any order.
comma before O is wrong, as you stated here (http://forum.doom9.org/showthread.php?p=803675#post803675) :)
Don't put commas between the optional flags (including bvop sensitivity), e.g:
-zones 1,w,0.5,25O/359,w,1,O/161519,w,0.04,25OG
squid_80
3rd August 2006, 07:27
Comma between b-vop sensitivity value and flags is wrong.
Comma between weight/quantizer value and flags is correct.
foxyshadis
3rd August 2006, 11:37
Oh man, you really need a gui to get that syntax right. :x But thanks for letting me know. It looks like I'll just have to subclass megui's zones panel, or some other gui trickery.
aabxx
7th August 2006, 00:53
Very nice initiative Teegedeck.
However, do you think your settings will work just as well for interlaced encodings (that is, with the interlaced option turned on in xvid) or is there something one should do different there regarding 1st pass/2nd pass settings which is general enough for you to reply about?
CRCC
7th August 2006, 01:59
Hi
hope you don't mind me putting up an answer teegedeck
Presets all work with interlace, Progressive, Hybrid
it's recommended to set AssumeTFF or AsumeBFF in a avisynth script then using the top field option in XviD
just don't ever resize you'll not only resize the picture but the interlace aswell its ugly imo.
mind me asking why your encoding interlace ?
becuase of jerky motion ?
even hardcoded interlace can be gotten rid off with a smoothdeinterlacer and the picture won't get jerky
well as most of us know no deinterlacer is perfect ..yet:P
Hybrid (NTSC Only) use decombvfr or tritical's filters and timecodes txt inside .mkv (matroska) or .mp4
Progressive (23.976) use dgindex force film + telecide / telecide + decimate / tfm + t-decimate ..whatever works best :)
hope this helps
laters
Livesms
7th August 2006, 08:24
Teegedeck
:) I spent over 2 days encoding 2 hour video with different settings and so on.
Enc gives my 30-32% with 5%-25% test run.
i have encoded it with 30% and 45% prfiles with HQ and fast settings. And then encoded with "standart/default" HQ profile - H263, BVops 3-1.62-100, PackedBS, ME=6, VHQ=4, VHQ for B-frames, CME, no turbo, no Qpel, no GMC, no AQ and get better result than >30% HQ (better among your profiles).
I tested all results with MSU Video Comparative Tool 1.2 (PSNR and Blocking MSU tests).
So can it be - or I am doing smth wrong. Is it possible to predict, that I will get better result without Enc+your profiles.
Teegedeck
7th August 2006, 09:09
Thanks, CRCC, you answered that better than I could because I never encode interlaced content. :goodpost:
So can it be - or I am doing smth wrong. Is it possible to predict, that I will get better result without Enc+your profiles.Not really, no. Not if you ask me. :) But then again it's your eyes and everyone has his/her own taste.
Enc gives my 30-32% with 5%-25% test run.
i have encoded it with 30% and 45% prfiles with HQ and fast settings.How do you manage to use the >45% preset if the Enc test gives you a 30% result? You should get massive oversizing. And you're of course not meant to change the quantizer restrictions of the profiles...
I tested all results with MSU Video Comparative Tool 1.2 (PSNR and Blocking MSU tests).PSNR tests? I'm afraid you've waisted your time there. You're much better off using your actual eyes than a software that tries to imitate your visual system.
Livesms
7th August 2006, 09:16
Teegedeck
Yes. But if 30% is more blockie than with H263. :) For everyone's eye.
>45% with tested just for "a test". I was inetrested what it will be.
PSNR test was just one part of testing. I as comparing the same frames from each video in AviSynth script in VirtualDub.
Is it possible to predict, that I will get better result without Enc+your profiles.
Teegedeck
7th August 2006, 09:30
Hmm; no, not for everyone's eyes and not for every source. :) To me H.263 quantization looks less detailed than EQMv3 ULR for example. Objectively ULR creates more ringing (as can be seen in a frame-by-frame comparision) and possibly a marginally higher number of blocky frames but subjectively (i.e. for me) it looks closer to the original. H.263 smoothes a lot. This, BTW, is why you will always reach higher PSNR values for H.263 than for any other quantization matrix. If you prefer a smoothed look, hey that's fine with me.
Even so, the quantizer restrictions force you to uphold a certain minimum quality, so I guess the presets make sense even for you.
Edit: BTW, if smooth is OK for you, try x264 - this will smooth very much but you will have no blocking or ringing at all. I think, at a 30% Enc result x264 will look decidedly better to you than XviD, regardless of settings. XviD will be more worthwhile starting at, say, 40%.
henryho_hk
7th August 2006, 15:27
Talking about H.263, Teegedeck, are you interested in making some presets which are compatible with ESS and MTK standalones?
Livesms
7th August 2006, 15:53
Hmm; no, not for everyone's eyes and not for every source. :) To me H.263 quantization looks less detailed than EQMv3 ULR for example. Objectively ULR creates more ringing (as can be seen in a frame-by-frame comparision) and possibly a marginally higher number of blocky frames but subjectively (i.e. for me) it looks closer to the original. H.263 smoothes a lot. This, BTW, is why you will always reach higher PSNR values for H.263 than for any other quantization matrix. If you prefer a smoothed look, hey that's fine with me.
Even so, the quantizer restrictions force you to uphold a certain minimum quality, so I guess the presets make sense even for you.
Edit: BTW, if smooth is OK for you, try x264 - this will smooth very much but you will have no blocking or ringing at all. I think, at a 30% Enc result x264 will look decidedly better to you than XviD, regardless of settings. XviD will be more worthwhile starting at, say, 40%.
x264 is too slow in good/best settings. It is up to 1 day to encode 2hour video with best settings in 2pass.
Ok - how can I calculate bitrate/frame size to encode without blocking.
Is it possible to find out wich setting was used to encode video if I get only result video. I'm interested in QMaxtrix, Bframe (count, offset and so on)?
I've got DVD rip of 1h52m video (640*252), encoded with Xvid with over. bitrate 1279 kbit/s (to fit 2CD using AC audio). Quality looks rather good (if not perfect). Can I found out settings, used to encode this video.
Here is the link - if some bory can download 1.4Gb without any problem :)
http://www.doza.com.ua:8080/video/thriller/Derailed%20(DVDRip,%20XviD,%20Ac3,%20Rus).avi
CRCC
7th August 2006, 16:30
You can use all presets but your limited to 1 B-frame and No GMC no QPEL
but there are some differences between those chipsets
with XviD you'll need to do a 2pass (VBV) or CBR 1pass CQ stutters or doesn't play at all (atleast on ESS chips it doesn't)
ESS (weak) Max resolution 720x(480)576 [L5] No GMC, No QPEL 0/1 b-frame no custom matrix use h263 or mpeg only
MTK (decent/good) Max resolution 720x(480)576 [L5] No GMC, 0/1 B-Frame, QPEL, CQM works
( tested 6of9, heini_mr, sharktooths cqm's work minus uhr, yacm )
worst thing is you have to use the .avi container .... with most players some work with .mp4 (like Pioneer) better ask SeeMoreDigital about this
i've tested XviD on a philips 720sa / philips 5960 with bitrates over 4000
one cool thing bout the 5960 is it can play files larger than 2gb so you don't have to splitt them and the upscaling is pretty good
talking bout standalone players ..why not the good old XboX (PC in box) (+mod) and XBMC play's everthing from XviD to X.264 (standart Profile)and allmost all containers .avi .mp4 .mkv .ogm etc etc
aabxx
7th August 2006, 19:19
Okay, the original post was a bit too confusing, so I come with alternative discussion about 1.62 / 0 (the infamous golden cut) versus defaults (1.5 / 1)...
Let's take example: p-frame is q3 -- b-frame -- p-frame q4... that would give b-frame quant of q5 with golden cut. The funny part is that with AQ enabled, many parts of the q4 frame, if it is say a dark scene, will be quant 6... so you'll basically be encoding some parts in a lower quantizer (in the b-frames) than the actual reference quant!
Perhaps this was easier to understand than my mumbling and someone has something clever to say?
Teegedeck
8th August 2006, 13:30
Yeeees, this problem has been bugging me for a long time. We still don't have AQ for b-frames. :(
That's why AQ is only used in the preset that should give strongest compression, not in the presets that aim at high fidelity. I think using the default b-frame settings with an offset (instead of the golden cut) could indeed make sense here. Theoretically it would be 'cleaner'. I'm not at all sure whether introducing an offset would not in practice lead to a more severe 'flickering effect'. After all we're talking about a matrix with very high coefficients here (EQMv3 ULR) where the quantization steps are very large. I should test what's better: the preset as it is; default b-frame settings; ditching AQ for good.
I would much rather prefer AQ for b-frames for a consistent approach, though... I don't know about their status, the last I read of it was 2005 (http://forum.doom9.org/showthread.php?t=103182&page=2).
Edited: typo
henryho_hk
8th August 2006, 14:26
Unofficial ESS & MTK presets added. :P
http://forum.doom9.org/showthread.php?p=850423#post850423
Didée
8th August 2006, 15:38
@ aabxx
A pity you edited your post, now there's no more the 'efficiency' word I'd like to have quoted ;)
First off, when I tried out and finally settled for the 1.62/0 settings, I didn't have AQ in mind at all. The scenario was more like: If, starting with the result at a given bitrate and standard settings, I want to increase quality by giving some more bitrate, THEN the plus of bitrate is better invested with these settings instead of standard settings.
Still, the "issue" you found is more a cosmetical one than a technical. Usually the saying is "B quant must be bigger than P quant" because else, the B's would be almost as big as the P's, so the benefit of using B's at all would shrink by much.
But in the case of AQ, where only some P-blocks are forced to higher quants, this doesn't matter. You still get the benefit from the stronger P-blocks compression. The inbetween B-frame(s), even if not AQ'ed, will reproduce those stronger-compressed blocks at a fairly low size, even at a "too low" quantizer.
(now @ Teegedeck, too)
Moreover, AQ for B-frames is something one can live without very easily. The point is that the additional benefit would be pretty small, but perhaps the danger of visual impacts could arise. (BTW, libavcodec/ffdshow has it, and is always there to try out AQ-for-B-frames, isn't it.)
Look at a typical encoding: ~40% P-frames, ~60% B-frames, where the average B-frame is only ~25-30% the size of the average P-frame. Remember that, the higher the quant is, and the lower the framesize already is, the lesser the size gain from raising the quant.
Now, over the thumb: the bitrate sparing from using AQ (for P) is like 2% or so ...
2% * 0.25 / 0.6 ~= 0.8% is roughly what you could expect from AQ for B-frames. (Practically, I'd estimate more like 0.5-0.7%). And this means additional raising of block-quants in almost 2 thirds of your video (where they're not raised with the current implementation), hence the potential risk of more possible artefacting.
I suppose that's the reason why AQ for B-frames never was implemented into XviD: the possible benefit is so small, that never anyone bothered to implement it.
Teegedeck
8th August 2006, 15:54
Thanks for the explanation, Didée.
But in the case of AQ, where only some P-blocks are forced to higher quants, this doesn't matter. You still get the benefit from the stronger P-blocks compression. The inbetween B-frame(s), even if not AQ'ed, will reproduce those stronger-compressed blocks at a fairly low size, even at a "too low" quantizer.
I guess this at least explains why there still is a net saving from using AQ. It's not exactly something you would think of by intution, you know. :) Seems the preset can stay as it is.
aabxx
9th August 2006, 10:21
:thanks: Didée, you won me over. Although after counting 1.6 will give the same results as 1.62 up to very high quants so I will use that instead thank you very much as I'm not nearly as obsessed as you are about mythical numbers, although the thought did occur to me that when explaining the option to my noob friends, mentioning how 1.62 is approximately the "legendary" "golden cut" would give me a lot of geek cred, but then it occured to me I'm geeky enough as it is and my coolness factor what little there is left of it might drop a little bit too much for my liking. :D :P :eek:
Okay... now about noisy sources and MSP=4... I did a little testing (against MSP=6 of course) on one high and one low motion sequence on first quant 3 and then quant 6 (all settings on and on max except qpel, interlaced and GMC, mpeg matrix) and well... they look same enough to me that I wouldn't worry using MSP=6, however, there is always a chance that with enough samples one of them might look worse, but I'll take my chances (of course, it would be cool if other people tested this as well, so that we can discover the existance of such degradations if they exist).
If there is some theoretical advantage to use MSP=4 on noisy sources, I would not think it is worth the 3-4% loss in bitrate.
numaios
10th August 2006, 14:26
I've read that the first pass must be set like this:
Quantizer=3, motion search precision=5 (except for the '90% preset' where it should be '4'), VHQ=1
If I set MSP=6, Chr. ME enabled and VHQ=4, is it gonna work too? Maybe better?
Why it's preferable not using the maximum possibilities of the codec in the first pass?
Thank you.
foxyshadis
10th August 2006, 15:42
Because first pass gets thrown away, so all you're doing is wasting time. Those reduced settings are already enough to create accurate stats for the second pass.
numaios
10th August 2006, 18:42
OK, thanks. I understand, so using the maximum settings is unnecessary, but wouldn't harm the result either.
aabxx
11th August 2006, 00:38
Using full settings on first pass is always more accurate.
However, the accuracy becomes more theoretical than practical at one point. I reckon it would be almost impossible to notice the difference.
Actually even if you used very quick settings on first pass (like the default turbo mode), you would find it extremely difficult to notice the difference if you're doing a high bitrate encoding IMO.
numaios
11th August 2006, 11:41
OK, thanks for your answers!
henryho_hk
14th August 2006, 00:57
Teegedeck, sorry if I have asked it before, do we need to enable chroma ME and chroma opt. during the comp test?
Teegedeck
14th August 2006, 07:49
No, chroma ME has hadly any influence on filesize and chroma opt doesn't have any (though chroma opt also doesn't influence encoding speed from what I know).
henryho_hk
15th August 2006, 00:26
BAT script updated again here: http://forum.doom9.org/showthread.php?p=850423#post850423
Now the script expects enctest_mtk.ens and enctest_nrm.ens (the comp test settings of MTK/ESS and normal encodes respectively) in xvid_encraw\apps\Enc103\settings. MTK settings are simply normal settings plus 1-B frame and VBV settings.
Some more clean-ups in the script.... and remember that you need to have a write privilege under xvid_encraw\apps so as to run the script.
boombastic
25th August 2006, 07:38
I'm trying to use these presets with MeGui,i imported them into the program and set up all for the encoding but when i start the queue i get the same error reported here:
http://forum.doom9.org/showthread.php?t=114927&highlight=extra
is there a way to bypass it?I tried to put that matrix in:
1)the same diredtory of xvid_encraw
2)in MeGui/extra/..
3)MeGui/xvid_encraw/extra/..
but nothing seems to work.
foxyshadis
25th August 2006, 08:35
Instead of trying to put the matrix in random places hoping it'll be the right one, open the xvid profile and replace the matrix with with yours, which will add the full path to it, until some workaround is implemented in MeGUI. (A /matrix folder as default?)
The actual "right place" is usually the last folder you opened or saved something in, which here is usually the video's folder, btw.
boombastic
25th August 2006, 08:52
i didn't know that i could do that!I saw the commandline for enc_raw and found that it was looking for an "extra" folder,so i tried to create that folder and put the matrix in.
Thanks for the quick reply!
rack04
5th September 2006, 22:32
The following is the BAT script implementing the new presets (cmprgt30fast, cmprgt30hq, cmprgt45fast, cmprgt45hq, cmprgt58fast, cmprgt58hq, cmprgt90fast & cmprgt90hq). This version does not have batch mode support and you can only feed it with one AVS at one time.
If you specify "cmprchkfast" or "cmprchkhq" as parameter, it will fire up Enc for you to perform a comp test (refer to the past posts for details). Since I have not found any way to automate Enc yet, you need to click a few buttons and close Enc manually. The BAT will presume your comp test is successfull and parse the log file for the result so as to pick the right preset (fast/hq as you specified) for your AVS.
Before you use the BAT script, remember to set the full path of Enc and Virtualdubmod at the start of the script.
Please enjoy.
-----------------------
20060712: Corrected some stupid mistakes in comp test result parsing.
20060808: Unofficial ESS and MTK presets added.
20060809: Preset ">45% Fast" corrected
20060814: BAT script clean-up
-----------------------
@echo off
setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
if "%4"=="" (
echo Usage: %0 [filename.avs] cmp{chk/gt30/gt45/gt58/gt90}{hq/fast/ess/mtk} {br/ts} [val]
echo To use Enc comp test, use cmprchkhq, cmprchkfast, cmprchkess or cmprchkmtk.
goto GEND
)
rem set _FULL_ path of Enc 1.03 and VirtualDubMod 1.5.10.2
set XENPATH=c:\apps\xvid_encraw
set ENCPATH=%XENPATH%\apps\Enc103
set VDEPATH=%XENPATH%\apps\VirtualDub15102mod2542\VirtualDubMod.exe
rem Enc requires full path names
for %%a in (%1) do set i=%%~fa
set WAY=%2
set SIZU=%3
set SIZV=%4
rem if /I not "%i%"=="all"
if /I not "%i:~-4%"==".avs" (
echo Source file must be AVS.
goto GEND
)
if not exist "%i%" (
echo Source file is not found.
goto GEND
)
if /I "%SIZU%"=="br" (
set SIZ=-bitrate %SIZV%
set SIZCT=-tm=br -br=%SIZV%
) else if /I "%SIZU%"=="ts" (
set SIZ=-size %SIZV%
set SIZCT=-tm=ts -ts=%SIZV%
) else (
set SIZ=-bitrate 1300
set SIZCT=-tm=br -br=1300
)
if /I "%WAY:~0,7%"=="cmprchk" (
set CHKPS=5
if exist %ENCPATH%\settings\default.ens del %ENCPATH%\settings\default.ens
if /i "!WAY:~7!"=="ess" (
copy %ENCPATH%\settings\enctest_mtk.ens %ENCPATH%\settings\default.ens
rem copy %ENCPATH%\settings\enctest_ess.ens %ENCPATH%\settings\default.ens
) else if /i "!WAY:~7!"=="mtk" (
copy %ENCPATH%\settings\enctest_mtk.ens %ENCPATH%\settings\default.ens
) else (
copy %ENCPATH%\settings\enctest_nrm.ens %ENCPATH%\settings\default.ens
)
if not exist %ENCPATH%\jobs\logs\old mkdir %ENCPATH%\jobs\logs\old
if exist %ENCPATH%\jobs\logs\*.enj move /y %ENCPATH%\jobs\logs\*.enj %ENCPATH%\jobs\logs\old
start /b /wait %ENCPATH%\enc.exe -fr=on -mo=ct -us=!CHKPS! -me=ex %SIZCT% -vd=%VDEPATH% -if="%i%" -of="%i%_ct.avi"
for %%f in (%ENCPATH%\jobs\logs\*.enj) do for /f "usebackq tokens=3" %%p in (`find " [Ok] " "%%f"`) do (
set p1=%%p
)
echo Compressibility test for the specified size is !p1!
set p1=!p1:~0,-4!
set PRESET=cmprgt30!WAY:~7!
rem if !p1! GEQ 30 set PRESET=cmprgt30!WAY:~7!
if !p1! GEQ 45 set PRESET=cmprgt45!WAY:~7!
if !p1! GEQ 58 set PRESET=cmprgt58!WAY:~7!
if !p1! GEQ 90 set PRESET=cmprgt90!WAY:~7!
echo Preset !PRESET! is choosen
rem echo You can break now if you want.
rem pause
) else (
set W1=!WAY:~0,6!
set W2=!WAY:~6,2!
set W3=!WAY:~8!
set PRESET=%WAY%
if /i not "!W1!"=="cmprgt" set PRESET=cmprgt45fast
if /i not "!W2!"=="30" if /i not "!W2!"=="45" if /i not "!W2!"=="58" if /i not "!W2!"=="90" set PRESET=cmprgt45fast
if /i not "!W3!"=="mtk" if /i not "!W3!"=="ess" if /i not "!W3!"=="fast" if /i not "!W3!"=="hq" set PRESET=cmprgt45fast
)
rem echo "%PRESET%"
if /I "%PRESET%"=="cmprgt30ess" (
set PP1=-max_key_interval 300 -max_bframes 1 -bquant_ratio 162 -bquant_offset 0 -vhqmode 1 -qtype 1 -nopacked -imin 3 -imax 5 -bmin 3 -bmax 5 -pmin 3 -pmax 5 -quality 5 -vbvsize 3145728 -vbvmax 4854000 -vbvpeak 8000000 -nochromame -turbo
set PP2=-max_key_interval 300 -max_bframes 1 -bquant_ratio 162 -bquant_offset 0 -vhqmode 2 -bvhq -qtype 1 -nopacked -imin 3 -imax 5 -bmin 3 -bmax 5 -pmin 3 -pmax 5 -quality 6 -vbvsize 3145728 -vbvmax 4854000 -vbvpeak 8000000 -chigh 30 -clow 15 %SIZ%
set P1Q=3
set ZBS=
set NUMPASS=2
)
if /I "%PRESET%"=="cmprgt30mtk" (
set PP1=-max_key_interval 300 -max_bframes 1 -bquant_ratio 162 -bquant_offset 0 -vhqmode 1 -lumimasking -qtype 1 -qmatrix apps\eqm_v3ulr_rev3.xcm -nopacked -imin 3 -imax 5 -bmin 3 -bmax 5 -pmin 3 -pmax 5 -quality 5 -vbvsize 3145728 -vbvmax 4854000 -vbvpeak 8000000 -nochromame -turbo
set PP2=-max_key_interval 300 -max_bframes 1 -bquant_ratio 162 -bquant_offset 0 -vhqmode 1 -bvhq -lumimasking -qtype 1 -qmatrix apps\eqm_v3ulr_rev3.xcm -nopacked -imin 3 -imax 5 -bmin 3 -bmax 5 -pmin 3 -pmax 5 -quality 6 -vbvsize 3145728 -vbvmax 4854000 -vbvpeak 8000000 -chigh 30 -clow 15 %SIZ%
set P1Q=3
set ZBS=
set NUMPASS=2
)
if /I "%PRESET%"=="cmprgt30fast" (
set PP1=-max_key_interval 300 -max_bframes 2 -bquant_ratio 162 -bquant_offset 0 -vhqmode 1 -lumimasking -qtype 1 -qmatrix apps\eqm_v3ulr_rev3.xcm -nopacked -imin 3 -imax 5 -bmin 3 -bmax 5 -pmin 3 -pmax 5 -quality 5 -nochromame -turbo
set PP2=-max_key_interval 300 -max_bframes 2 -bquant_ratio 162 -bquant_offset 0 -vhqmode 1 -bvhq -lumimasking -qtype 1 -qmatrix apps\eqm_v3ulr_rev3.xcm -nopacked -imin 3 -imax 5 -bmin 3 -bmax 5 -pmin 3 -pmax 5 -quality 6 -chigh 30 -clow 15 %SIZ%
set P1Q=3
set ZBS=
set NUMPASS=2
)
if /I "%PRESET%"=="cmprgt30hq" (
set PP1=-max_key_interval 300 -max_bframes 2 -bquant_ratio 162 -bquant_offset 0 -vhqmode 1 -lumimasking -qtype 1 -qmatrix apps\eqm_v3ulr_rev3.xcm -nopacked -imin 3 -imax 5 -bmin 3 -bmax 5 -pmin 3 -pmax 5 -quality 5 -nochromame -turbo
set PP2=-max_key_interval 300 -max_bframes 2 -bquant_ratio 162 -bquant_offset 0 -vhqmode 4 -bvhq -qpel -lumimasking -qtype 1 -qmatrix apps\eqm_v3ulr_rev3.xcm -nopacked -imin 3 -imax 5 -bmin 3 -bmax 5 -pmin 3 -pmax 5 -quality 6 -chigh 30 -clow 15 %SIZ%
set P1Q=3
set ZBS=
set NUMPASS=2
)
if /I "%PRESET%"=="cmprgt45ess" (
set PP1=-max_key_interval 300 -max_bframes 1 -bquant_ratio 162 -bquant_offset 0 -vhqmode 1 -qtype 1 -nopacked -imin 3 -imax 4 -bmin 3 -bmax 4 -pmin 3 -pmax 4 -quality 5 -vbvsize 3145728 -vbvmax 4854000 -vbvpeak 8000000 -nochromame -turbo
set PP2=-max_key_interval 300 -max_bframes 1 -bquant_ratio 162 -bquant_offset 0 -vhqmode 2 -bvhq -qtype 1 -nopacked -imin 3 -imax 4 -bmin 3 -bmax 4 -pmin 3 -pmax 4 -quality 6 -vbvsize 3145728 -vbvmax 4854000 -vbvpeak 8000000 -chigh 20 -clow 7 %SIZ%
set P1Q=3
set ZBS=
set NUMPASS=2
)
if /I "%PRESET%"=="cmprgt45mtk" (
rem eqm_v3lr_rev1.xcm
set PP1=-max_key_interval 300 -max_bframes 1 -bquant_ratio 162 -bquant_offset 0 -vhqmode 1 -qtype 1 -qmatrix apps\heini_mr.xcm -nopacked -imin 3 -imax 4 -bmin 3 -bmax 4 -pmin 3 -pmax 4 -quality 5 -vbvsize 3145728 -vbvmax 4854000 -vbvpeak 8000000 -nochromame -turbo
set PP2=-max_key_interval 300 -max_bframes 1 -bquant_ratio 162 -bquant_offset 0 -vhqmode 1 -bvhq -qpel -qtype 1 -qmatrix apps\heini_mr.xcm -nopacked -imin 3 -imax 4 -bmin 3 -bmax 4 -pmin 3 -pmax 4 -quality 6 -vbvsize 3145728 -vbvmax 4854000 -vbvpeak 8000000 -chigh 20 -clow 7 %SIZ%
set P1Q=3
set ZBS=
set NUMPASS=2
)
if /I "%PRESET%"=="cmprgt45fast" (
rem eqm_v3lr_rev1.xcm
set PP1=-max_key_interval 300 -max_bframes 2 -bquant_ratio 162 -bquant_offset 0 -vhqmode 1 -qtype 1 -qmatrix apps\heini_mr.xcm -nopacked -imin 3 -imax 4 -bmin 3 -bmax 4 -pmin 3 -pmax 4 -quality 5 -nochromame -turbo
set PP2=-max_key_interval 300 -max_bframes 2 -bquant_ratio 162 -bquant_offset 0 -vhqmode 1 -bvhq -qpel -qtype 1 -qmatrix apps\heini_mr.xcm -nopacked -imin 3 -imax 4 -bmin 3 -bmax 4 -pmin 3 -pmax 4 -quality 6 -chigh 20 -clow 7 %SIZ%
set P1Q=3
set ZBS=
set NUMPASS=2
)
if /I "%PRESET%"=="cmprgt45hq" (
set PP1=-max_key_interval 300 -max_bframes 2 -bquant_ratio 162 -bquant_offset 0 -vhqmode 1 -qtype 1 -qmatrix apps\eqm_v3hr_rev1.xcm -nopacked -imin 3 -imax 4 -bmin 3 -bmax 5 -pmin 3 -pmax 5 -quality 5 -nochromame -turbo
set PP2=-max_key_interval 300 -max_bframes 2 -bquant_ratio 162 -bquant_offset 0 -vhqmode 4 -bvhq -qpel -qtype 1 -qmatrix apps\eqm_v3hr_rev1.xcm -nopacked -imin 3 -imax 4 -bmin 3 -bmax 5 -pmin 3 -pmax 5 -quality 6 -chigh 20 -clow 7 %SIZ%
set P1Q=3
set ZBS=
set NUMPASS=2
)
if /I "%PRESET%"=="cmprgt58ess" (
set PP1=-max_key_interval 300 -max_bframes 1 -bquant_ratio 162 -bquant_offset 0 -vhqmode 1 -qtype 0 -nopacked -imin 3 -imax 4 -bmin 3 -bmax 5 -pmin 3 -pmax 5 -quality 5 -vbvsize 3145728 -vbvmax 4854000 -vbvpeak 8000000 -nochromame -turbo
set PP2=-max_key_interval 300 -max_bframes 1 -bquant_ratio 162 -bquant_offset 0 -vhqmode 2 -bvhq -qtype 0 -nopacked -imin 3 -imax 4 -bmin 3 -bmax 5 -pmin 3 -pmax 5 -quality 6 -vbvsize 3145728 -vbvmax 4854000 -vbvpeak 8000000 -chigh 15 -clow 5 %SIZ%
set P1Q=3
set ZBS=
set NUMPASS=2
)
if /I "%PRESET%"=="cmprgt58mtk" (
set PP1=-max_key_interval 300 -max_bframes 1 -bquant_ratio 162 -bquant_offset 0 -vhqmode 1 -qtype 1 -qmatrix apps\Didees-SixOfNine.cqm -nopacked -imin 3 -imax 4 -bmin 3 -bmax 5 -pmin 3 -pmax 5 -quality 5 -vbvsize 3145728 -vbvmax 4854000 -vbvpeak 8000000 -nochromame -turbo
set PP2=-max_key_interval 300 -max_bframes 1 -bquant_ratio 162 -bquant_offset 0 -vhqmode 1 -bvhq -qpel -qtype 1 -qmatrix apps\Didees-SixOfNine.cqm -nopacked -imin 3 -imax 4 -bmin 3 -bmax 5 -pmin 3 -pmax 5 -quality 6 -vbvsize 3145728 -vbvmax 4854000 -vbvpeak 8000000 -chigh 15 -clow 5 %SIZ%
set P1Q=3
set ZBS=
set NUMPASS=2
)
if /I "%PRESET%"=="cmprgt58fast" (
set PP1=-max_key_interval 300 -max_bframes 2 -bquant_ratio 162 -bquant_offset 0 -vhqmode 1 -qtype 1 -qmatrix apps\Didees-SixOfNine.cqm -nopacked -imin 3 -imax 4 -bmin 3 -bmax 5 -pmin 3 -pmax 5 -quality 5 -nochromame -turbo
set PP2=-max_key_interval 300 -max_bframes 2 -bquant_ratio 162 -bquant_offset 0 -vhqmode 1 -bvhq -qpel -qtype 1 -qmatrix apps\Didees-SixOfNine.cqm -nopacked -imin 3 -imax 4 -bmin 3 -bmax 5 -pmin 3 -pmax 5 -quality 6 -chigh 15 -clow 5 %SIZ%
set P1Q=3
set ZBS=
set NUMPASS=2
)
if /I "%PRESET%"=="cmprgt58hq" (
set PP1=-max_key_interval 300 -max_bframes 2 -bquant_ratio 162 -bquant_offset 0 -vhqmode 1 -qtype 1 -qmatrix apps\Didees-SixOfNine.cqm -nopacked -imin 3 -imax 4 -bmin 3 -bmax 5 -pmin 3 -pmax 5 -quality 5 -nochromame -turbo
set PP2=-max_key_interval 300 -max_bframes 2 -bquant_ratio 162 -bquant_offset 0 -vhqmode 4 -bvhq -qpel -qtype 1 -qmatrix apps\Didees-SixOfNine.cqm -nopacked -imin 3 -imax 4 -bmin 3 -bmax 5 -pmin 3 -pmax 5 -quality 6 -chigh 10 -clow 3 -ostrength 0 %SIZ%
set P1Q=3
set ZBS=
set NUMPASS=2
)
if /I "%PRESET%"=="cmprgt90ess" (
set PP1=-max_key_interval 300 -max_bframes 1 -bquant_ratio 100 -bquant_offset 1 -vhqmode 1 -qtype 0 -nopacked -imin 2 -imax 3 -bmin 2 -bmax 4 -pmin 2 -pmax 4 -quality 4 -vbvsize 3145728 -vbvmax 4854000 -vbvpeak 8000000 -nochromame -turbo
set PP2=-max_key_interval 300 -max_bframes 1 -bquant_ratio 100 -bquant_offset 1 -vhqmode 2 -bvhq -qtype 0 -nopacked -imin 2 -imax 3 -bmin 2 -bmax 4 -pmin 2 -pmax 4 -quality 6 -vbvsize 3145728 -vbvmax 4854000 -vbvpeak 8000000 -ostrength 0 %SIZ%
set P1Q=3
set ZBS=-3
set NUMPASS=2
)
if /I "%PRESET%"=="cmprgt90mtk" (
set PP1=-max_key_interval 300 -max_bframes 1 -bquant_ratio 100 -bquant_offset 1 -vhqmode 1 -qtype 1 -qmatrix apps\Didees-SixOfNine.cqm -nopacked -imin 2 -imax 3 -bmin 2 -bmax 4 -pmin 2 -pmax 4 -quality 4 -vbvsize 3145728 -vbvmax 4854000 -vbvpeak 8000000 -nochromame -turbo
set PP2=-max_key_interval 300 -max_bframes 1 -bquant_ratio 100 -bquant_offset 1 -vhqmode 1 -bvhq -qpel -qtype 1 -qmatrix apps\Didees-SixOfNine.cqm -nopacked -imin 2 -imax 3 -bmin 2 -bmax 4 -pmin 2 -pmax 4 -quality 6 -vbvsize 3145728 -vbvmax 4854000 -vbvpeak 8000000 -ostrength 0 %SIZ%
set P1Q=3
set ZBS=-3
set NUMPASS=2
)
if /I "%PRESET%"=="cmprgt90fast" (
set PP1=-max_key_interval 300 -max_bframes 1 -bquant_ratio 100 -bquant_offset 1 -vhqmode 1 -qtype 1 -qmatrix apps\Didees-SixOfNine.cqm -nopacked -imin 2 -imax 3 -bmin 2 -bmax 4 -pmin 2 -pmax 4 -quality 4 -nochromame -turbo
set PP2=-max_key_interval 300 -max_bframes 1 -bquant_ratio 100 -bquant_offset 1 -vhqmode 1 -bvhq -qpel -qtype 1 -qmatrix apps\Didees-SixOfNine.cqm -nopacked -imin 2 -imax 3 -bmin 2 -bmax 4 -pmin 2 -pmax 4 -quality 4 -ostrength 0 %SIZ%
set P1Q=3
set ZBS=-3
set NUMPASS=2
)
if /I "%PRESET%"=="cmprgt90hq" (
set PP1=-max_key_interval 300 -max_bframes 1 -bquant_ratio 100 -bquant_offset 1 -vhqmode 1 -qtype 1 -qmatrix apps\Didees-SixOfNine.cqm -nopacked -imin 2 -imax 3 -bmin 2 -bmax 4 -pmin 2 -pmax 4 -quality 4 -nochromame -turbo
set PP2=-max_key_interval 300 -max_bframes 1 -bquant_ratio 100 -bquant_offset 1 -vhqmode 3 -bvhq -qpel -qtype 1 -qmatrix apps\Didees-SixOfNine.cqm -nopacked -imin 2 -imax 3 -bmin 2 -bmax 4 -pmin 2 -pmax 4 -quality 4 -ostrength 0 %SIZ%
set P1Q=3
set ZBS=-3
set NUMPASS=2
)
set ZP1=-zones 0,q,%P1Q%,KO%ZBS%
set ZP2=-zones 0,w,1,KO%ZBS%
if exist %i%.zones.txt for /f %%f in (%i%.zones.txt) do if 0%%f neq 0 (
set ZP1=!ZP1!/%%f,q,%P1Q%,KO%ZBS%
set ZP2=!ZP2!/%%f,w,1,KO%ZBS%
)
rem if
if !NUMPASS! EQU 2 (
echo start "%PRESET% - Pass 1" /b /wait /low apps\xvid_encraw_20060621.exe -i %i% -type 2 -pass1 %i%.stats -progress 100 %PP1% !ZP1!
start "%PRESET% - Pass 1" /b /wait /low apps\xvid_encraw_20060621.exe -i %i% -type 2 -pass1 %i%.stats -progress 100 %PP1% !ZP1!
echo start "%PRESET% - Pass 2" /b /wait /low apps\xvid_encraw_20060621.exe -i %i% -type 2 -avi %i%.avi -pass2 %i%.stats -progress 100 %PP2% !ZP2!
start "%PRESET% - Pass 2" /b /wait /low apps\xvid_encraw_20060621.exe -i %i% -type 2 -avi %i%.avi -pass2 %i%.stats -progress 100 %PP2% !ZP2!
)
rem if
rem OGMuxer is buggy... seeking within the ogm produced requires high cpu load
rem if exist %i%.omx apps\OGMuxer.exe -s %i%.omx
rem if not exist %i%.omx if exist %i%.ogg apps\OGMuxer.exe -o _%i%.ogm %i%.avi "%%g"
rem The last resort is mkv, but i prefer ogm.
rem apps\MKVtoolnix\mkvmerge -o _%i%.mkv --default-track 1 --fourcc 1:XVID -d 1 -A -S %i%.avi -a 0 -D -S %i%.ogg --track-order 0:1,1:0 --chapter-language en --chapter-charset UTF-8 --chapters %i%.chaps.txt
:GEND
Can someone explain how to use this script? Here are the modifications to the script I've made.
set XENPATH=c:\Program Files\MeGUI\tools\xvid_encraw\xvid_encraw.exe
set ENCPATH=c:\Program Files\MeGUI\tools\enc_1_03\bin\enc.exe
set VDEPATH=c:\Program Files\VirtualDubMob\VirtualDubMod.exe
MarkCurly
7th September 2006, 02:54
And you're of course not meant to change the quantizer restrictions of the profiles...
I'm wondering what the quantizer restrictions in the profiles are for?
I (think) understand that they provide bounds on the compression, and are set (using the comptest %'age) to help the preset arrive at the target filesize (or rather, they are set so they don't get in the way of arriving at the target filesize).
BUT why not just let the two-pass encode vary the quantizer over a larger range, and assign the bits to whichever frames it wants?
Contraining the quantizers must surely restrict the codec's ability to put the bits where it needs to better compress the less compressible parts of the source?
Teegedeck
8th September 2006, 15:42
The quantizer restrictions are there because initially I had to witness things like people using presets that are meant for very lenient compression for their 1-CD encodes. Of course the quality was awful and of course they complained. :)
Now, instead of producing lousy quality when misused the presets with restrictions give undersizing if you use a too-low preset and oversizing if you use a too-high preset.
Don't alter restrictions in such a case but just choose a different preset.
The quantizer is not meant to vary much (especially at the low presets each quantization step makes for a huge difference in filesize, so you really don't need much variation), so restrictions really don't get in the way of efficient bitrate distribution.
drcl
9th September 2006, 13:26
I made a table of the xvid preset settings. might be clearer to read
If there are any errors or i missed some change, please tell me and i'll update
Teegedeck
9th September 2006, 21:51
That's a splendid idea; good work! :)
One or two things: Could you please revise the table a little? I think the entry '2nd pass' in the first column has somehow slipped too low - shouldn't it be moved five lines higher?
Also it would be better to use the new naming scheme - I find that one much easier than both old naming schemes ("normal strong compression fast"... :p; 2-3CD-R HQ etc.) and if we use both old and new at the same time things get too confusing for my taste. Talking about confusion, I had good reason to dump the 'number of CD-Rs' naming scheme, could you please delete that line? Thank you.
drcl
10th September 2006, 04:17
maybe you arent using excel or open office?
i laid the table out so that the thicker gridlines, separate the settings for each pass and the common settings. I can change it if you think its more readable.
I noticed I was working off the wrong set of presets anyway, so the table is now updated to the correct ones now.(i think!)
MarkCurly
10th September 2006, 05:59
20060808: Unofficial ESS and MTK presets added.
Have you got the matrix parameter set correctly for the ESS and MTK presets?
AFAIK, H263 is better for lower bitrates and MPEG is somewhat better at higher bitrates, but you seem to be using the opposite.
cmprgt30ess has -qtype 1
cmprgt90ess has -qtype 0
According to this (link) (http://cvs.xvid.org/cvs/chora/co.php/xvidcore/examples/xvid_encraw.c) 0=H263 and 1=MPEG.
Teegedeck
10th September 2006, 08:28
maybe you arent using excel or open office? I've been looking at the html-file because I didn't want to start OpenOffice when I have the browser running already.
iNFO-DVD
10th September 2006, 08:32
but you seem to be using the opposite.
Yes, I noticed that too. Also, if CQM's are used it should be set to 2 anyway.
henryho_hk
11th September 2006, 06:58
Also, if CQM's are used it should be set to 2 anyway.
Thank you for pointing it out. I will correct it asap. As for -qtype 2, may I know where it was mentioned?
iNFO-DVD
11th September 2006, 07:12
Thank you for pointing it out. I will correct it asap. As for -qtype 2, may I know where it was mentioned?
-qtype 1 -qmatrix apps\eqm_v3ulr_rev3.xcm
0=H263 1=MPEG 2=CUSTOM MATRIX
squid_80
11th September 2006, 09:31
0=H263 1=MPEG 2=CUSTOM MATRIX
No. -qtype 0 means h263, -qtype 1 means mpeg. -qmatrix implies -qtype 1 with a custom matrix.
iNFO-DVD
11th September 2006, 09:43
-qtype 1 means mpeg. -qmatrix implies -qtype 1 with a custom matrix.So is that something the encraw checks for then? I was just refering to the 'normal' xvid settings where enabling custom matrix sets qtype to 2, as 1 is the default MPEG and 0 H263.
squid_80
11th September 2006, 09:48
Yes, I figured if the user is specifying a custom matrix it's probably best to assume they actually want to use it.
iNFO-DVD
11th September 2006, 09:52
lol, ok, just thought I'd check. :)
henryho_hk
11th September 2006, 17:38
I have packed the required files (except VirtualdubMod) in a 7z file. Simply extract it to a directory, configure the full path in the BAT file and save the Enc comp. test settings in Enc103\settings (overwrite the original files, required for comp. test only).
The 7z package is hosted in http://rapidshare.de/files/32751257/xvid_encraw_batch_14b.7z.html
Welcome to take a look.
rack04
11th September 2006, 17:59
I have packed the required files (except VirtualdubMod) in a 7z file. Simply extract it to a directory, configure the full path in the BAT file and save the Enc comp. test settings in Enc103\settings (overwrite the original files, required for comp. test only).
The 7z package is hosted in http://rapidshare.de/files/32749478/xvid_encraw_batch_14a.7z.html
Welcome to take a look.
This is what I get when I click on your link:
"This file has been deleted by uploader".
Also, can someone advice on how to set up Enc settings according to the following?
Compressibility check with Enc; SixOfNine CQM, constant quantizer=3, b-frames max=2, ratio=1.62, offset=0, motion search precision=4, VHQ=off, Trellis=on, Turbo=on and no other switches at all.
henryho_hk
12th September 2006, 00:19
Sorry, I have updated the package but I forgot to update the link here (actually, there seems some javascript error when I use the mini-forum-editor). The link is now updated.
For the unofficial ESS/MTK presets, please use max b-frame=1 for compr. test.
henryho_hk
23rd September 2006, 11:37
I have updated the package again. The batch script no longer requires Enc or Virtualdubmod because I implemented the compressbility check using xvid_encraw. Although I tried to stay as close to Enc as possible but batch script is much more limited and very probably I have overlooked out some of jonny's magical codes. Hence, the compressibility test figures are a bit different from Enc. Would you guys pls help me to test it out?
http://rapidshare.de/files/34134723/xvid_encraw_batch_15b.zip.html
BTW, pls don't feed it with AVS of fewer than a thousand frames.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.