View Full Version : XviD presets - preliminary thoughts and suggestions
foxyshadis
26th June 2006, 03:47
You can't. "xvid" is a VFW tag, not a mkv tag, and encraw cannot write vfw mkvs. (Doesn't xvid have a "generic mpeg4" decoding option though? ffdshow does.) If you really must use it, you have to encode to avi and mux that to mkv (without --engage native_mpeg4).
loro
26th June 2006, 15:55
Teegedeck you're right about the preset selection. But the quantizer maximum value was 5. I will try again, if not I'll use >30% HQ preset. I'll let you know.
Also I loaded my stats file into StatsReader and it shows 2122 MB. Result size is 1726 MB.
Teegedeck
26th June 2006, 21:46
First pass at quantizer=3?
loro
27th June 2006, 15:09
Yes. Fixed quantizer=3. My compressibility check in Enc was 45% with SixOfNine qantization matrix. So I also tried compressibility check with sharktooth's EQM v3HR quantization matrix and the result was 57%.
Teegedeck
27th June 2006, 18:21
This is a puzzler. If 1st-pass-filesize at quantizer=3 was 2122 MB, then it couldn't have been the quantizer restriction that prevented the filesize from going below 1726 MB. (At least it's pretty unlikely; for example I have a movie here where this preset yielded a first pass filesize of 2437 MB and at quantizer 4 it would have been 1734 MB. I would think that quantizer 5 should have brought it down at least solidly under the 1500-MB-margin. But of course my base of comp. check data is not that big, yet).
Can you perhaps make a filesize prediction with Enc using the >45% (HQ) preset at constant quantizer=5 in order to verify this? And maybe another one using the >30% (HQ) preset?
Maybe curve-compression plays a role here - how quant-restrictions and curve-compression interact is still largely untested, I believe.
shpitz
2nd July 2006, 23:28
i've done a test encoding of a 1min clip from a 720p 60fps capture.
i've tried all the profiles henry_ho set in his batch file.
i've got a dual xeon 3ghz.
all values are fps (rounded).
http://img56.imageshack.us/img56/2697/encodingspeedcomparison0sn.th.gif (http://img56.imageshack.us/my.php?image=encodingspeedcomparison0sn.gif)
all profiles produced the same exact filesize (2 threads vs 4 threads) except dvd_perfect and slow_medium.
dvdr_sharpen was unplayable, it crashes every player i tried.
henryho_hk
9th July 2006, 17:19
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
20061004: obsolete old code deleted
-----------------------
Teegedeck
9th July 2006, 19:16
Smokin'! :cool:
I hope to get some computing time on our Windows box tomorrow so I can try it out.
shpitz
9th July 2006, 20:59
i've installed win2k3 x64 enterprise and will play with it and see how it works on x64...
i'm using celtic druid's latest x64 build of xvid.
not sure about avisynth, does anyone have a link to a x64 build of it?
henryho_hk
10th July 2006, 06:44
http://extended64.com/blogs/wiak/archive/2005/09/28/1368.aspx
Please visit the AVISynth forums for more details.
shpitz
11th July 2006, 06:28
http://extended64.com/blogs/wiak/archive/2005/09/28/1368.aspx
thanks, already been there, all links are dead ;-(
i have d/l'ed a while ago the builds, i'm playing with them right now...
i'm using your scripts henry, will report back with some data.
EDIT: enc doesn't seem to work with x64, none of the codecs to the right is available (all grayed out) and when i click configure i get an error message "ICOpen failed"
just in case some1 else needs x64 builds: x64 builds (http://okejl.dk/dunstan/)
henryho_hk
11th July 2006, 07:46
My to-do list:
1) Handle <30% comp test cases. Will there be a "10%" preset, Teegedeck? :devil:
2) Get rid of the goto hacks with in for-loop.
3) Implement audio muxing.
4) Implement batch processing.
5) Implement some unofficial 1-pass presets. [I suffer from a lack of patience. :devil: ]
As for Enc under x64, I don't think it will work, as it depends on avs2avi, which in turn depends of VFW, which probably isn't available under x64.
xvid_encraw seems to access xvid.dll directly. Pls correct me if I am wrong.
foxyshadis
11th July 2006, 08:12
At <30% you might as well flag an error and state "resize and/or filter to bring above 30%!" If you don't want to be that drastic at least make it a warning. You'll definitely have to raise the max quant and kiss details goodbye either way.
shpitz
11th July 2006, 15:08
xvid_encraw works great in x64 and actually i got a reduction in speed when using latest xvid build (non x64) and the latest x64 compile by squid_80.
Teegedeck
11th July 2006, 18:01
My to-do list:
1) Handle <30% comp test cases. Will there be a "10%" preset, Teegedeck? :devil:
When there's XviD AVC and if it's still one binary.
You'll definitely have to raise the max quant and kiss details goodbye either way.No way, these are quality presets, not baddity presets! ;)
Deano123
15th July 2006, 09:25
Thanks For This Really Helps
henryho_hk
15th July 2006, 13:46
For quality freaks here. If you wanna deinterlace, remember to use tdeint(). It's slow, significantly slower than leakkerneldeint(). But then its quality is much better, being sharp while leaving far less residual comb. It usually allows me to use at least one higher level of preset than leakkerneldeint().
Teegedeck
16th July 2006, 10:54
Could someone please test something for me before I change my attachment to 'thre relevant post about the presets? : When I load the zip with those XviD profiles into MeGUI there seems to be nothing to import.
I've only changed 'EncodingMode' to '4' (aut. 2-pass). Maybe a problem with the archive?
lilhobo
18th July 2006, 03:37
there should be a wiki or knowledgebase damned hard to read thru all the posts lol
Valeron
18th July 2006, 07:13
Most anime-centred people here swear by H.263. Of course in the higher-bitrate areas one could use sharper matrices. Didee once was so nice to send me a draft of one. But you need a higher bitrate with such matrices in order to avoid ringing. My impression was that anime fans don't go for high-bitrate encodes. If there's demand and someone to test all that, it could be done. But I don't feel like it, I'm still not finished comparing fast modes. Perhaps we should have a dedicated film-grain-preserving mode, that's what I'm concerned with ATM.
hi, Teege, could you plz mail me that matrices?
i'm interesting in testing it myself.
kurt
18th July 2006, 10:30
Could someone please test something for me before I change my attachment to 'thre relevant post about the presets? : When I load the zip with those XviD profiles into MeGUI there seems to be nothing to import.
I've only changed 'EncodingMode' to '4' (aut. 2-pass). Maybe a problem with the archive?
importing the xvid profiles works fine here :)
but where I have to save the "extra folder" (with the cqm)? Megui produces an error when saving them into MeGui root folder... (same with profile folder)#
Edit: sorry I misunderstood. Importing the profiles via File Menu doesn't work :o
Teegedeck
18th July 2006, 21:04
Megui produces an error when saving them into MeGui root folder... (same with profile folder)#
Edit: sorry I misunderstood. Importing the profiles via File Menu doesn't work :oI was afraid of that, thanks for confirming it. So, when I have time again I'm gonna try to find the guilty part.
elguaxo
18th July 2006, 22:46
Inside the .ZIP there is a folder /XviD-profiles and inside it the folders /extra and /profiles. In the .ZIP with your previous profiles there was no /XviD-profiles folder.
Teegedeck
18th July 2006, 23:04
Gosh, simple as that? :o Thanks, gonna re-upload that zip tomorrow.
Teegedeck
19th July 2006, 15:56
hi, Teege, could you plz mail me that matrices?
i'm interesting in testing it myself.
Didée says it's OK, so you can have a look.
BIG, fat DISCLAIMER:
Didée put that matrix together spontaneously and didn't intend to publish it; he didn't test it at all. Thus it comes with a 'do-with-it-what-you-want-but-don't-blame-me'-license, and it has no name. I've used it a few times and found it produces nice results but only at low quantizers, of course. It's not meant for all kinds of anime, but only for very sharp and very clean sources. It could be used as a starting-ground for further anime-CQM development. If you want to do that you'd certainly be welcome.
16 16 16 16 16 16 16 16
16 16 16 16 16 16 16 16
16 16 16 16 16 16 16 17
16 16 16 16 16 16 17 19
16 16 16 16 16 17 19 22
16 16 16 16 17 19 24 32
16 16 16 17 19 24 36 40
16 16 17 19 22 32 40 48
Teegedeck
20th July 2006, 16:58
OK, updated the XviD-profiles for MeGUI here (http://forum.doom9.org/showthread.php?p=841263#post841263).
shpitz
20th July 2006, 17:18
thanks Tee, will try them tonight.
Teegedeck
20th July 2006, 21:29
...nothing changed there except for correcting the encoding mode from 'CQ' to 'automated 2-pass'. ;-)
firered
21st July 2006, 17:07
Hey Teegedeck
Based on your SixofNine matrix for high bitrates I was wondering do you have a highlow or a medium to low bitrate matrixs for xvid or anyone can recommend a custom one?
thanks
Teegedeck
22nd July 2006, 10:32
Hi, Firered,
SixOfNine is Didée's, not mine. And please read the main posts of the thread (they're linked at the beginning).
sarmin
31st July 2006, 16:48
how do i add the profiles?
and how do i add a matrices?
Livesms
31st July 2006, 16:53
how do i add the profiles?
and how do i add a matrices?
And how can I add custom matrix (SixOfNine for ex.) in MeGui?
Or it can be done only from a commandline.
Teegedeck
31st July 2006, 17:59
Simply download the MeGUI profiles I provided and use MeGUI's profile import function.
This will import the matrices as well. Afterwards you can load all imported matrices from the zones tab of MeGUI's config.
JoeBG
31st July 2006, 18:13
Simply download the MeGUI profiles I provided and use MeGUI's profile import function.
Sorry for the maybe stupid question: Where can I get the matrices?
Teegedeck
31st July 2006, 18:18
@sarmin: Don't pollute threads with basic questions. You already posted a thread for that topic
@kurt: Actually it's not only about MeGUI profiles but about XviD presets.
@JoeBG: There's three ways to get them: XviD VfW installs them into the XviD directory; they are part of the MeGUI profiles that I attached to the main post; LigH's CQM editor also comes with a vast collection of matrices.
Livesms
31st July 2006, 18:27
Simply download the MeGUI profiles I provided and use MeGUI's profile import function.
This will import the matrices as well. Afterwards you can load all imported matrices from the zones tab of MeGUI's config.
First of all thank's for your great job.
I've got several questions
1. I have troubles using Enc for compressibility test. I've discribed it in this thead http://forum.doom9.org/showthread.php?p=857491#post857491
2. Your MeGui profiles use only eqm_v3ulr_rev3, eqm_v3lr, eqm_v3hr, Didees SixOfNine matrix. And what about other ones? If i want to use other matrix how can i import it into MeGui.
3. Is there any reason to test/find/look for better quality then i can get using Enc test -> selecting profile according to %result with mark HQ.
4. I can't understand link with %result test and matrix you use in you profile. For example I've got 48%. So i can use XviD > 45% comp. check' (fast) or XviD > 45% comp. check' (HQ). But there is a different matrixe there eqm_v3lr.xcm and eqm_v3hr.xcm. And bitrate is also here. Or maybe bitrate change in Enc will cause % result change from one level to another. For example I test loing on 1200kbit/s and if I change it to 700kbit/sec will I get smth like 35%? I can't understand how can I use the same matrix for 720*576 DVD clear video and 320*240 port. camera video if it will return the same test results for the rather different bitrates (1400 and 600 for examp.)?
Teegedeck
31st July 2006, 18:38
Sorry, I'm not an expert on Enc. :(
CQMs belong into the 'extra' directory'; I believe it was at \profiles\video\extra. But you can load a matrix from anywhere you like.
If the result is just on the border between two profiles, it's well possible that both can be used and which profile looks better might depend. Otherwise: no, it doesn't make sense.
The Enc test is only there to prevent under- or oversizing in 2nd pass.
Clever question. :) I've found out during testing that the higher-quality EQMv3 HR matrix with HQ XviD settings (VHQ=4) produces about the same bitrate as the lower quality EQMv3 LR matrix with faster XviD settings. It's a good example of how using more efficient settings can visually translate into higher quality: The safed bits allow for using a matrix with lower coefficients. I hope to do something like that for all presets eventually.
Edit: I think I haven't fully understood question 4; can you please try to put it another way? Yes, Enc results depend on a lot of things; bitrate, video content, resolution. An HDTV still scene might yield the same percentage as a 320x music video at the same bitrate. Identical percentage would also mean that they would come out the same filesize if you encoded them with the same settings at the same constant quantizer. Is that what you meant?
@kurt: I moved your answer to sarmin's VDub question to sarmin's matrix-dedicated thread.
Livesms
31st July 2006, 18:56
1. Sorry, I'm not an expert on Enc. :(
I've solved this problem. It was all up to AviSynth - ordinary reinstall and all problems gone :) May be there was some bug in script
AviSource("Video.avi",audio=false) :D
2. CQMs belong into the 'extra' directory'; I believe it was at \profiles\video\extra. But you can load a matrix from anywhere you like.
Yes. But how can i tell Megui to load another matrix. I can only read command line generated by MeGui using entered settings/profile but not to change it directly. And I didn't find how can I manualy select matrix right from MeGui Xvid setting dialog.
3. If the result is just on the border between two profiles, it's well possible that both can be used and which profile looks better might depend. Otherwise: no, it doesn't make sense.
The Enc test is only there to prevent under- or oversizing in 2nd pass.
I was asking this question thinking of not only MeGui + Your Xvid Profiles. I'm interested is it possible to get better quality using other settings/profiles/matrix's (not only your's) then it will be when I simply run Enc test, select profile according to % result with HQ mark and enter bitrate I'm aiming.
4. Clever question. :) I've found out during testing that the higher-quality EQMv3 HR matrix with HQ XviD settings (VHQ=4) produces about the same bitrate as the lower quality EQMv3 LR matrix with faster XviD settings. It's a good example of how using more efficient settings can visually translate into higher quality: The safed bits allow for using a matrix with lower coefficients.
And how it can be found out? Think there is impossible to test video for each matrix for whole length with different Xvid settings to find out best balance quality/speed. It has no sense - too much time. But I'm not Nostradamus to see two step forward, what combination of matrix (maybe not HQ/HR with best quality) will give the same (best i can reach here) in less time/xvid switch on.
Livesms
31st July 2006, 19:05
Edit: I think I haven't fully understood question 4; can you please try to put it another way? Yes, Enc results depend on a lot of things; bitrate, video content, resolution. An HDTV still scene might yield the same percentage as a 320x music video at the same bitrate. Identical percentage would also mean that they would come out the same filesize if you encoded them with the same settings at the same constant quantizer. Is that what you meant?
Nearly :)
I can't fully understand means of this % percentage from Enc. What does they mean. May be fully understanding their meaning I will find answer to my quetion myself :)
Teegedeck
31st July 2006, 20:05
The settings I gave for Enc simply represent a filesize as big as XviD could get at maximum-super-duper-hyper-quality. :) These settings wouldn't produce maximum-super-duper-hyper-quality, of course, but the filesize would be about as big and the settings are fast.
Now Enc makes a filesize prediction about how big your video would come out encoded at that quality and then calculates to how much percent of that filesize the filesize you aim at amounts. If you look closely at the Enc results you'll discover that it always show you a ratio of the filesize you gave for the comp. check and another value - this value is actually the filesize prediction based on the XviD settings.) But we only need that percentage value as a means of comparison. With Enc we can compare the percentage that an encoding with a certain preset - telling from experience - typically produces to the percentage your two-pass-encoding to a certained filesize will probably produce. That way we can indirectly guess with which preset your aimed-at filesize could be reached.
If you test the presets at CQ with their maximum and minimum allowed quantizers (restrictions) you will see that an encoding at the maximum allowed quantizer of a preset will produce a filesize that represents a percentage of filesize Enc has calculated that is slightly lower than the percentage in the preset's name's. And at the minimum allowed quantizer of a preset it will produce a filesize that represents a percentage of the Enc filesize prediction that is quite a bit higher than the percentage given in the next-higher preset's name.
The Enc comp. check is there to prevent you from hitting the hard barrier of the presets' max./min. allowed quantizers.
Edit: I found this rather hard to explain, I hope it is comprehendable.
Livesms
31st July 2006, 21:51
Teegedeck
Ok. Then tell me why we run Enc comp test using settings you recommended CQ=3(or 4), Bvops 2-1.62-0, Qpel(-), GMC(-), AQ(-), Trellis(+), ME(4), VHQ(0-off), VHQ for Bf(-), ChromaME(-), Turbo(+).
Of course I will finally encode with ME(6), VHQ(1 or 4), ChromaME and other things.
As I understand Enc gives percentages results calculated as
%Percent = (DesiredSize) / (EncodedSize) * 100%
where
DesiredSize = Length of Input File * Bitrate / 8;
EncodedSize = FileSize encoded with Enc settings (Q=4, Bvops 2-1.62-0, Qpel(-), GMC(-), AQ(-), Trellis(+), ME(4), VHQ(0-off), VHQ for Bf(-), ChromaME(-), Turbo(+)).
So why should we compare file encoded with one setting to another? Look's like comparing what it more dark - green or red :) Or smth like that?
May be I'm wrong and my questions look's stupid/silly as a two-bob watch, but i can't realize meaning of this Enc %.
In jonny's site was description, reading which I understand, that Enc % is value represents visual quality, I will get compressing my video with entered bitrate (100% means visual identical video, 0% means absolutely different video). May by this scale is not linear, and may be logarithmic (it will be better - 50% means not a half of qual)
I've run test with first file fall into my hands and get smth like 126%. And that's make confused.
Teegedeck
31st July 2006, 22:27
Your result of over 100% means that you are using a way-too-small resolution for the filesize you aim at.
The Enc test relies on the assumption that encodings at fast settings somehow relate to encodings at HQ settings. XviD's fast first pass also relies on that assumption. Or how do you think a second pass can be calculated based upon a first pass that doesn't use GMC, doesn't use QPel, doesn't use VHQ=4 (but does use Turbo) - although you have selected all these settings for the second pass? It works because the results - although very different - somehow relate.
And testing seems to strengthen that assumption that the results of the presets-Enc test relate well enough to the real-life results of preset-2-pass-encoding.
Let me put it like this (excuse me if I simplify the actual values for the sake of making it easy): A movie encoded with the '>45% HQ' preset at constant quantizer 4 will come out half as big as the same movie encoded with the very fast settings I gave for the Enc test. A movie encoded with the '>30%' preset at constant quant=4 will come out 30% the filesize of the same movie encoded with the Enc preset. And so on. And all we need to learn from performing the Enc test is whether or not the average quantizer of our preset-encoding would come dangerously near the maximum/minimumallowed quantizer for that preset.
What matters is that the results of the settings relate, not that they are similar. I could have chosen a completely different constant quantizer for the Enc test, so that (for example) the '>45%' preset would have been a 120% preset. But I thought that this would have been confusing. A higher-quality setting would have had similar (though less dramatic) consequences, plus the disadvantage that the test would take much, much longer. So I chose a quantizer that would make it clear that something's not okay if you get more than 100% and fast settings.
It isn't scientific, it's just a rule of thumb, made to spare you making a blind guess. I'd say, 9 out of 10 times it should work.
Livesms
1st August 2006, 08:44
Your result of over 100% means that you are using a way-too-small resolution for the filesize you aim at.
The Enc test relies on the assumption that encodings at fast settings somehow relate to encodings at HQ settings. XviD's fast first pass also relies on that assumption. Or how do you think a second pass can be calculated based upon a first pass that doesn't use GMC, doesn't use QPel, doesn't use VHQ=4 (but does use Turbo) - although you have selected all these settings for the second pass? It works because the results - although very different - somehow relate.
And testing seems to strengthen that assumption that the results of the presets-Enc test relate well enough to the real-life results of preset-2-pass-encoding.
Let me put it like this (excuse me if I simplify the actual values for the sake of making it easy): A movie encoded with the '>45% HQ' preset at constant quantizer 4 will come out half as big as the same movie encoded with the very fast settings I gave for the Enc test. A movie encoded with the '>30%' preset at constant quant=4 will come out 30% the filesize of the same movie encoded with the Enc preset. And so on. And all we need to learn from performing the Enc test is whether or not the average quantizer of our preset-encoding would come dangerously near the maximum/minimumallowed quantizer for that preset.
What matters is that the results of the settings relate, not that they are similar. I could have chosen a completely different constant quantizer for the Enc test, so that (for example) the '>45%' preset would have been a 120% preset. But I thought that this would have been confusing. A higher-quality setting would have had similar (though less dramatic) consequences, plus the disadvantage that the test would take much, much longer. So I chose a quantizer that would make it clear that something's not okay if you get more than 100% and fast settings.
It isn't scientific, it's just a rule of thumb, made to spare you making a blind guess. I'd say, 9 out of 10 times it should work.
As I can see your profiles was named according to Enc result with Q=4 (and other recommended). So if I get 120% I can lower bitrate or allow bigger frame size. Ideally is to get 100% (>90%) or I'm wrong?
But
With the compressibility test function you are able to predict the quality of your encode, before making the real encode.
The result is a % value, to obtain good results you should stay in the 50%-60% range (the range is not objective, you should make experiments to see what you like more).
If the result is too low, you can change resolution, resize filters, codec parameters, use more cds in order to obtain an higher value.
--------------------------------
http://jonny.leffe.dnsalias.com/enc/htm/htm/xvidct.htm
According to this - the best way is to go for 50-60%.
And another quest. You use different matrix for fast and HQ profile with the same %
for XviD '>45% comp. check' (fast) - eqm_v3lr
for XviD '>45% comp. check' (HQ) - eqm_v3hr
But EQM V3HR - This is a HIGH BITRATE matrix designed to work at full anamorphic DVD res (720x432) with bitrates over 1600kbits (for an average motion movie) and works pretty well even with Q2 encodings or extremely High bitrates. But for that target there will be an Ultra-high bitrate matrix (EMQ V3UHR).
And EQM V3LR - This is a LOW BITRATE matrix designed to work at full anamorphic DVD res (720x432) with bitrates lower than 1500kbits (for an average motion movie) and works pretty well even with high motion sources (using higher bitrates) keeping details where other matrices produce artifacts.
Looking at that I can't understand how it can be. You said proc% do not directly depends on bitatre. I can get 50% with 720*576 DVD-9(8Gb) video for bitrate 1800kbit/s and the same perc% for 320*240 digi cam video for bitrate 600kbit/s. And i will use eqm_v3lr(LOW BITRATE matrix) for fast profile in both case - for DVD with 1800kbit/s and Digi cam video with 600kbit/s. And the same with HQ profile - I will go with eqm_v3hr (HIGH BITRATE) either for DVD with 1800kbit/s and DigiCam with 600kbit/s.
How can explain me that :)
Teegedeck
1st August 2006, 11:58
As I can see your profiles was named according to Enc result with Q=4 (and other recommended). It was Q=3; that might also explain your high percentage result.
So if I get 120% I can lower bitrate or allow bigger frame size. Ideally is to get 100% (>90%) or I'm wrong?Ideal is a full resolution. The percentage is secondary if you want to weigh it out.
But
http://jonny.leffe.dnsalias.com/enc/htm/htm/xvidct.htm[/i]
According to this - the best way is to go for 50-60%.
Please forget that; it has nothing to do with the XviD presets.
And another quest. You use different matrix for fast and HQ profile with the same %
for XviD '>45% comp. check' (fast) - eqm_v3lr
for XviD '>45% comp. check' (HQ) - eqm_v3hr
But EQM V3HR - This is a HIGH BITRATE matrix designed to work at full anamorphic DVD res (720x432) with bitrates over 1600kbits (for an average motion movie) and works pretty well even with Q2 encodings or extremely High bitrates. But for that target there will be an Ultra-high bitrate matrix (EMQ V3UHR).
And EQM V3LR - This is a LOW BITRATE matrix designed to work at full anamorphic DVD res (720x432) with bitrates lower than 1500kbits (for an average motion movie) and works pretty well even with high motion sources (using higher bitrates) keeping details where other matrices produce artifacts.Haven't I explained that above? I believe I have.
Looking at that I can't understand how it can be. You said proc% do not directly depends on bitatre. I can get 50% with 720*576 DVD-9(8Gb) video for bitrate 1800kbit/s and the same perc% for 320*240 digi cam video for bitrate 600kbit/s. And i will use eqm_v3lr(LOW BITRATE matrix) for fast profile in both case - for DVD with 1800kbit/s and Digi cam video with 600kbit/s. And the same with HQ profile - I will go with eqm_v3hr (HIGH BITRATE) either for DVD with 1800kbit/s and DigiCam with 600kbit/s.
How can explain me that :)Bitrates are a sham. That is, if you only look at bitrate and not at resolution and content. Reduce resolution enough and you can encode anything with a high-bitrate matrix at 600 kb/s. Edit: There are DVDs that come out at 3.5 GB if you encode them with SixOfNine at quant=3 and there are DVDs that come out 1.5 GB at the same settings. Does it make sense to use the same CQM on both movies just because you aim for the same filesize/bitrate for both movies? No.
Livesms
1st August 2006, 19:50
Ideal is a full resolution. The percentage is secondary if you want to weigh it out.
Why? Is it better encode blocked full resolution video than resized but better encoded?
According to this - the best way is to go for 50-60%.
Please forget that; it has nothing to do with the XviD presets.
?????? Can you explaine?
Haven't I explained that above? I believe I have.
Can you give me a link or some more explanation?
Bitrates are a sham. That is, if you only look at bitrate and not at resolution and content. Reduce resolution enough and you can encode anything with a high-bitrate matrix at 600 kb/s. Edit: There are DVDs that come out at 3.5 GB if you encode them with SixOfNine at quant=3 and there are DVDs that come out 1.5 GB at the same settings. Does it make sense to use the same CQM on both movies just because you aim for the same filesize/bitrate for both movies? No.
Why should I encode with HighBitrate matrix with 600kbit? I just interested why you use the same(different) matrix proceeding only from perc% and from bitrate? In your profiles matrix depend on Perc but on bitrate.
shpitz
1st August 2006, 19:57
poor Teegedeck, what did you get urself into... lol
Teegedeck
1st August 2006, 20:39
I'm afraid I seem to fail miserably when it comes to explaining things. :o There comes a time when one just has to admit defeat.
henryho_hk
2nd August 2006, 03:14
And i will use eqm_v3lr(LOW BITRATE matrix) for fast profile in both case - for DVD with 1800kbit/s and Digi cam video with 600kbit/s. And the same with HQ profile - I will go with eqm_v3hr (HIGH BITRATE) either for DVD with 1800kbit/s and DigiCam with 600kbit/s.
How can explain me that :)
May I share some of my experience in XviD encoding.
When Teegedeck said comp% does not directly depend on bitrate, he means that comp% is not in a simple linear relation with the bitrate. It also depends heavily on the matrices, other encoding options and quantizer limitations imposed on XviD encoder (in 2-pass mode). For example, in the >45% Presets, in order to compensate for the HR matrix, we need to use the VHQ mode 4 and thus much more encoding time to achieve the same bitrate.
IMO, the Enc comp test is actually an assessment of the source material helping us to choose a right preset so as to achieve an intended bitrate. After obtaining the Comp% value, you are still given one more choice: getting a good encode at a higher speed, or getting a better-to-excellent encode at a slower speed. That's the difference between the Fast & HQ presets. The other preset pairs look much more alike but you can still see the speed-quality compromise.
Livesms
2nd August 2006, 08:03
May I share some of my experience in XviD encoding.
When Teegedeck said comp% does not directly depend on bitrate, he means that they are not in a simple linear relation, not to mention all other XviD parameters, matrices, etc. When he said bitrates are a sham, he means that the bitrate should not be not an input parameter; rather, it is an result of the resolution you chose, the quality you desired (filters, matrices, etc.) and the encoding time you are willing to spend. If you give XviD more time, it can make more efficient encodes, giving you sharper & smooth movie at the same bitrate. On the other hand, when you are out of time, please stay at lower quality presets or use the higher quality "fast" preset (and be prepared to obtain a big file).
The goal of Enc comp. test is actually to suggest us a preset based on the bitrate we specified. Then for the "fast" or "HQ", it is a judgement based on our available time. It does have an impact of quality, but hey, I did not recall Teegedeck had ever told us that ">58% Fast" has a better quality than ">45% HQ".
It's the beauty of XviD - flexibility and versatility.
:goodpost: :thanks: :goodpost:
Ok. I just started to realize meaning and all thins of Enc+Xvid shown in Enc perc%. I'll read one's more main therad postes.
Another question - is it possible to get better quality then I will get using Enc -> MeGui with selected profile?
henryho_hk
3rd August 2006, 03:23
is it possible to get better quality then I will get using Enc -> MeGui with selected profile?
Oops, you caught my original version. ^_^
Actually, I have another question for Teegedeck. Does MeGUI supports chroma optimizer now in the latest version? If it does, my BAT script shall retire. ^_^
foxyshadis
3rd August 2006, 05: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, 07: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, 08: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, 08:27
Comma between b-vop sensitivity value and flags is wrong.
Comma between weight/quantizer value and flags is correct.
foxyshadis
3rd August 2006, 12: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, 01: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, 02: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, 09: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, 10: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, 10: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, 10: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, 16: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, 16: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, 17: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, 20: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, 14: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, 15:26
Unofficial ESS & MTK presets added. :P
http://forum.doom9.org/showthread.php?p=850423#post850423
Didée
8th August 2006, 16: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, 16: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, 11: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, 15: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, 16: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, 19:42
OK, thanks. I understand, so using the maximum settings is unnecessary, but wouldn't harm the result either.
aabxx
11th August 2006, 01: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, 12:41
OK, thanks for your answers!
henryho_hk
14th August 2006, 01: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, 08: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, 01: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, 08: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, 09: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, 09: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, 23: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, 03: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, 16: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, 14: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, 22: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, 05: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, 06: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, 09: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, 09: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, 07: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, 08: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, 10: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, 10: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, 10: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, 10:52
lol, ok, just thought I'd check. :)
henryho_hk
11th September 2006, 18: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, 18: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, 01: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, 12: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.
Chainmax
29th September 2006, 02:01
I recently bought a Chaplin DVD from Amazon and intend to make an Xvid encode out of it and would like for it to be playable on standalones here in Uruguay. Thing is, all but a few DivX capable models are generic, so I'd like to stick with something like AutoGK's "ESS-based standalones" mode to ensure maximum compatibility. Upon checking MeGUI's Xvid presets, I noticed that the profiles available there are only comp_check-based. Is there a possibility to include AutoGK's standalone compatibility profiles?
Teegedeck
29th September 2006, 08:52
I guess henryho_hk's wonderful batchfile could be the thing for you to try. Myself I've always been adamant that I don't want to duplicate work that went into XviD's own hardware profiles. Even if they don't work. ;) Does it make sense to multiply the number of presets by the number of hardware profiles? It seems to undermine the initial idea behind the presets - to make high-quality encoding simple.
The true reason if, of course, that I am too lazy. ;)
henryho_hk
29th September 2006, 11:37
Teegedeck, I owe you an apology for creating those unofficial MTK & ESS presets without your consent. ^_^
henryho_hk
29th September 2006, 19:26
Batch file updated again. Now you can drop an AVS on the batch script and start a 2.06-pass XviD encode (fast preset, 6% comp test + 2-pass encode).
http://rapidshare.de/files/34888521/xvid1xenc_v15c.zip.html
The code is shown below:
....obsolete....
henryho_hk
30th September 2006, 10:41
Version 1.5d: Batch AVS processing is back and you don't need to set the installation path now. Also, please avoid spaces in the file/dir names as quote handling is not there yet.
....obsolete old code deleted....
Teegedeck
30th September 2006, 19:26
What can I say? Wow. :)
MarkCurly
1st October 2006, 00:36
...XviD's own hardware profiles. Even if they don't work. ;)
What is it about the XviD profiles that doesn't work?
(I'm particularly interested in if the Home Theatre and Cinema Plus profiles have any problems.)
Thanks
henryho_hk
1st October 2006, 08:10
V.1.5g ~ If the AVI is over 2GB, use ffmpeg (megui bundle) to convert it to OpenDML.
....obsolete old code deleted....
henryho_hk
1st October 2006, 08:37
What is it about the XviD profiles that doesn't work?
These quality presets use some quality-enhancing features that your standalone player may not support. Hence, I have coarsely modified these presets (mainly turning off those features) hopefully to make them playable in standalone players. I recommend you to try and test.
Indeed, if you have a spare computer at home, you've got to try GeeXboX. You will be surprised how useful it can be.
http://geexbox.org/en/start.html
henryho_hk
2nd October 2006, 15:04
Version 1.6b ~
1) Presets are read from the file bin\xvid_presets.csv
2) Names with spaces can be handled
3) One-pass "Crap" presets are added
4) Zone errors fixed (1.6b)
http://rapidshare.de/files/35222476/xvidenc_16b.zip.html
rack04
2nd October 2006, 19:55
Version 1.6b ~
1) Presets are read from the file bin\xvid_presets.csv
2) Names with spaces can be handled
3) One-pass "Crap" presets are added
4) Zone errors fixed (1.6b)
http://rapidshare.de/files/35222476/xvidenc_16b.zip.html
Can you possibly explain how to use your batch script? Do I just modify the sample.avs and drag/drop to batch script?
Livesms
3rd October 2006, 16:03
Can you possibly explain how to use your batch script? Do I just modify the sample.avs and drag/drop to batch script?
NO. You can just write
xvidenc_16b cmprchkhq br 1350 your_avs_screen.avs
henryho_hk
3rd October 2006, 16:12
Version 1.6c ~~ Comp Test for >=500 frames only
http://rapidshare.de/files/35343151/xvidenc_16c.7z.html
.... compressed twice with 7zip with password xvid_presets
Usage:
1) have a win2k/xp box
2) open a command prompt
3) extract the 7z package keeping the directory structure
4) run xvidenc_16c.bat -h
OR
1) modify DEFSET, DEFSZU and DEFSZV in xvidenc_16c.bat to the value you desire
2) drag and drop some AVS files onto the batch and then wait for it to finish (remember, the AVS script can't have an return statement at the end)
Livesms
3rd October 2006, 17:10
Version 1.6c ~~ Comp Test for >=500 frames only
http://rapidshare.de/files/35343151/xvidenc_16c.7z.html
.... compressed twice with 7zip with password xvid_presets
Usage:
1) have a win2k/xp box
2) open a command prompt
3) extract the 7z package keeping the directory structure
4) run xvidenc_16c.bat -h
OR
1) modify DEFSET, DEFSZU and DEFSZV in xvidenc_16c.bat to the value you desire
2) drag and drop some AVS files onto the batch and then wait for it to finish (remember, the AVS script can't have an return statement at the end)
Thank you...
Can you post your archive to http://dump.ru or http://slil.ru
This is Russian filesharing services but it has no annoing "wait for 65 minutes" or "you can't download now"
The same xvidenc_16c.7z.html reposted here. http://dump.ru/files/3/329866955/xvidenc_16c.7z
MD5 hash: 0164c2758b02597d390234086e411c9d
henryho_hk
3rd October 2006, 17:31
I uploaded it here http://dump.ru/files/6/673400987/. Still double compressed and encrypted. The MD5 is 0164c2758b02597d390234086e411c9d.
Livesms
3rd October 2006, 17:34
I uploaded it here http://dump.ru/files/6/673400987/
Comparing to previous (1.6b) there is no help screen with blank comman-line parametres - and pause (press any key to continue...) in te end.
As for me help with blank command line and no pause is more convenient.
henryho_hk
3rd October 2006, 18:12
Can you possibly explain how to use your batch script?
Before running the batch script, please read Teegedeck's original explanation of the presets in these 2 posts:
http://forum.doom9.org/showthread.php?p=796900#post796900
http://forum.doom9.org/showthread.php?p=841263#post841263
The default settings (esp. the default bitrate which I use for 640x480 tdeint'ed DVD) may not suit your materials, even if you are using the comp-test assisted modes. Do more tests.
henryho_hk
4th October 2006, 17:44
Version 1.6d
1) Full comp test for <500 frames while 6% comp test for >=500 frames
2) TS (target size) comp test ~ formula fixed
3) New "cmprchkonly" mode ... self-explanatory
4) BPPX (target bit/pixel) mode added ... for fun only, use with caution
@echo off
setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
rem mode con cp select=437
set INSPATH=%~dp0
set BINPATH=%INSPATH%bin
set MATPATH=%INSPATH%matrix
set XVIDEXE=%BINPATH%\xvid_encraw_20060621.exe
set BCFLEXE=%BINPATH%\bc.exe
set FFMGEXE=%BINPATH%\ffmpeg.exe
set AVSUEXE=%BINPATH%\avsutil.exe
set PRESETF=%BINPATH%\xvid_presets.csv
set DEFSET=cmprchkfast
set DEFSZU=br
set DEFSZV=1300
if "%~1"=="" (
echo Usage: "%~0" cmpr{chk/gt30/gt45/gt58/gt90}{hq/fast/crap/mtk/ess} {br/ts/bppx} {value} {filename.avs} {filename2.avs} ...
echo.
echo br 1300 means a target bitrate of 1200kbps
echo ts 1300 means a target size 1200KB
echo bppx 0.181 means a target rate of 0.181 bit/pixel
echo Use cmprchkhq, fast, crap, mtk or ess for comp-test assisted encodes.
echo ^(Note: crap, mtk and ess are not official Teegedeck presets.^)
echo Use cmprchkonly for comp test only.
echo When only filename.avs is specified, "%DEFSET% %DEFSZU% %DEFSZV%" is assumed.
echo To force I-Frames ^(e.g. chapter pts^), create a plain filename.zones.txt.
echo.
goto GEND
)
if /i "%~x1"==".avs" (
for %%A in (%*) do call "%~0" %DEFSET% %DEFSZU% %DEFSZV% "%%~A"
pause
goto GEND
)
if /i not "%~x1"==".avs" if /i not "%~x2"==".avs" if /i not "%~x3"==".avs" if /i "%~x4"==".avs" if /i "%~x5"==".avs" (
for %%A in (%*) do if /i "%%~xA"==".avs" call "%~0" %1 %2 %3 "%%~A"
pause
goto GEND
)
rem -------- one by one now ----------
if "%~4"=="" (
echo Please specify source file names, or even "*.avs".
goto GEND
)
if not exist "%~4" (
echo Source file "%~4" is not found.
goto GEND
)
if /I not "%~x4"==".avs" (
echo Source file "%~4" must be an AVS file.
goto GEND
)
for %%I in ("%~4") do (
set SRCFILE=%%~fI
set SRCDISK=%%~dI
set SRCPATH=%%~pI
set SRCNAME=%%~nI
set SRCEXTT=%%~xI
set SRCPREF=%%~dpnI
set TMPPATH=%%~dpItmp\
)
set SRCTMPP=%TMPPATH%%SRCNAME%
pushd %SRCDISK%%SRCPATH%
set WAY=%~1
set SIZU=%~2
set SIZV=%~3
if not exist %TMPPATH%\NUL mkdir %TMPPATH%
echo.
echo.
echo start "Source Check" /b /wait /low "%XVIDEXE%" -type 2 -i "%SRCPREF%.avs" -frames 1
start "Source Check" /b /wait /low "%XVIDEXE%" -type 2 -i "%SRCPREF%.avs" -frames 1 2> "%SRCTMPP%.fps"
for /f "usebackq tokens=1,2,3* delims=()" %%A in (`type "%SRCTMPP%.fps" ^| find "xvid [info]" ^| find "fps"`) do set ORIFFPS=%%B
for /f "usebackq" %%A in (`echo %ORIFFPS% ^| "%BCFLEXE%" -l`) do set ORIGFPS=%%A
for /f "usebackq tokens=1,2,3,4,5,6,7,8* delims=, " %%A in (`type "%SRCTMPP%.fps" ^| find "xvid [info]" ^| find "fps"`) do (
set ORIWIDT=%%E
set ORIHEIG=%%G
)
for /f "usebackq" %%A in (`%AVSUEXE% "%SRCFILE%"`) do set ORIFRM=%%~A
if /I "%SIZU%"=="br" (
set SIZ=-bitrate %SIZV%
) else if /I "%SIZU%"=="ts" (
set SIZ=-size %SIZV%
) else if /I "%SIZU%"=="bppx" (
for /f "usebackq tokens=1,2*" %%A in (`echo x ^= %SIZV% * %ORIWIDT% * %ORIHEIG% * %ORIFFPS% / 1000 ^; scale ^= 0 ^; x /^= 1 ^; x ^| "%BCFLEXE%" -l`) do (
set SIZU=br
set SIZV=%%A
set SIZ=-bitrate %%A
)
) else (
set SIZ=-bitrate %DEFSZV%
)
if /I "%WAY:~0,7%"=="cmprchk" (
set PPC=-zones 0,q,3,KO -vhqmode 0 -qtype 1 -qmatrix "%MATPATH%\Didees-SixOfNine.cqm" -nopacked -quality 4 -turbo
set W3=!WAY:~7!
if /i not "!W3!"=="mtk" if /i not "!W3!"=="ess" set PPC=!PPC! -max_bframes 2 -bquant_ratio 162 -bquant_offset 0
if /i "!W3!"=="mtk" set PPC=!PPC! -max_bframes 1 -bquant_ratio 162 -bquant_offset 0 -vbvsize 3145728 -vbvmax 4854000 -vbvpeak 8000000
if /i "!W3!"=="ess" set PPC=!PPC! -max_bframes 1 -bquant_ratio 162 -bquant_offset 0 -vbvsize 3145728 -vbvmax 4854000 -vbvpeak 8000000
set CTMFRM=500
(
type "%SRCFILE%"
echo.
if "!ORIFRM!" GEQ "!CTMFRM!" echo SelectRangeEvery^(233, 14^)
) > "%SRCPREF%.ct.avs"
for /f "usebackq" %%A in (`%AVSUEXE% "%SRCPREF%.ct.avs"`) do set SRCFRM=%%~A
echo start "Compressibility Test 0.06" /b /wait /low "%XVIDEXE%" -type 2 -i "%SRCPREF%.ct.avs" -pass1 "%SRCTMPP%.ct.stats" -progress 100 !PPC!
start "Compressibility Test 0.06" /b /wait /low "%XVIDEXE%" -type 2 -i "%SRCPREF%.ct.avs" -pass1 "%SRCTMPP%.ct.stats" -progress 100 !PPC! 2> "%SRCTMPP%.ct.hd"
move "%SRCPREF%.ct.avs" "%SRCTMPP%.ct.avs"
set SRCFPS=!ORIFFPS!
set CTTYPE=STL
if /i not "!W3!"=="mtk" if /i not "!W3!"=="ess" set CTTYPE=NRM
set LINENUM=0
set CTFRM=0
set CTSIZ=0
(
echo 0 \
for /f "usebackq skip=3 tokens=1,2,3,4,5,6,7* delims= " %%a in (`type "%SRCTMPP%.ct.stats"`) do (
if !ORIFRM! GEQ !CTMFRM! if "!CTTYPE!"=="NRM" if not !LINENUM! EQU 0 if not !LINENUM! EQU 1 if not !LINENUM! EQU 2 if not !LINENUM! EQU 11 if not !LINENUM! EQU 12 if not !LINENUM! EQU 13 (
set /A CTFRM+=1
echo + %%f \
)
if !ORIFRM! GEQ !CTMFRM! if "!CTTYPE!"=="STL" if not !LINENUM! EQU 0 if not !LINENUM! EQU 1 if not !LINENUM! EQU 12 if not !LINENUM! EQU 13 (
set /A CTFRM+=1
echo + %%f \
)
if !ORIFRM! LSS !CTMFRM! (
set /A CTFRM+=1
echo + %%f \
)
SET /A LINENUM=!LINENUM! + 1
if !LINENUM! GEQ 14 SET LINENUM=0
)
echo + 0
) > "%SRCTMPP%.ct.sz"
for /f "usebackq tokens=1,2* delims= " %%A in (`type "%SRCTMPP%.ct.sz" ^| "%BCFLEXE%" -l`) do SET CTSIZ=%%A
echo.
echo.
echo Source FPS = !SRCFPS!
echo No. of frames in CT AVS = !SRCFRM!
echo No. of frames for CT = !CTFRM!
echo Size of selected frames = !CTSIZ!
if /I "%SIZU%"=="br" (
echo Target Bitrate = !SIZV!
for /f "usebackq tokens=1,2* delims= " %%A in (`echo x ^= !SIZV! * !CTFRM! * 1000 / 8.0 / ^( !SRCFPS! ^) / !CTSIZ! * 100 ^; scale ^= 0 ^; x /^= 1 ^; x ^| "%BCFLEXE%" -l`) do set CPTRS=%%A
)
if /I "%SIZU%"=="ts" (
echo Target Size in KB = !SIZV!
for /f "usebackq tokens=1,2* delims= " %%A in (`echo x ^= !SIZV! * 1024 / !ORIFRM! * !CTFRM! / !CTSIZ! * 100 ^; scale ^= 0 ^; x /^= 1 ^; x ^| "%BCFLEXE%" -l`) do set CPTRS=%%A
)
echo Compressibility Test = !CPTRS!
set PRESET=cmprgt30!WAY:~7!
if !CPTRS! GEQ 45 set PRESET=cmprgt45!WAY:~7!
if !CPTRS! GEQ 58 set PRESET=cmprgt58!WAY:~7!
if !CPTRS! GEQ 90 set PRESET=cmprgt90!WAY:~7!
if /i not "!WAY!"=="cmprchkonly" (
echo Preset !PRESET! is choosen.
set WAY=!PRESET!
)
)
if /i "!WAY!"=="cmprchkonly" goto GEND
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!"=="crap" if /i not "!W3!"=="fast" if /i not "!W3!"=="hq" set PRESET=cmprgt45fast
set W1=!PRESET:~0,6!
set W2=!PRESET:~6,2!
set W3=!PRESET:~8!
for /f "usebackq tokens=1,2* delims= " %%A in (`echo x ^= !ORIGFPS! * 10 + 0.5 ^; scale ^= 0 ^; x /^= 1 ^; x ^| "%BCFLEXE%" -l`) do set KEYINT=%%A
for /f "usebackq skip=2 tokens=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26* delims=," %%A in (`type "%PRESETF%"`) do if "!W2!"=="%%~A" if /I "!W3!"=="%%~B" (
set PP0=-nopacked -progress 100 -max_key_interval !KEYINT!
if /I "%%~B"=="ESS" set PP0=!PP0! -vbvsize 3145728 -vbvmax 4854000 -vbvpeak 8000000
if /I "%%~B"=="MTK" set PP0=!PP0! -vbvsize 3145728 -vbvmax 4854000 -vbvpeak 8000000
if not "%%~D"=="." set PP0=!PP0! -quality %%~D
if not "%%~E"=="." set PP0=!PP0! -vhqmode %%~E
if /I "%%~F"=="Y" set PP0=!PP0! -lumimasking
if /I "%%~G"=="Y" set PP0=!PP0! -qpel
if not "%%~H"=="." set PP0=!PP0! -max_bframes %%~H
if not "%%~I"=="." set PP0=!PP0! -bquant_ratio %%~I
if not "%%~J"=="." set PP0=!PP0! -bquant_offset %%~J
if /I "%%~K"=="H263" set PP0=!PP0! -qtype 0
if /I "%%~K"=="MPEG" set PP0=!PP0! -qtype 1
if /I "%%~K"=="ULR" set PP0=!PP0! -qtype 1 -qmatrix "%MATPATH%\eqm_v3ulr_rev3.xcm"
if /I "%%~K"=="LR" set PP0=!PP0! -qtype 1 -qmatrix "%MATPATH%\eqm_v3lr_rev1.xcm"
if /I "%%~K"=="HR" set PP0=!PP0! -qtype 1 -qmatrix "%MATPATH%\eqm_v3hr_rev1.xcm"
rem if /I "%%~K"=="HR" set PP0=!PP0! -qtype 1 -qmatrix "%MATPATH%\heini_mr.xcm"
if /I "%%~K"=="6OF9" set PP0=!PP0! -qtype 1 -qmatrix "%MATPATH%\Didees-SixOfNine.cqm"
if not "%%~L"=="." set P1Q=%%~L
if not "%%~M"=="." set PP0=!PP0! -imin %%~M
if not "%%~N"=="." set PP0=!PP0! -imax %%~N
if not "%%~O"=="." set PP0=!PP0! -pmin %%~O
if not "%%~P"=="." set PP0=!PP0! -pmax %%~P
if not "%%~Q"=="." set PP0=!PP0! -bmin %%~Q
if not "%%~R"=="." set PP0=!PP0! -bmax %%~R
if not "%%~S"=="." set PP0=!PP0! -chigh %%~S
if not "%%~T"=="." set PP0=!PP0! -clow %%~T
if not "%%~U"=="." set PP0=!PP0! -ostrength %%~U
if not "%%~V"=="." set ZBS=%%~V
if /I not "%%~W"=="Y" set PP0=!PP0! -nochromame
if /I "%%~X"=="Y" set PP0=!PP0! -bvhq
if /I "%%~Y"=="Y" set PP0=!PP0! -turbo
set ZZ1=,q,!P1Q!,KO!ZBS!
set ZZ2=,w,1,KO!ZBS!
if "%%~C"=="1" (
set PP1=!PP0! -pass1 "%SRCTMPP%.stats" -type 2 -i "%SRCFILE%"
)
if "%%~C"=="2" (
set PP2=!PP0! %SIZ% -pass2 "%SRCTMPP%.stats" -type 2 -i "%SRCFILE%" -avi "%SRCPREF%.avi"
)
if /I "%%~B"=="CRAP" (
set PP0=!PP0! -single -cq !P1Q! -type 2 -i "%SRCFILE%" -avi "%SRCPREF%.avi"
)
)
set ZP1=-zones 0%ZZ1%
set ZP2=-zones 0%ZZ2%
if exist "%SRCPREF%.zones.txt" for /f "usebackq" %%f in (`type "%SRCPREF%.zones.txt"`) do if 0%%f neq 0 (
set ZP1=!ZP1!/%%f%ZZ1%
set ZP2=!ZP2!/%%f%ZZ2%
)
set ZP0=%ZP2%
echo.
if /I "!W3!"=="CRAP" (
echo start "%PRESET% - Single Pass" /b /wait /low "%XVIDEXE%" %ZP0% %PP0%
start "%PRESET% - Single Pass" /b /wait /low "%XVIDEXE%" %ZP0% %PP0%
) else (
echo start "%PRESET% - Pass 1" /b /wait /low "%XVIDEXE%" %ZP1% %PP1%
start "%PRESET% - Pass 1" /b /wait /low "%XVIDEXE%" %ZP1% %PP1%
echo.
echo start "%PRESET% - Pass 2" /b /wait /low "%XVIDEXE%" %ZP2% %PP2%
start "%PRESET% - Pass 2" /b /wait /low "%XVIDEXE%" %ZP2% %PP2%
)
rem if the AVI is over 2,000,000,000 bytes, use ffmpeg to convert it to OpenDML AVI
if exist "%SRCPREF%.avi" for %%A in ("%SRCPREF%.avi") do if %%~zA GTR 2000000000 (
echo.
"%FFMGEXE%" -i "%SRCPREF%.avi" -vcodec copy -y -f avi "%SRCPREF%.opendml.avi"
del /f /q "%SRCPREF%.avi"
)
echo.
:GEND
drob
6th October 2006, 15:42
What would be the MEGui profiles/preset that would give me best quality, (size not an issue), but would keep mediatek compatibility (that is no gmc or packed bitstream and max 2 bframes).
shadell
10th October 2006, 15:39
I've tested these settings (the HQ variants) twice now and compared the results to those created using the 'standard' doom9 settings at
http://www.doom9.org/index.html?/gknot-codecsetup-xvid11.htm
In both cases I preferred the standard settings - there was less noise.
foxyshadis
10th October 2006, 20:39
The entire idea of the HQ settings is to retain noise and film grain along with detail. If you prefer a smoother picture, they really aren't for you.
shadell
18th October 2006, 03:47
The entire idea of the HQ settings is to retain noise and film grain along with detail. If you prefer a smoother picture, they really aren't for you.
No, I am talking about the amount of XviD artifact noise.
henryho_hk
6th December 2006, 00:59
Time to pump this thread up again. ^_^
I have tested Teegedeck's presets on a famous CG movie. For each preset, both best case and worst case are performed. I have captured a common I-Frame:
Teegdeck's Fast Presets: http://dump.ru/files/1/1246579557/
Teegdeck's Quality Presets: http://dump.ru/files/6/6767911858/
Now I understand what's meant by ULR's sharpening effect.
Dams
6th December 2006, 11:12
@henryho_hk : interesting,
well, i've seen the post named "new revision of presets", but we don't see where is the anim preset or don't understand new preset :D
Personally, I use recently the preset on first page for anim , and I'm happy with it. (+/- 1150 kb/s , duration 1:10:00)
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.