Log in

View Full Version : XviD presets thread


Pages : [1] 2 3

Teegedeck
13th December 2006, 22:39
Hello. This thread is here to wrap up the now-confusing first XviD presets thread and to perhaps make it easier to discuss XviD presets - these or others.

Also henryho_hk's great batchfile for almost-automatic encoding with those presets will finally get its deserved own thread, now - here it is: avs2qxvid.bat thread (http://forum.doom9.org/showthread.php?t=119500). Please note that I'm not very active in encoding nowadays, so I won't contribute that much to enhancing the presets - maybe we can try to work up to something like 'community presets' eventually.

The XviD presets are now part of MeGUI (http://x264.nl/), AutoMKV (http://forum.doom9.org/showthread.php?goto=newpost&t=113811), MKVMagic (http://forum.doom9.org/showthread.php?t=101786) and we also have a batch script (http://forum.doom9.org/showthread.php?t=119500) by henryho_hk which makes for semi-automatic encoding. (Note that MeGUI doesn't use the preset's first-pass settings, yet, due to technical limitations - but that isn't so grave for the outcome.) Thanks to everyone who took the trouble of incorporating the presets! I hope everyone who uses the them finds them worthwhile. So:

What are these presets anyway?
The presets represent a collection of settings that should guarantee (within reasonable limits) the best quality for a given filesize in two-pass encoding with XviD at all times; and also a reasonable speed/quality ratio. The underlying concept is that different settings are used for different demands on compression in order to better exploit the versatility of XviD. In that respect these 'XviD presets' are very different from presets or profiles found elsewhere.
Presets are named by a minimum percentage that a comp. check with the application Enc should yield if you want to use that preset; but more about that lateron. These are _quality_ presets, meaning they start with the strongest compression and lowest quality and move up to the weakest compression and highest fidelity to the source (which for me equals 'quality'). Strong compression and high fidelity don't go together well, as a tendency.

The lower the percentage in the preset's name, the stronger the compression it delivers is. So the 'low' presets (30%, 45%) deliver lower quality and stronger compression and the 'high' presets (68%, 90%) deliver higher quality but less compression. You MUST perform a comp. check with Enc OR use henryho_hk batchfile to find out which preset to choose! More about that, again, later.

To give users more choice, there always are a 'fast' and an 'HQ' version of each preset. Mostly the 'fast' presets aren't noticeably worse in quality than their 'HQ' counterparts but they certainly are faster (about double as fast). For the presets that deliver strong compression ('>30%' and '>45%') the quality advantage of the HQ variant is more visible; it gets less and less obvious with the 'higher' presets.

What these presets aren't
These presets aren't meant for ensuring compatibility with standalone players. The use of CQMs, which is the very base of the presets, is not compatible with many standalone players; the same goes for QPel. Having a 'watered-down' version of each preset for each standalone-chipset would also make an already complex topic even more confusing. Thus, if you have a standalone and want to encode to the best quality reachable for that thing, please turn to henryho_hk's great avs2qxvid.bat (http://forum.doom9.org/showthread.php?t=119500) which should provide for your needs. Besides, I think XviD's 'level' settings should really take care of the problem. If they don't they are broken.

How does it work?
If the filesize you aim for is easy to reach presets with high-quality CQMs are used that preserve more detail and thus deliver a higher fidelity to the source. For higher compression on the other hand presets with more effective settings and custom quantization matrices are used. Fidelity might not be reachable this way, but at least a subjectively pleasing result is possible. Still, a big emphasis is on efficiency, i.e. what doesn't give more bang for the buck doesn't get into a preset.

Because the presets try to deliver the best quality for a certain strength of compression all presets will in the effect yield a minimum and a maximum filesize, depending on the video content. This restriction prevents you from using the wrong preset for your purpose. But this can also mean that you get under- or oversizing in the 2nd pass if you chose the wrong preset.

How do I choose the correct preset?
The preset names are based on a compressibility-check with Enc (http://forum.doom9.org/showthread.php?s=&threadid=50714) which should take only 10 minutes or something. Yes, that's the big setback; you have to perform this comp. check BEFORE you encode and choose your preset according to the percentage result Enc gives you. This should give you accurate 2nd-pass filesizes (in most cases...). Everything else would be a shot in the dark.

In detail you need to do this: Start up Enc, select your .avs, choose 'compressibility check' and enter the filesize you're aiming for in kilobytes. Also you better choose the 'extended' method for the test. Then you have to configure XviD. Set it to single-pass, constant quantizer=3. Load the SixOfNine (non-VHS!) CQM and set b-frames to max=2, ratio=1.62, offset=0, ME-precision to 4, VHQ=off, Trellis=on, Turbo=on, no packed bitstream and no other switches at all. (That means, it'll go damn fast...) Then press 'start'. The result Enc gives you will be a percentage figure.

BTW, a general hint for high quality encoding: it's a good idea to try and keep the full resolution of your source if possible. No sense in encoding 320x at the 90%-preset

I've deciced on a preset, now how do I use it?
You can either enter the settings from the presets into XviD's VfW GUI manually; you can use the Batch script byhenryho_hk; you can use the inbuilt XviD presets in MKVMagic or you can use the presets in MeGUI. The most up-to-date version of MeGUI already comes with XviD presets, for older versions you can download the presets here and import them.

I did use a preset according to the outcome of a comp. check but I still got over-/undersizing - what do I do now?
If you get over- or undersizing in spite of doing a comp. check -- sorry, that can happen - the comp. check seems pretty reliable but it's nothing scientific. As I get more feedback on the accuracy of the percentage figues I might tune them a bit. Or not. Hey, that's life. ;)

So, here's what you do:


If you get undersizing use the next 'higher' preset (reflected by a higher percentage in the preset's name).
If you get oversizing, use the next 'lower' preset.
If you get undersizing using the highest preset ('>90%') increase resolution if possible.
If you get oversizing using the lowest preset ('>30%') reduce your resolution.

A note on 1-pass encoding: These presets are meant for two-pass. Of course you can also use the presets for constant-quantizer encoding. BUT if you want to do that use a constant quantizer 3 or 4. As for CBR encoding: just dont. DON'T!

How did these presets get together?
These presets are deduced from a (hopefully) systematic approach in which I tried to set up two categories ('compression' and 'speed'), each holding several levels associated with a set of XviD switches, and combined the levels of those categories into pairings. See this initial post (http://forum.doom9.org/showthread.php?p=791227#post791227) for the detailed approach. The count of theoretical pairings has been reduced to a sensible number by first dropping 'unattractive' candidates and second by performing practical testing. Modifications were made as a result of testing, too, so that some of the actual presets don't closely resemble the initial theoretical categories anymore. But they are certainly better now than they were in the beginning.

What exactly are the settings for the presets?
Now, this is important for you if you want to set up the presets manually in XviD's VfW GUI.

We have seven basic presets, plus 2 'special purpose' presets. Nine in total. Note that the 'special purpose' presets aren't in the MeGUI profiles, yet.

First pass settings:
Same CQM as in second pass; same number of max consecutive b-frames, b-frame ratio and b-frame offset as in second pass; AQ if used in second pass; Trellis; ME precision=5, (except for the 'DVD-R perfect' preset, where it should be '4'); VHQ=1; Turbo. A zone with constant quantizer as specified in the preset-settings.
And that's it; no QPel, no GMC, no VHQ for-b-frames, no chroma ME.

Second pass settings:


XviD '>30% comp. check' (fast): MSP=6, VHQ=1, VHQ for b-frames, AQ, EQM v3 ULRv3, curve-compr. H30, L15, quantizer-restrictions min. 3, max. 5
XviD '>30% comp. check' (HQ): MSP=6, VHQ=4, VHQ for b-frames, QPel, AQ, EQM v3 ULRv3, curve-compr. H30, L15, quantizer-restrictions min. 3, max. 5
XviD '>45% comp. check' (fast): MSP=6, VHQ=1, VHQ for b-frames, QPel, EQM v3 LR, curve-compr. H20, L7, quantizer-restrictions min. 3, max. 4
XviD '>45% comp. check' (HQ): MSP=6, VHQ=4, VHQ for b-frames, QPel, EQM v3 HR, curve-compr. H20, L7, quantizer-restrictions min. 3, max. 5 (4 for I-frames)
XviD '>58% comp. check' (fast): MSP=6, VHQ=1, VHQ for b-frames, Qpel, SixOfNine, curve-compr. H15, L5, quantizer-restrictions min. 3, max. 5 (4 for I-frames)
XviD '>58% comp. check' (HQ): MSP=6, VHQ=4, VHQ for b-frames, Qpel, SixOfNine, curve-compr. H10, L3, quantizer-restrictions min. 3, max. 5 (4 for I-frames), Overflow Control Strength=0
XviD '>90% comp. check' (fast): MSP=4, VHQ=1, VHQ for b-frames, b-frames 1/1.00/1.00, QPel, b-frame sensitivity=-3, SixOfNine, no curve-compression, quantizer-restrictions min. 2, max. 4 (3 for I-frames), Overflow Control Strength=0
XviD '>90% comp. check' (HQ): MSP=4, VHQ=3, VHQ for b-frames, b-frames 1/1.00/1.00, QPel, b-frame sensitivity=-3, SixOfNine, no curve-compression, quantizer-restrictions min. 2, max. 4 (3 for I-frames), Overflow Control Strength=0

Special purpose presets_

for editing only: 1-pass only: ME6, VHQ=1, no b-frames, chroma ME, EQM EHR, constant quantizer = 2
Anime/CG/Cartoon preset: cartoon mode(!), b-frames ratio 1.0, offset=1, ME6, VHQ=1, VHQ for b-frames, chroma ME, H.263, 1st pass @q=2, quantizer-restrictions min. 2 max. 6


Settings that are always active if not specified otherwise: ME precision=6, chroma ME, Trellis, chroma opt., b-frames: max. 2 consecutive, ratio 1.62, offset 0, ME precision = 5 for first pass.
Note: 1st pass @ quant=xy means that you have to set that quantizer as a zone in the first pass and have to change it back to weight=1 for the second pass.


Lastly, why should I care about XviD (ASP) presets when there are more modern (AVC) codecs?

Strange as it sounds, there are some things ASP codecs still do better than AVC codecs IMHO; at low compression they simply deliver higher fidelity with many DVD source than AVC codecs; or so my eyes tell me. Roughly I would say that AVC certainly looks better than XviD with the '>30%' presets. But still you may want to use XviD for some reason? (If there ever is an XviD binary that can produce both ASP and AVC output, the >30% preset should definitely be changed to utilize AVC). AVC can look better than XviD with the '>45' preset. Not in every case, I would say, so XviD might still be worthwhile here. But I would say that from the '>58%' preset upwards high fidelity is more easily reached with XviD. So for me personally XviD presets are valuable because I want to make 'transparent' backups (=backups that can't be told from the original). You might or might not find a reason to use these presets - if you do: have a lot of fun!

Edited: In comp.-check use 'extended' method and no packed bitstream in XviD.

G_M_C
16th December 2006, 11:24
Thx mate for the update :)

I've got one question thought;

Does the "Weight" parameter in the Zone Options work, or not ? Because some sites mention is does, and other sites mention it doesn't. I've not seen anything about it in recent changelogs, so i concluded it's working. But am i right about that ?

professor_desty_nova
16th December 2006, 12:55
Yes, it works. I use it all the time :)

Terranigma
16th December 2006, 20:41
I have a question. Do the latter xvid versions allows for 3 b-frames? It seem it doesn't matter what I do, When I select 3 b-frames, it comes out only using 2. I've tried even without any presets (I chosed the default settings, and changed the no. of b-frames to 3, yet it still shows me only using 2).

What gives? :o

weaver4
17th December 2006, 04:34
Where can I get a copy of these xvid presets? I could not seem to find a link.

Edit--I think I found them, but there are so many versions in the old thread I am not sure.

foxyshadis
17th December 2006, 06:54
What do you mean, "where"? Those are the presets, listed as second pass settings. You'll have to be more specific if you're looking for a particular implementation of them.

Teegedeck
17th December 2006, 09:42
I have a question. Do the latter xvid versions allows for 3 b-frames? It seem it doesn't matter what I do, When I select 3 b-frames, it comes out only using 2. I've tried even without any presets (I chosed the default settings, and changed the no. of b-frames to 3, yet it still shows me only using 2).
XviD's b-frames are adaptive; i.e. what you specify is the maximum allowed number of consecutive b-frames. XviD decides whether it is more efficient to use 3, 2, 1 or no b-frames at all on its own.

@weaver4: THIS is the only valid presets thread now.

Terranigma
17th December 2006, 16:58
XviD's b-frames are adaptive; i.e. what you specify is the maximum allowed number of consecutive b-frames. XviD decides whether it is more efficient to use 3, 2, 1 or no b-frames at all on its own.

Thanks Teegedeck For The Reply. I thought I was going crazy here :p

Adub
19th December 2006, 05:33
Can we update the presets to be compatible with the latest MeGUI please? Obviously I mean the MeGUI branch of the presets, just to be clear.

Teegedeck
19th December 2006, 10:38
Ummm; what exactly do you mean with 'compatible'?

henryho_hk
19th December 2006, 11:41
The corresponding preset names in avs2qxvid.bat are:

'>30% Comp. Check' (Fast): TGFAST-30
'>30% Comp. Check' (HQ): TGHQ-30
'>45% Comp. Check' (Fast): TGFAST-45
'>45% Comp. Check' (HQ): TGHQ-45
'>58% Comp. Check' (Fast): TGFAST-58
'>58% Comp. Check' (HQ): TGHQ-58
'>90% Comp. Check' (Fast): TGFAST-90
'>90% Comp. Check' (HQ): TGHQ-90
'Editing': TGEDIT-00
'Anime/Cartoon': TGANIME-00

'Auto. Comp. Check' (Fast): TGFAST-CT
'Auto. Comp. Check' (HQ): TGHQ-CT

Adub
19th December 2006, 23:28
Well with the new Megui, 2.4.1009, berrinam says that the current profiles, like the ones contained in the zip, are not compatible. I was wondering if there were any compatible versions. The settings should be compatible it is just that XML format I think.

Terranigma
20th December 2006, 01:04
Teegedeck, you think you could come up with some presets using 3 b-frames? That'd be awesome imo. :D

Dams
21st December 2006, 00:40
@Teegedeck : for enc test, shoud I leave as default for Xvid preset (like quant for I/P/B Frame begin at 1, end at 31) , and set with your setting ?

henryho_hk
21st December 2006, 02:24
Please refer to the second paragraph of the section "How do I choose the correct preset?". If you are talking about quant. limits, it's irrelevant for comp. test because we will be using constant quant. 3. (Advertisement starts) You can also try my batch script for automatic comp. test plus preset selection. (Advertisement ends)

berrinam
21st December 2006, 03:54
Well with the new Megui, 2.4.1009, berrinam says that the current profiles, like the ones contained in the zip, are not compatible. I was wondering if there were any compatible versions. The settings should be compatible it is just that XML format I think.

I'll look into the MeGUI profiles. As it is, installing them from the zip file on autoupdate won't work, and it failed previously because of a bug with the quantizer matrices.

Adub
21st December 2006, 05:34
Thanks berrinam! I await your work with speechless anticipation.

Dams
21st December 2006, 08:17
Please refer to the second paragraph of the section "How do I choose the correct preset?". If you are talking about quant. limits, it's irrelevant for comp. test because we will be using constant quant. 3. (Advertisement starts) You can also try my batch script for automatic comp. test plus preset selection. (Advertisement ends)

Oh, my poor brain :o

Thxs!

Tima
22nd December 2006, 13:07
Where can I download the last versions of quant matrices, that are used within these presets? I don't have any of them, and for this reason MeGUI refuses to start an encoding..

Sh4nn0w
22nd December 2006, 17:34
Where can I download the last versions of quant matrices, that are used within these presets? I don't have any of them, and for this reason MeGUI refuses to start an encoding..

Xvid / ASP ones are in here: http://megui.org/auto/xvid_profiles-00.zip

Not sure about AVC as I don't really use it.

Dams
22nd December 2006, 18:57
Sh4nn0w : You're welcome;)

weaver4
22nd December 2006, 20:50
I am not really trying to squeeze a movie into a specific size. I just want a good recording. Do I need to do the compressibility or can I just select the profile and say go. What profile should I use? I am using MeGui?

Teegedeck
22nd December 2006, 22:32
I am not really trying to squeeze a movie into a specific size. I just want a good recording. Do I need to do the compressibility or can I just select the profile and say go. What profile should I use? I am using MeGui?Encode at constant quantizer=3 and use the 90% HQ preset if size doesn't matter. Beware that the result might come out almost as big as the DVD with most movies...

spanky123
24th December 2006, 15:26
Thanks for this Teegedec. Had nfi what the comp test stuff meant in the profile names until now.

Will try these soon - using MeGUI

BTW. There's nothing wrong with using Gordian Knot to make the avs and do the comp check is there ?

wayneo
8th January 2007, 02:07
What if the compression check ends up reporting a percentage at 30% or lower? I'm converting a tv show that was recorded in 720p and converting it to around around about 380MB file and the percentage I get back is 16.85%.

henryho_hk
8th January 2007, 06:28
There is no preset for CT<30%. Actually, Teegedeck has stated that AVC (e.g. H.264) should be considered for CT<45% materials. Hence, you should consider to:

1) apply stronger denoisers and (hopefully) double the compressibility
2) resize to lower resolutions
3) increase the target size, and/or,
4) try other codecs

Teegedeck
8th January 2007, 10:24
@spanky123: Sorry I've missed your post. Nothing wrong with using GKnot for creating the avs; but the comp-check that GKnot performs is totally different in nature from what Enc does; just use Enc for that.

spanky123
8th January 2007, 12:17
Thanks

But I haven't been using the XviD in Megui, coz I get these errors. I know I'm missing some necessary files:

When I select 30%, I get:Error opening input file extra\eqm_v3ulr_rev3.xcm
When I select 45% I get: Error opening input file extra\eqm_v3lr.xcm
When I select 68% I get: Error opening input file extra\Didees SixOfNine.cqm

Where do I get these files ? And what do I do with them ?
Are they not supposed to download automatically when MeGUi is updated ?
Also, what are these files (.cqm and .xqm) for ? I think I heard somewhere that they've got to do with the Quantizer Matrices or something.

I remember before all the download servers and all that changed with Megui, everything was fine and was automatically downloaded. Since I uninstalled Megui completely and reinstalled the new one and updated everything I have not been able to encode with XviD.

The XviD profiles seem to download fine. They are in the /profiles folder.

If someone could answer all/most my questions and help me fix this problem that'd be good, cos I'm getting over Gordian Knot and was very impressed with Megui's XviD encoding and the XviD profiles. Thanks T

Thanks

Brother John
8th January 2007, 14:15
but the comp-check that GKnot performs is totally different in nature from what Enc does
Do you just mean different settings or a whole different methodolgy?

Shouldn't matter anyway, because if you setup GK's compcheck like explained in the first post, percentages are almost the same. At least that was the case for the 2-3 sources where I did checks with both programs.

spanky123
10th January 2007, 11:06
Can anyone help me please ?
http://forum.doom9.org/showpost.php?p=929188&postcount=28

kurt
10th January 2007, 11:31
http://mewiki.project357.com/wiki/MeGUI_FAQ#Encoding_with_xvid_doesn.27t_work

spanky123
10th January 2007, 14:33
http://mewiki.project357.com/wiki/MeGUI_FAQ#Encoding_with_xvid_doesn.27t_work

Thanks bud

Yoshiyuki Blade
11th January 2007, 11:38
Hey. I've noticed that the non-HVS SixofNine cqm should be used for the comp check. Does that also mean that the non-HVS is used in the presets as well?

henryho_hk
11th January 2007, 13:13
Yeah, non-HVS 6of9 should be used in the presets.

Teegedeck
11th January 2007, 16:32
Do you just mean different settings or a whole different methodolgy?

Shouldn't matter anyway, because if you setup GK's compcheck like explained in the first post, percentages are almost the same. At least that was the case for the 2-3 sources where I did checks with both programs.Sorry for my being busy with other things. AFAIR the comp-check Enc performs is more complex and accurate than GKnots. Happy to hear it's exact enough.

Brother John
24th January 2007, 17:21
It's quite easy to miss a detail or two from the compact preset descriptions in the first post. So I made a couple of text files with tree views of the presets' settings (see attachment). They might be useful if you configure your Xvid manually.

Teegedeck, if you have the time it'd be great if you could have a look at the files, if there are any mistakes.

HeadBangeR77
25th January 2007, 00:57
@ Brother John
Thanks a lot, I do almost everything manually, so it might be useful for me.

@ Teegedeck
I've been planing to revive the discussion about presets for quite a long time, but I always had sth else to do ;) If I find more time, and I already know what I would like to speak about, I will write a few suggestions, based on my own experience.

Just a few (Brother John: Hast du Ahnung, wie Stichwörter auf Englisch heißen?) ... sort of key problems:

1) Curve Compression - I find it very useful in case of high quality (80% comp. check and above) encodes too, especially in dark, low-middle motion scenes. I've found some threads on CC, but some questions still remain unanswered (e.g. dependencies between high- and low bitrates CC).

2) 1st pass at quantizer 3 : sometimes, I'll repeat, sometimes I get better visual results (SSIM and the ultimate metric - my own eyes ;)) after having done the 1st pass at Q2. This happens mostly then, when I'm near a threshold of one preset to another, and decide to use the lower one (1st and 2nd pass bitrates don't differ very much).

3) Some alternative matrices that have been mentioned in the original (source) thread should be IMHO at least listed as alternatives, because not everyone uses your presets as they are (e.g. I ;)), and not everyone is into CQMs. Heini's MR (modified Sharktooth's V3 HR) could be a good replacement for V3 HR, for instance.

4) Very, very slight denoising (I used to be an opponent of this not a long time ago), like RemoveGrain(mode=1) or fft3dgpu(sigma=0.5,plane=4), could be recommended for most sources.

Just my noob ideas ;)

Regards,
HDBR77

PS. I must have lost my head! Thank you for all your efforts & time put into the presets! :)

Teegedeck
25th January 2007, 12:30
Teegedeck, if you have the time it'd be great if you could have a look at the files, if there are any mistakes.Hey, thanks for those detailed settings; I could only find minor errors: for the 45% HQ preset the max. quantizer is 5, except for i-frames where it is 4. As with the other presets' first passes, chroma motion should also be deactivated for the 30% fast preset's first pass. I think whether chroma optimizer is activated during first pass or not doesn't really matter. :)

@HeadBangeR77: Curve compression is a mixed blessing IMHO when it comes to compensating for dark scenes. I'm hoping for a real cure by Kopernikus' HVS tunings for XviD. Yes, first pass quant. should be as close to 2nd. pass average quant. as possible. Only for sake of simplification/practical reasons it is always '3' in the presets. As for matrices, I think everyone who knows what these beasts are should be able to find them him/herself; everone who doesn't should not be lead to meddle with these things... As for denoising, I would say 'no'. I think the presets should aim at reproducing a source as accurately as possible; whether that source should be denoised is up to every individual's taste. (Again and again I try very mild denoising but, personally, I never like the results.)

Brother John
25th January 2007, 15:49
Hast du Ahnung, wie Stichwörter auf Englisch heißen?
Stichwort = keyword, at least in a dictionary sense. In your post it's more along the lines of ideas, issues,... But don't worry about it. Teegedeck speaks German as well. :)

I could only find minor errors
Corrected and archive updated.

Sharro
27th January 2007, 11:50
HR may have standalone compatibility issues.
To fix them just replace all "15"s with "16"s in the inter-matrix.

As any of you ever seen any post about this ?

Couldn't it be a problem for your presets ?

EDIT: Just tried a 2 pass encode with didee's 6of9 to test in my standalones together with Heini's (with inter-matrix 15's replaced by 16's), results:

Philips DVP720SA/02
===Heini's Intermatrix Min 16 -> perfect play
===Didee's SixOfNive hvs -> artifacts on video (blocks)

Philips DVP5960/12
===Heini's Intermatrix Min 16 -> perfect play
===Didee's SixOfNive hvs -> perfect play

Video was 704x288 pixels Xvid 2BF, QP, PB, Chroma Optimizer, Trellis with 1593Kbps set for the second pass

So for the time being I'll have to stick with Heini's IM Min 16. I'll also try it on a Yamada 6700 plus and revert.

END EDIT

I have to agree with HeadBanger, the Heini cqm is definetly a replacement for HR but for Standalone reasons I've modified it as per Sharktooth's recommendations, I did at least 3 movies with the 3 different cqm's (Hvs-Best, HRV3, Heini's) and Heini's always one even if with a 13.5 to 16% difference in the first pass size to Hvs-Best.

Just my 5 cents!

All the best,

Sharro

LordIntruder
1st February 2007, 00:34
Hi,


1) I would like to know what can be the drawbacks of settings Max i p b-frame Quantizer so low (4 or 5)? I can't find any info on that, I get thousands of messages by searching 'max i-frame'

I encoded a whole movie both with default XviD settings (1-31) and the same with 30% preset sett:readrule: ings (3-5), Bitrate is 1400 aim at 2 CD.

I can't see any difference except on fast motion where I get a better result but I think it is due to the 'high bitrate scene degradation' setting that improve and give more bit.

Why force a so low i p b-frame quantizer then? Maybe the differences appear very clearly on low bitrate (1400 is already quite a good one)? I spend one hour to examine and compare both encodes and when I get a bad encoded sequence by using default settings (1-31 quantizer), the 30% preset encode looks same. I would like the opinion of those who made comparaisons, thanks.

Another thing: I use DRF Analyser, is that a good tool or is it something better to know how much frames use x quantizer?

2) By using DRF Analyser I get this:

Xvid Default Setting:
-------------------

DRF=1&2: 246 0.1%
DRF=3: 1570 0.9%
DRF=4: 19112 10.5%
DRF=5: 46989 25.7%
DRF=6: 15760 8.6%
DRF=7: 46021 25.2%
DRF=8: 38816 21.2%
DRF=9: 11393 6.2%
DRF>9: 2822 1.5%
KeyF/DeltaF: 0.66%
KeyDRF<4: 23
KeyDRF=4: 589
KeyDRF>4: 599

AverageKeyDRF: 4.78
MAXDRF: 22
AverageDRF: 6.44
Deviation: 1.61


30% preset settings:
-------------------

DRF=1&2: 0 0.0%
DRF=3: 2437 1.3%
DRF=4: 8570 4.7%
DRF=5: 60375 33.0%
DRF=6: 8713 4.8%
DRF=7: 31242 17.1%
DRF=8: 71392 39.1%
DRF=9: 0 0.0%
DRF>9: 0 0.0%
KeyF/DeltaF: 0.66%
KeyDRF<4: 18
KeyDRF=4: 894
KeyDRF>4: 299

AverageKeyDRF: 4.43
MAXDRF: 8
AverageDRF: 6.48
Deviation: 1.47


What I do not understand is that the 30% preset use Quantizer between 3 and 5 but my encode have quantizer 6, 7 and 8 used. Can someone explain me that?

3) I noticed ine MEGUI the 'I-frame boost' is set to '100' with those preset. Is it a bug or a correct setting? I think the correct value is '10' is it not?

Thanks you. :)

Sharro
1st February 2007, 01:02
Hi,

Those percentages and number won't give you the "whole" picture.

Without the correct info about i,p and b frames it'll probably mislead you.

For me still the best source for quant distribution and averages is the xvid status window.

Looking at the numbers I would say that you're getting i-frames 3-5 and b-frames 5 to 7 but that's only a guess.

Just my 5 cents.

All the best,

Sharro

HeadBangeR77
1st February 2007, 05:11
1) I would like to know what can be the drawbacks of settings Max i p b-frame Quantizer so low (4 or 5)? I can't find any info on that, I get thousands of messages by searching 'max i-frame'
Hello ;)
There are no drawbacks, apart from one, which I will name soon. Those values are set so tight (I personally loosen those settings usually, but not too much) to ensure you stick to the recommended profile (sounds crazy, I know, so let me explain):
While basing on the compressibility check, you could predict with more or less accuracy what preset to choose, nothing will ensure the final proper result/encode. It may happen, that you will get either undersized or oversized files:

1) Oversized encodes - it indicates you should either choose the preset one step lower or resize (downsize). It's always better imo to encode a smaller frame properly (lower resolution) than a bigger one with artifacts. It's always better to get a bit softer image by using a more compressable quantization matrice, than get artifacts with a stronger one, which coudl theoreticaly keep more details, but not within the filesize limits you've chosen.

2) Undersized encodes - it indicates you should try with a higher preset or higher resolution, if you want to. All the above applies here as well, but the other way round. :D

Without such narrow quantizers' settings you would usually get the proper filesize, which doesn't mean your encode would be ok. So, generally, thanks to those tight settings you can get sort of hints what to improve, if your final filesize doesn't meet the target one. Now you see the drawback: if comp. check was wrong, you should actually encode once again to improve quality (becasue it is possible), and the whole game starts again.

Another thing: more even, with less differences, quantizer distribution gives you imo a better overall impression, because the quality is equal throughout the film/clip. There are no jumps in visual quality, and I have seen many in my life (some scenes look really well, and then suddenly appear blocks by fast motion) - most probably because of not limiting the quantizers.

Ufff, everything I've written here so far had already been written earlier at least twice in the working thread. I know it's long, but it's worth reading, so that you can understand the idea better. And if you undestand the idea better, then you can start to experiment with presets on your own. :)

Hope that's clear (it's already 5 A.M. :eek:).

I can't see any difference except on fast motion where I get a better result...
As I said, presets are there to ensure you don't get any artifacts , especially on high motion.

but I think it is due to the 'high bitrate scene degradation' setting that improve and give more bit.
Degradation means exactly what it means - "de-gra-da-tion" (comes from latin), making worse, taking some bits from high bitrate scenes. It's most probably because of better quantizer distribution or a softer matrice, so I assume.

Why force a so low i p b-frame quantizer then? Maybe the differences appear very clearly on low bitrate (1400 is already quite a good one)?
The lower the quant the better. The rest as explained above.
1400 kbps for e.g. 1024x432 1:2.35 widescreen upsize is a poor bitrate. For an anomorphic encode it is a medicore one. For a downsized encode it should be a good one, unless your source is 4:3 29.970 fps NTSC, then it's nothing special (but I'm a quality freak :D). And, as usual, everything depends on the source, how it compresses - hence the need for compresibility check.

I have no strength to try to answer the rest of your questions :p , but ...

What I do not understand is that the 30% preset use Quantizer between 3 and 5 but my encode have quantizer 6, 7 and 8 used. Can someone explain me that?
Plz search ... It's because of b-frames, as Sharro wrote. The upper limit (5) is before multiplying by b-frame ratio and adding the offset afterwards. Gee, you don't have to read any guides to know this (I haven't) - there are tooltips when you move your mouse near each codec's setting, providing you have set sth manually at least once.

3) I noticed ine MEGUI the 'I-frame boost' is set to '100' with those preset. Is it a bug or a correct setting? I think the correct value is '10' is it not?
10-20%, I-frames are already of much larger size than the rest of frames, so there's no need to boost their quality so much. I don't use megui, but I think tis might be a bug.


Thanks you. :)
You're welcome, now I can go sleep finally (when I start sth I usually try to finish it, no matter what ;)) /good nite

@ Sharro
I'm gonna PM you on some matters, which I don't want to discuss in public ;) :devil:

@ Tegedeeck
I'll post a few ideas about CC soon. ;) Btw. are your presets closed & stiff (e.g. for using with megui) or is the discussion still open? 'cause I don't know if should post sth on the matter, since nobody seems to be interested in any further potential developement (x264, ehhh ;)). Cheers.

Teegedeck
1st February 2007, 16:16
Hope that's clear (it's already 5 A.M. :eek:).Quite a good effort for that time of night. ;)

10-20%, I-frames are already of much larger size than the rest of frames, so there's no need to boost their quality so much. I don't use megui, but I think tis might be a bug.Indeed, I'm gonna check.

I'll post a few ideas about CC soon. ;) Btw. are your presets closed & stiff (e.g. for using with megui) or is the discussion still open? 'cause I don't know if should post sth on the matter, since nobody seems to be interested in any further potential developement (x264, ehhh ;)). Cheers. You're welcome to try and revive some discussion here - nothing's set in stone. What meets general approval should be adpted in the presets.

LordIntruder
2nd February 2007, 02:18
Ufff, everything I've written here so far had already been written earlier at least twice in the working thread. I know it's long, but it's worth reading, so that you can understand the idea better. And if you undestand the idea better, then you can start to experiment with presets on your own. :)

Hope that's clear (it's already 5 A.M. :eek:).


In the working thread? You mean this one? Because I read it entirely but didn't find answers to my questions so I asked ;)

However thanks to you now I better understand the whole thing behind the idea of reducing quantizer. It may be obvious some of you but in the past I never analyzed the quantizer distribution of my encoded stuff, I had no need for that, now I started to do it, it becames clear setting limits is an improvement on the final encode.



Degradation means exactly what it means - "de-gra-da-tion" (comes from latin), making worse, taking some bits from high bitrate scenes. It's most probably because of better quantizer distribution or a softer matrice, so I assume.


You noticed it at 05h00 AM and not me at 00h30AM LOL ;)

Don't know why, I had "degradation" in front of me eyes and was thinking about the opposite. Well, I will try to analyse this with my psy tomorrow :D . Now I see the whole idea, I agree with you, it must be a better quantizer distribution and that show how powerful the concept is, you take bits from high motion and at the end it is even better than with the default XviD settings encode that takes no bit.



You're welcome, now I can go sleep finally (when I start sth I usually try to finish it, no matter what ;)) /good nite


hehe, again thanks you.

:)

HeadBangeR77
2nd February 2007, 02:45
In the working thread? You mean this one? Because I read it entirely but didn't find answers to my questions so I asked ;)
There's not much useful here, I must admit, apart from the actual presets. I meant the working thread here:
http://forum.doom9.org/showthread.php?t=107897

(I should have written: "use search!", "read the guides" :D :D ;))

However thanks to you now I better understand the whole thing behind the idea of reducing quantizer. It may be obvious some of you but in the past I never analyzed the quantizer distribution of my encoded stuff, I had no need for that, now I started to do it, it becames clear setting limits is an improvement on the final encode.
I'm glad I could help and express myself rather clearly so late at night. ;) The whole idea lies in even distribution, as already said, e.g. you get 2-3-4, 2-3-2-3, 2-3-4 in some parts and sometimes higher (means worse) values in others, but there are no jumps. After I have finally installed ffdshow I usually check qunatizers, while analyzing my encodes.

You noticed it at 05h00 AM and not me at 00h30AM LOL ;)
Maybe because of CBU* throttling at that time. ;)

cheers.

@ Teegedeck - I hope I will post sth constructive within the next few days.

* stands for Central Brain Unit :D

Sharro
2nd February 2007, 08:15
Hi guys,

A few years ago, when Xvid hasn't reached the 1.0 version I've learned from the developpers that I should let "Xvid do it's magic" :).

Meaning? Not capping the upper limit of quantizers, why ?

Because some scenes will look good with a higher quant and some won't look good with a 4 or even 3, if Xvid is capping the higher quants there might just not be space left for the lower quants and xvid is very smart at assigning bitrate where needed.

Let me put it this way, in a capped quant situation of lets say max 4 (I-frames), you won't get anything above 4 but also you will get much more q3 than q2 if you didn't cap (numbers...numbers) where you would probably get q5 and q6 but much more q2, visually on the scenes where you get q5 and q6 you would hardly notice any difference to q4, but with the lower quants the situation would probably be different.

Just my beggining of the day 5 cents.

All the best,

Sharro

Teegedeck
2nd February 2007, 11:08
Sharro, I know. I used to give that advice myself. The 'magic' you mention is curve-compression.

It was mostly directed at the problem that people capped quants regardless of compressibility. The result of people capping quants back then were often under-/oversizing problems. And there's no reason to cap the minimum quant to 4 with a very compressible file; there is no reason to cap the maximum quant to 4 with a badly compressible file. It only throws curve-compression off-balance. That's what happened then.

Also 'back then' more positive impact was generally attributed to curve-compression than now. The use-case 'back then' was mostly 'fixed resolution, fixed filesize, fixed XviD settings' (H.263, VHQ=1, MSP=5 or something). In the presets we do things by changing the CQM, or by changing VHQ-levels instead of simply raising quantizers. And quantizer-restrictions have become a way to enforce the use of the correct preset instead of a 'magic-cure-for- reaching-good-quality even-if-one-doesn't-know-a-thing-about-XviD-settings-otherwise' ;). Curve-compression takes place like it should within the boundaries of the presets. But the quantizer, and with it curve compression, is no longer the most important factor of quality.

Now we know that curve-compression is mostly valuable when strong compression is asked for; but for highest quality we want as little quantizer fluctuation as possible. BUT: this is only attainable at very lenient compression. If you now wonder why the higher-quality presets don't have much narrower quant-restrictions than the 30%-presets, the answer is that the high-quality CQMs make for a more lenient curve compression all by themselves - the difference in size between the SixOfNine CQM at quant=3 and quant=4 is nowhere as big as the difference between the ULRv3 CQM at quant=3 and quant=4.

HeadBangeR77
2nd February 2007, 16:53
@ Sharro, I must agree with Teegedeck. I didn't particapte much in those days, but most of people seemed to encode either with H.263 or MPEG, that you've described as a quality solution in those early days (I mean the PM from you). HVS Best you've been using for so long is also just a bit less compressable than MPEG. So limiting quantizers so tightly, as it is done in the presets now, didn't make much sense back then. Now every preset has a carefully chosen CQM, so it does make sense imho. :)

@ Teegedeck: I wrote sth about pre-filtering with a denosing filter once... Now I'm into "grain-retention", if you would like to have a look. ;)

http://forum.doom9.org/showthread.php?p=947775#post947775

cheers,
HDBR77

PS. I still have nothing against the default MPEG matrice - has its uses still, even for me (and I'm a quality freak :D).

Teegedeck
2nd February 2007, 22:03
Interestingly enough, I haven't found a satisfying way to encode grainy TV-series at strong compression and acceptable speed with x.264; the result always was that I would either have had to encode at insanely low encoding speed in order to gain an advantage over XviD, or to resort to using strong deblocking in x.264. That way the outcome didn't look at all like the input but very unnaturally smooth, as you probably can imagine. So in spite of x.264 being the 'natural' choice for medium-quality, strongly compressing encoding, I ended up encoding '"24", season 2, with XviD and the '30% HQ'-preset. And it certainly looked surprisingly good without resizing at quantizer=4 and ~250 MBs per episode (video only). Not transparent but certainly closer to the original. (Note that I switched off AQ because at constant quantizer it really doesn't make any sense.)