Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 ASP

Reply
 
Thread Tools Search this Thread Display Modes
Old 13th December 2006, 22:39   #1  |  Link
Teegedeck
Moderator, Ex(viD)-Mascot
 
Teegedeck's Avatar
 
Join Date: Oct 2001
Posts: 2,564
XviD presets thread

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. 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, AutoMKV, MKVMagic and we also have a batch script 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 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 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 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.
__________________
It's a man's life in Doom9's 52nd MPEG division.
"The cat sat on the mat."
ATM I'm thoroughly enjoying the Banshee - a fantastic music player/ripper for Linux. Give it a whirl!

Last edited by Teegedeck; 8th February 2007 at 22:45.
Teegedeck is offline   Reply With Quote
Old 16th December 2006, 11:24   #2  |  Link
G_M_C
Registered User
 
Join Date: Feb 2006
Posts: 1,076
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 ?
G_M_C is offline   Reply With Quote
Old 16th December 2006, 12:55   #3  |  Link
professor_desty_nova
Registered User
 
professor_desty_nova's Avatar
 
Join Date: Nov 2006
Posts: 54
Yes, it works. I use it all the time
professor_desty_nova is offline   Reply With Quote
Old 16th December 2006, 20:41   #4  |  Link
Terranigma
*Space Reserved*
 
Terranigma's Avatar
 
Join Date: May 2006
Posts: 953
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?
Terranigma is offline   Reply With Quote
Old 17th December 2006, 04:34   #5  |  Link
weaver4
Registered User
 
Join Date: Jun 2005
Posts: 925
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.

Last edited by weaver4; 17th December 2006 at 05:37.
weaver4 is offline   Reply With Quote
Old 17th December 2006, 06:54   #6  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,174
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.
__________________
There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order. ~ Ed Howdershelt
foxyshadis is offline   Reply With Quote
Old 17th December 2006, 09:42   #7  |  Link
Teegedeck
Moderator, Ex(viD)-Mascot
 
Teegedeck's Avatar
 
Join Date: Oct 2001
Posts: 2,564
Quote:
Originally Posted by Terranigma View Post
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.
__________________
It's a man's life in Doom9's 52nd MPEG division.
"The cat sat on the mat."
ATM I'm thoroughly enjoying the Banshee - a fantastic music player/ripper for Linux. Give it a whirl!
Teegedeck is offline   Reply With Quote
Old 17th December 2006, 16:58   #8  |  Link
Terranigma
*Space Reserved*
 
Terranigma's Avatar
 
Join Date: May 2006
Posts: 953
Quote:
Originally Posted by Teegedeck View Post
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
Terranigma is offline   Reply With Quote
Old 19th December 2006, 05:33   #9  |  Link
Adub
Fighting spam with a fish
 
Adub's Avatar
 
Join Date: Sep 2005
Posts: 2,685
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.
__________________
FAQs:Bond's AVC/H.264 FAQ
Site:Adubvideo
Adub is offline   Reply With Quote
Old 19th December 2006, 10:38   #10  |  Link
Teegedeck
Moderator, Ex(viD)-Mascot
 
Teegedeck's Avatar
 
Join Date: Oct 2001
Posts: 2,564
Ummm; what exactly do you mean with 'compatible'?
__________________
It's a man's life in Doom9's 52nd MPEG division.
"The cat sat on the mat."
ATM I'm thoroughly enjoying the Banshee - a fantastic music player/ripper for Linux. Give it a whirl!
Teegedeck is offline   Reply With Quote
Old 19th December 2006, 11:41   #11  |  Link
henryho_hk
Registered User
 
Join Date: Mar 2004
Posts: 889
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
henryho_hk is offline   Reply With Quote
Old 19th December 2006, 23:28   #12  |  Link
Adub
Fighting spam with a fish
 
Adub's Avatar
 
Join Date: Sep 2005
Posts: 2,685
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.
__________________
FAQs:Bond's AVC/H.264 FAQ
Site:Adubvideo
Adub is offline   Reply With Quote
Old 20th December 2006, 01:04   #13  |  Link
Terranigma
*Space Reserved*
 
Terranigma's Avatar
 
Join Date: May 2006
Posts: 953
Teegedeck, you think you could come up with some presets using 3 b-frames? That'd be awesome imo.
Terranigma is offline   Reply With Quote
Old 21st December 2006, 00:40   #14  |  Link
Dams
Registered User
 
Dams's Avatar
 
Join Date: Sep 2002
Location: France
Posts: 190
@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 ?
__________________
Dams
Dams is offline   Reply With Quote
Old 21st December 2006, 02:24   #15  |  Link
henryho_hk
Registered User
 
Join Date: Mar 2004
Posts: 889
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)
henryho_hk is offline   Reply With Quote
Old 21st December 2006, 03:54   #16  |  Link
berrinam
Registered User
 
berrinam's Avatar
 
Join Date: Apr 2005
Posts: 1,740
Quote:
Originally Posted by Merlin7777 View Post
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.
berrinam is offline   Reply With Quote
Old 21st December 2006, 05:34   #17  |  Link
Adub
Fighting spam with a fish
 
Adub's Avatar
 
Join Date: Sep 2005
Posts: 2,685
Thanks berrinam! I await your work with speechless anticipation.
__________________
FAQs:Bond's AVC/H.264 FAQ
Site:Adubvideo
Adub is offline   Reply With Quote
Old 21st December 2006, 08:17   #18  |  Link
Dams
Registered User
 
Dams's Avatar
 
Join Date: Sep 2002
Location: France
Posts: 190
Quote:
Originally Posted by henryho_hk View Post
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

Thxs!
__________________
Dams
Dams is offline   Reply With Quote
Old 22nd December 2006, 13:07   #19  |  Link
Tima
Registered User
 
Join Date: Aug 2004
Location: Russia, Novosibirsk
Posts: 157
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..

Last edited by Tima; 22nd December 2006 at 13:38.
Tima is offline   Reply With Quote
Old 22nd December 2006, 17:34   #20  |  Link
Sh4nn0w
Registered User
 
Join Date: Feb 2006
Location: UK
Posts: 5
Quote:
Originally Posted by Tima View Post
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.
Sh4nn0w is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 19:49.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.