View Full Version : XviD presets - preliminary thoughts and suggestions
Teegedeck
26th February 2006, 19:53
This version of the presets is derelict. Please read an up-to-date version of the presets here (http://forum.doom9.org/showthread.php?p=841263#post841263). The previous version can still be found here (http://forum.doom9.org/showthread.php?p=796900#post796900).
Again and again, there's questions on the forum like 'what settings should I use for sports?' or 'what are the best settings for high quality?" I cannot without twitching answer them all with 'use the defaults!' but personally I'm also quite fed-up with explaining the same things over and over again or searching for those explanations and linking them.
So, I guess there is demand for more of those 'XviD presets' which tentatively have been introduced with XviD 1.1.
I'd like to summ up my thoughts on how we could get to meaningful presets in this post and start a discussion that will probably go on for quite some time before we actually see any more presets implemented. Especially since sysKin would rather like to do it right from the start and implement a more cross-platform approach to presets instead of simply modifying the VfW frontend and is quite busy again, now.
OK, thoughts - I hope for your input and for you to correct me where I assume false things.:
Presets should never in any way relate to 'bitrates' because you cannot target settings at such a relative, indeed kind of virtual thing. 'high quality' is correct, 'high bitrate' is wrong.
As few presets as possible - there's not really so much you should need to change in XviD's settings for different circumstances; and also the more, the more confusing it gets to the target audience - i.e. mainly newbies.
Now, how do we have to think about XviD options in order to work our way somewhat efficiently towards meaningful presets? Before we start out just testing into the blue, without any idea where this is going, perhaps we should fence it in a bit by some kind of concept on how to go about it.
So, the following is to describe how one could come to a set of 'presets' to start out testing.
I think the settings in XviD are mainly changed upon three circumstances:
What compression ratio one aims for (As in 'how many percent smaller than a - purely hypothetical - optimum re-encode should the result be?'), simplified as 'compression ('strong --> 'low')
What quality-speed ratio one wants (As in 'how long am I prepared to wait for the darn thing to finish in order to squeeze out some extra quality?'), simplified as 'speed' ('fast'-->'slow')
What kind of source I am about to encode (anime, clean source, noisy source), simplified as 'material'.
That could give us two axes on which to file presets: Compression and speed. 'Material' would kinda stand out.
Now one could arrange a matrix with nine fields:
low&fast medium&fast strong&fast
low&norm medium&norm strong&norm
low&slow medium&slow strong&slow
'Compression' could be addressed mainly by use of, say 3 different CQMs to cover the needs of different scenarios better than 'just using H.263 for everything'. Also, the quantizer at which the first pass is performed should be altered according to matrix characteristics and/or presumable 2nd-pass-target-quantizer for that profile
'Speed' could be addressed by using the usual, more time consuming and quality-enhancing settings for higher quality.
Compression
As for the 'compression'-axis,a start would be switching matrices as follows (from low to strong compression): SixOfNine --> H.263 --> EQM v3 ULR. That is just a starter, and I think H.263 could perhaps be replaced by one of Sharktooth's or Soulhunter's matrices. But I don't know them well enough. Is perhaps one of them more forgiving to quantizer-fluctuations in the 'faster' presets? I also think there should be a special 'near-lossless' setting which uses Sharktooth's UHR matrix. Also, for strong compression AQ should be used IMHO. Renamed to 'for editing' so that it is not mistaken for a preset for archival. The first pass with SixOfNine (or other HQ-CQMs) should be performed at quant=3 in the 'low'-column, and with quant=4 in the 'medium' because of their small coefficients; first pass with EQM ULR should also be done at 4 because I think it would be primarily used at pretty extreme settings, correct me if I'm wrong. First pass with the 'near-lossless' profile should be at ??? Sharktooth?
Speed
As for the 'speed' axis, I'd suggest
line 1 could imply ME 5, no VHQ, no chroma ME
line 2 could imply ME6, VHQ=1, VHQ for b-frames, chroma ME
line 3 could imply ME6, VHQ=4, VHQ for b-frames, chroma ME
'near lossless' or 'for editing' could imply ME6, VHQ=4, VHQ for b-frames, b-frames 1/1.0/1, chroma ME and GMC + Sharktooth's UHR matrix and would be meant specifically for near-lossless encoding.
'anime' could trigger using the H.263 matrix, cartoon mode(!), a mild b-frame setting like ratio 1.0, offset=1, ME6, VHQ=1, VHQ for b-frames, chroma ME.
Trellis should always be used IMHO. I guess also activated in all settings could be chroma optimizer. We could also meditate about making Didée's 'golden cut' ratio (ratio=1.6, offset=0) with its more lenient characteristics the new standard while we're at it.
The use of QPel could depend on both speed and compression - as it doesn't make sense to use it for 'fast' or 'strong compression' profiles, and perhaps neither to use it for the 'anime' preset. In the rest of profiles I think it should be used.
That would leave us basically with eleven presets like these
fast strong compression
fast medium compression
fast low compression
normal strong compession
normal medium compression
normal low compression
slow strong compression
slow medium compression
slow low compression
for editing
anime
That's a bit much, right? Clearly unnecessary. Perhaps one should eliminate extremes that probably wouldn't work too well: fast strong compression is probably not a good idea. And perhaps also settings between which there wouldn't be much difference in the result. As SixOfNine is quite usable till the higher quantizers one could merge the 'low' and medium 'compression'-columns into one and use H.263 only for the fastest encoding mode where high quantizers are likely to occur, for instance... Seven profiles left. Now, re-arrange the order in which they appear to something more meaningful, find catchy names for them and Bob's your uncle :):
normal strong compression: 'fast, extreme compression'
slow strong compression: 'good quality, extreme compression'
fast medium compression: 'good quality, strong compression'
normal medium compression: 'high quality, medium compression'
slow medium compression: 'very high quality, medium compression'
insanely slow low compression: 'insane quality, low compression'
for editing
anime
(Well... We'll think again about the 'catchy' bit sometime later...)
That would mean effectively these settings:
'fast, extreme compression', tooltip: 'at ~15-25% of original filesize':ME6, VHQ=1, VHQ for b-frames, AQ, chroma ME, EQM v3 ULR, 1st pass @q=4, curve-compr. H30, L15, quantizer-restrictions min. 3
'good quality, extreme compression', tooltip: 'at ~15-25% of original filesize, apt for sports'':ME6, VHQ=4, VHQ for b-frames, AQ, chroma ME, EQM v3 ULR, 1st pass @q=4, curve-compr. H30, L15, quantizer-restrictions min. 3
'good quality,strong compression', tooltip: 'apt for standard DVD backup at ~25-35% of original filesize': ME6, VHQ=1, chroma ME, EQM v3 LR,* 1st pass @q=3, curve-compr. H20, L7, quantizer-restrictions min. 3, max. 7
'high quality, medium compression', tooltip: 'apt for transparent DVD backup at ~30-50% of original filesize, also for noisy sources at >40%': ME6, VHQ=1, VHQ for b-frames, chroma ME, SixOfNine, Qpel, 1st pass @q=4 curve-compr. H15, L5, quantizer-restrictions min. 2, max. 6
'very high quality, medium compression', tooltip: 'apt for transparent DVD backup at ~30-50% of original filesize': ME6, VHQ=4, VHQ for b-frames, chroma ME, SixOfNine, Qpel, 1st pass @q=3, curve-compr. H10, L3, quantizer-restrictions min. 2, max. 6
'insane quality, low compression', tooltip: 'apt for DVD-to-DVD-R backup (clean sources) at >50% of original filesize, also for noisy sources at >60': ME6, VHQ=4, VHQ for b-frames, b-frames 1/1.0/1, b-frame sensitivity =-3, chroma ME, Qpel and GMC, EQM UHR , 1st pass @q=4, quantizer-restrictions min. 3 max. 7
for editing, tooltip: 'fast, near lossless encoding, huge filesizes, NOT for archiving purposes': ME6, VHQ=1, no b-frames, chroma ME, EQM EHR , only for quality-based 1-pass, quantizer-restrictions constant quantizer 2
anime: cartoon mode(!), a mild b-frame setting like ratio 1.0, offset=1, ME6, VHQ=1, VHQ for b-frames, chroma ME, H.263, 1st pass @q=2, quantizer-restrictions min. 2,2,3, max. 6,6,10
*=possible replacement by Soulhunter's v6 matrix or H.263
Always active: Trellis, chroma opt., b-frames: max. 2 consecutive, ratio 1.62, offset 0 if not specified otherwise (insane, anime, for editing), ME precision = 5 for first pass.
Do you think that this would be a good start from which to work the way up?
Catchy names:
100 minutes at full resolution (if you get undersizing choose a higher preset, if you get oversizing choose a lower preset:
'fast, extreme compression' --> fast, 1 - 2 CD-Rs
'good quality, extreme compression' --> HQ, 1 - 2 CD-Rs
'good quality, strong compression' --> fast, 2 - 3 CD-Rs
'high quality, medium compression' --> fast, 3 CD-Rs
'very high quality, medium compression' --> HQ, 3 CD-Rs
insane quality, low compression' --> insane, 3 CD-Rs - 1 DVD-R
'for editing only'
'anime'
comment: Don't like this, really, but seems unavoidable. (I really would prefer a naming scheme more analogue to LAME's old preset-names, like 'fast low; low; fast medium; medium' etc. but it seems that people can rightfully expect (if somewhat vague) size-predictions for a codec that's mainly being used for two-pass encoding.)
Edited: some hubris; thanks to Koepi for spotting it!;)
Edited: 'good quality' is not so fast anymore...
Edited: 'near lossless' is fast, now; added 'insane quality'
Edited: added curve-compression settings
Edited: added compressibility hints, replaced 'light compression' with the more appropriate term 'low compression'
Edited: amended tooltip comments
Edited: renamed two presets, can you spot which ones?
Edited: changed another tooltip...
Edited: ...and another blunder ...and correction of filesize recommendations
Edited: added quantizer-restrictions
Edited: quant. restrictions, 'good quality, extreme compression' uses EQM v3 LR now
Edited: adjusted 'catchy' names
Koepi
26th February 2006, 21:51
Do you think that this would be a god start from which to work the way up?
Interesting summary. I like it; I might even assemble a build which uses those profiles.
Anyhow, I'd like to object. It's not a god start. But a good one it is indeed!
Best regards
Koepi
Teegedeck
26th February 2006, 22:21
Wow, thanks! :) I wasn't sure whether the VfW presets could trigger all switches or were restricted in any way.
With a build I guess we could find out quite quickly what is perhaps horribly wrong with that selection above. Though I'd sure like some input beforehand, for example from Sharktooth about what I had in mind with this 'quasi-lossless' preset which would more apty be named 'insane'?
Sharktooth
26th February 2006, 23:07
Well "near lossless" could be a good name.
Also please note there is EHR matrix that was specifically made for that purpouse (with no b-frames) but it has "no mercy" for the file size... :)
So IMHO there could be 2 "near lossless" profiles, one with UHR (more compression) and the other with EHR (less compression).
or maybe just test those 2 profiles and choose the best one to include in the build.
Soulhunter
27th February 2006, 02:22
/me votes for more Soulhunter matrices... ;P :D
9-out-of-10-DVD9s-to-DVD5: VHQ1, B-VOPs 1/1/1, Trellis, No QPel/GMC, Soulhunters v3, Single pass @ Q2
Bye
shpitz
27th February 2006, 06:09
halelloyah Teege, that is an amazing piece of information.
question: i did an encode of a 720p clip (1min long) of an nba game using ur "good quality, extreme compression" settings. filesize was 12mb. quality is awesome.
i did the same encode using ur "high quality" settings. filesize was 8.4mb. quality is tiny worse compared to good quality settings.
target bitrate is 1200kbps.
my question is this: when you say extreme compression in "good quality", how come the filesize was much bigger than "high quality"?
when you say compression you don't mean in terms of filesize?
thanks
Teegedeck
27th February 2006, 10:26
@Sharktooth: Thanks; 'near lossless' it is then! Humm; as these are 'presets for the masses' it would perhaps be wise to have a near lossless profile that still aims for a compression ratio close to that of high-quality MPEG-2 if one can make such a general statement. Do you think one should rather use EHR or UHR for that? Also, do you think that for such a profile B-frames generally shouldn't be used or would it be enough to have only 1/1.0/1 and a low b-frame sensitivity (keeping the filesize-aim in mind)? At which quantizer should the first pass then be performed (if that quantizer were to be near the expected 2nd-pass average quantizer)?
If Koepi would build something for testing we could of course just include two 'near lossless' presets and test all that out.
@Soulhunter: Yay. Thanks for the suggestion. ;) Seriously, your v6 matrix is the only close contender for H.263's place (as your matrix comparisons have shown). Perhaps we could further test out which of the two reacts more forgiving to big quantizer fluctuations, 'cause that is pretty much what I'd expect from the 'good quality' preset which I kinda meant to be really fast.
@shpitz: That's the reason why the 'extreme compression' preset is described as 'apt for sports' while the 'good quality' preset is described as 'apt for DVD backup'. So it's supposed to be that way.
On the other hand, the 'good quality, extreme compression' preset uses higher-quality settings than the 'good quality' one which is meant as being a fast mode. Perhaps this is too confusing and the settings for 'good quality' should be altered to ME=6 at least.
The question is 'how fast does the fastest mode need to be?' We could of course say the current only preset of XviD is the fastest we need. Then we could set 'good quality' to ME=6, VHQ=1. The difference to the 'high quality' preset would still be large enough because of the switch of matrices and VHQ for b-frames. OK, I'll edit my first post for the time being.
Dunno why exactly your result with 'good quality' was undersized(?) but 1 minute is too short for two-pass in any case.
Sports is generally highly-compressed MPEG-2, DVD-content is lightly-compressed MPEG-2. So you also need to use strong compression in MPEG-4 (XviD) to get reasonable filesaving when transcoding sports while you need only lenient compression for transcoding a DVD, in order to retain its original quality. You not needing to worry about the 'whys' is what presets should be there for. :)
raeltheimperialaerosolkid
27th February 2006, 10:30
Good post!
Ehm sorry for bothering always on the same argument but I would recommend that, for compatiblity purposes with SA palyers, the feature (Packed bitstream, QPel and GMC) that could interfere should, at least report a warning. This should be valid for all presets.
Teegedeck
27th February 2006, 10:42
Hardware profiles should always override presets, yes.
Sharktooth
27th February 2006, 13:46
i once read an article (or was it a forum post?) regarding the use of EHR for archival quality.
The difference from the source is so small you can't tell the difference even watching still frames.
They had to intensify the difference between pictures to have them actually show something.
However EHR is bitrate hungry but still compresses more than lossless codecs.
I would suggest using EHR coz it's really near-lossless but it all depends on how much compression you want for that profile.
I think some tests are needed to estabilish how much quality can be sacrificed in the name of "near-lossless".
For what concerns EHR and b.frames, it was not meant to be used with them while UHR can take advantage of b.frames usage.
Teegedeck
27th February 2006, 14:21
Perhaps it's better to include both for now? Say, EHR for 'near lossless' and 'UHR' for an additional 'ultimate (extreme, insane...) quality' preset? See, I kind of would like one really extreme, no-holds-barred preset which even uses GMC and gets us a nice 1 fps on a 3-Ghz-system. :) That could perhaps be done with UHR.
While on the other hand GMC and QPel aren't really necessary for a preset that uses coefficients as low as EHR, perhaps not even VHQ=4, I think, so that mode could be bitrate-hungy but still quite speedy.
CruNcher
27th February 2006, 14:31
I started with something similiar for DVD backups with my EDP build before profiles where introduced for Quality/(Encodeing)Speed, the idea was like Teegedeck showed it based on tests of different material and finding a balanced way between every setting but more based on personal expirience and visual tests that i gathered with XviD over the years. I think whats missing here is also to count in Decodeing complexity for different CE devices @ the moment im working on a Pocket PC profile enhanced for PPC's based on Intel PXA255 400 mhz (QVGA) optimized for Playback with CoreASP and 2h runtime.
Teegedeck
27th February 2006, 15:05
There's certainly a lot of comparison-work looming ahead in the 'extreme compression' department... :) Myself, I rarely use strong compression and mainly reached good results with Javor's 1CD matrix, but Soulhunter's comparisons indicate that Sharktooth's ULR matrix might have an edge. You use the HVS-better matrix?
You might aim for bitrates well below what Sharktooth's ULR is meant for (no lower than 700 kbps on DVD-resolution, I seem to recall), so indeed that might mean either an 'ultra-low-bitrate' profile or perhaps a replacement of the 'fast, extreme compression' profile. I'd prefer the latter in order to keep the number of profiles down. For the time being, can you please list your settings in detail?
laserfan
27th February 2006, 15:25
@shpitz...Sports is generally highly-compressed MPEG-2, DVD-content is lightly-compressed MPEG-2. So you also need to use strong compression in MPEG-4 (XviD) to get reasonable filesaving when transcoding sports while you need only lenient compression for transcoding a DVD, in order to retain its original quality. You not needing to worry about the 'whys' is what presets should be there for. :)It's likely you already understood this Teegedeck, but I just wanted to note that shpitz's NBA game source is prolly 15Mbps, perhaps still "highly-compressed" but certainly very different from DVD.
Maybe everyone here is comfortable that we have lots of HDTV source to work with these days, along with that "ancient technology" DVD stuff. ;)
p.s. Many thanks for this informative thread!!!
Teegedeck
27th February 2006, 15:33
I forgot: We should probably have some curve-compression (formerly evil word). How about
fast, extreme compression: 30,15
good quality, extreme compression: 30,15
good quality: 20,7
high quality: 15,5
very high quality: 10,3
insane quality: none
near lossless: none
anime: 15,5
?
Just guesses. :)
CruNcher
27th February 2006, 15:51
sure and not allways i often test also with ranges of 1 mbit and i find the HVS matrixes scale well from mid to high bitrate ultra low bitrate that i do @ the moment arround 250 kbps it becomes a ringing party :P
1Pass = Q3
Matrix = HVS Better
RC = Foxer cch=50/ccl=50/os=10 B-vops 2/off=100/ratio=150
Advanced Settings = MS=6 VHQ=2 BVHQ=1 ChromaMe=1 Turbo=1 Trellis=1
Good = AQ
Better = AQ + Qpel
Teegedeck
27th February 2006, 16:10
Sounds quite different from what is laid out for 'fast, extreme compression'. It's not compatible and we'd just have to perform a big blind-test to sort it out i.e. see what's better. We can do that later on.
For the time being, perhaps a dedicated 'ultra-strong compression/Pocket-PC' preset then? I'm not quite sure whether Koepi would/could include Foxer's two-pass code, though.
Dams
27th February 2006, 17:30
Teegedeck : excuse me if I don't understand what is the goal of this thread, but why have you choosed only "one pass" and not "two pass" for some of your profiles (best quality) ?
Teegedeck
27th February 2006, 18:08
Sharktooth's EHR matrix is meant for 1-pass constant-quantizer encodes only. It is more like huffyuv and doesn't make sense to use in two-pass. Or did you mistake '1st pass' for '1-pass'?
The goal of this thread is to start a process that should eventually arrive at presets which deliver the full quality that XviD is capable of to any user without the need to acquire any technical insights into XviD. Something like a (much) more humble equivalent to the LAME presets.
And it would be nice to get it started before XviD AVC arrives and takes up a lot of our attention.
mod
27th February 2006, 18:21
it would be nice to get it started before XviD AVC arrives and takes up a lot of our attention.
Yes, it would.. ;)
Dams
27th February 2006, 21:09
Sharktooth's EHR matrix is meant for 1-pass constant-quantizer encodes only. It is more like huffyuv and doesn't make sense to use in two-pass. Or did you mistake '1st pass' for '1-pass'?
The goal of this thread is to start a process that should eventually arrive at presets which deliver the full quality that XviD is capable of to any user without the need to acquire any technical insights into XviD. Something like a (much) more humble equivalent to the LAME presets.
And it would be nice to get it started before XviD AVC arrives and takes up a lot of our attention.
Ok , all is clear now.
But one more question : is "Sharktooth's EHR matrix" is compatible with home divx player ?
I was thinking that only default matrix are only compatible with home divx player, and so, your process could only work with people who read their video on computer ?
Teegedeck
27th February 2006, 21:11
Dunno - depends on your chipset what matrices are compatible with your player. Anyway, XviD's hardware profiles are there to ensure compatibility.
I don't think you want to use EHR vor archiving - it is there for EDITING video because one hour at full resolution means several gigabyte of data.
Teegedeck
1st March 2006, 16:04
I guess that it could be a good idea to re-introduce quantizer-restrictions with presets. That way users would perhaps realize that they could've used a higher-quality preset when they get an undersized 2nd pass, or that they should use a lower-quality preset when they get oversizing.
Undersizing --> 'Use a higher preset!'
Oversizing --> 'Use a lower preset!'
i- & p-frame quantizer(b-frame quantizer):
'fast, extreme compression' (EQM ULR) --> min. 3(4)
'good quality, extreme compression' (EQM ULR) --> min. 3(4)
'good quality, strong compression' (H.263) --> min. 3(4), max. 6(10) (SixOfNine @quant=3 looks better than H.263 @quant=2 and has about the same filesize)
'high quality, medium compression' (SixOfNine) --> min. 2(3), max. 6(10)
'very high quality, medium compression' (SixOfNine) --> min. 2(3), max. 6(10)
insane quality, low compression' --> (EQM UHR) min. 3(4), max. 7(11)
'for editing' (EQM EHR) --> perhaps a forced constant quantizer =2?
'anime' (H.263) --> min. 2(3), max. 6(10)
What do you think? Crap? Or rather fetching?
shon3i
1st March 2006, 16:10
'very high quality, medium compression' (SixOfNine) --> min. 2, max. 7Will be riskly for p frames. Maybe incrase like min2, max8 and for bframes i always put min1 and max2 beacose then b frames only use min 3 and max5, for i frames always put min2 max4.Whith this setting i newer get oversize.
One more question did sixofnine is good for 1cd commpresion bitrate 600-900kbs.
Teegedeck
1st March 2006, 16:20
Will be riskly for p frames. Maybe incrase like min2, max8 and for bframes i always put min1 and max2 beacose then b frames only use min 3 and max5, for i frames always put min2 max4.Whith this setting i newer get oversize.What? Min. 1, max2?!?! Never ever do that! You could as well do a constant quantizer encode or use huffyuv! Did you know that you can restrict b-frame quantizers separately from p-frame quantizers?
Don't restrict quantizers so tightly, rather use different matrices that fit your quality-targets, like in these presets.
One more question did sixofnine is good for 1cd commpresion bitrate 600-900kbs.Oh no, no, no, no, no, absolutely not!!!
To illustrate again what these presets are meant for; these would be my general recommendations for use at full DVD-resolution, no resizing:
'fast, extreme compression' 1 to 2 CD-R encoding
'good quality, extreme compression' 1 to 2 CD-R encoding
'good quality, strong compression' 2 to 3 CD-R encoding
'high quality, medium compression' 3 CD-R or 1/2 DVD-R encoding
'very high quality, medium compression' 3 CD-R or 1/2 DVD-R encoding
insane quality, low compression' --> 1/2 to full DVD-R encoding
'for editing' indredibly huge...
'anime' (H.263) -->1 to 3 CD encoding
I'm beginning to fear that we must perhaps rename the presets to reflect filesize recommendations.
shon3i
1st March 2006, 16:38
@Teegedeck thanx for explanation but i am not sure about this b frame settings. When i restrict to min1 max2 overall picture quality looks better and sharper. That is my notice. Can you suggest me some matrix for 1cd rips bitrate depend on film but never under 550 and never above 1000kbs. I using Jawor CD1 but sometimes h263. Did you have some else good for this range in bitrate.
Teegedeck
1st March 2006, 16:42
Javor's 1-CD matrix is a very good choice. If you read the post that you replied to, again, you'll notice that it mentions Sharktooth's EQM v3 ULR as a matrix for 1- to 2-CD-encoding. You should give that one a try.
shon3i
1st March 2006, 16:46
Javor's 1-CD matrix is a very good choice. If you read the post that you replied to, again, you'll notice that it mentions Sharktooth's EQM v3 ULR as a matrix for 1- to 2-CD-encoding. You should give that one a try.
Thanx a lot.
shpitz
1st March 2006, 16:58
teege, since you're an encoding god, will be so kind to write a technical documents that addresses matrices, quantizers, and all that technical stuff.
i've done a ton of encodings throughout the years, but i've never went down to the nitty-gritty of the process.
i would love to learn what each term actually means, ie, i know what a b-frame is (contains info from before and after frame), but i have no idea when a b-frame is beneficial and when it is not.
i'm kind of a perfectionist and would like to reach max quality in minimum amout of bytes (which i'm sure we all are), and i feel that i'm not really achieving it in a personal level.
another thing that i stuggle with is how to compare results, sometimes i do like 40 encodes of the same clip with different xvid settings and different matrices, but it is very hard for me to find any difference visually after watching the same clip over and over.
and many times i do an encode with let's say using EQM that is meant for low-bitrate, but the result ends up looking like crap compared to the same encode with same script with same xvid settings with the same resulting filesize but with a different matrix.
so it looks to me that a matrix goes well with certain xvid settings, seems to me they are only working well when they are 'packaged' together.
i know this is asking a lot, but could you maybe give me some links for reading material, i would really like to know much more than i know right now...
thanks in advance
Teegedeck
1st March 2006, 18:05
The idea behind making presets is to simplify encoding - at least the non-AviSynth side of it. They should enable users to set up XviD just fine, without bothering about how it works. I myself am not an expert who tweaks each and every XviD setting anew for every source, I am not distinguishing enough to think it necessary.
Most problems come up in setting up a good AviSynth script... As a general rule, it should better be short, throw out everything that's not strictly necessary.
stevewu
1st March 2006, 18:07
Not sure is this the thread where I should put my idea?
If not, please help me move to the right place.
Hi, I am read something about Hexagonal Search and tested the hexagonal search provided by X264. Now I am very interested in put hexagonal search into Xvid( two basic functions has been done). One is simple hexagonal search; another is hexagonal search with inner group refine.
I am trying to put Uneven-cross Multi-Hexagon-grid Search implemented in X264 as X264_ME_UMH.
Here is the question: 1, I have not found out is there any place in Xvid using SAD early termination?
2, Can anybody tell me where I can find it or I have to do the work?
3, I was confused by reading X264_ME_UMH provided by Xvid. They have different classes. Where or who I can approach for the references algorithm document?
Still new to Xvid, but getting interested. So please be kind.
Thanks.
Teegedeck
1st March 2006, 20:12
Not sure is this the thread where I should put my idea?
If not, please help me move to the right place.
[...]Where or who I can approach for the references algorithm document?
Still new to Xvid, but getting interested. So please be kind.
Thanks.No idea, ask on the XviD mailinglist if sysKin doesn't accidentally spot your post and answer it.
Teegedeck
2nd March 2006, 14:07
Moved some off-topic posts: http://forum.doom9.org/showthread.php?t=108079
stevewu
2nd March 2006, 16:37
No idea, ask on the XviD mailinglist if sysKin doesn't accidentally spot your post and answer it.
thanks for advice, I will do that.
I tried your advice on quantizer number, which is very valuable. But when I doing single-pass coding, I noticed, actual quantizer may be bigger than -q max, which is the same problem as bitrate will be bigger than maxrate. I doubt even you give -q max in profile, it is not real -q max machine will stick on.
Teegedeck
2nd March 2006, 23:03
Quantizer-restrictions only work for the 2nd pass of two-pass.
Didée
4th March 2006, 01:58
Quantizer-restrictions only work for the 2nd pass of two-pass.
... and for single pass encoding, they work just as well. :)
Only exception: In single pass, there's no seperate restriction for I-frames. Instead, I-frames use the same restriction as given for the P-frames.
Also note that, in any encoding mode, the restriction given for B-frames is not the "real" maximum quantizer. This value is to be seen in relation to the base quantizer. So, with default B-frame settings 1.50/1.0 (ratio/offset), if you specify a max.quant of "4" for B-frames, they will actually be capped at 4*1.5+1.0 => quant 7.
Teegedeck
4th March 2006, 09:19
Hey, that's real arcane wisdom, thank you!
Although, when i-frame restrictions don't restrict i-frames and b-frame restrictions don't restrict b-frames to the quantizer entered as restriction, I gotta say that stevewu is right. That's not 'properly working' by my standards. ;) OK, gonna adjust the b-frame restrictions accordingly. Thanks again for the info.
Teegedeck
4th March 2006, 10:54
OK, for now EQM v3 LR seems to subjectively (i.e. to my eyes) look better than H.263 and Soulhunter's v6 in the compression ranges of 25-30% at least. This must be subject to more in-depth testing. I dread this part.
Once you start it, there's no end to comparing.
Sharktooth
4th March 2006, 11:57
eh... :)
Teegedeck
4th March 2006, 13:15
Time to remind myself (and everyone interested) that all this is essentially just playing around... :) What I collect here might or might not someday be integrated into XviD. That's up to the devs. And if Koepi might feel at some point like making a build with presets he might or might no use the suggestions from here or modify them.
Should sysKin announce that he has come up with a way to make cross-platform presets and calls for suggestions, then it will get interesting, no doubt.
Caroliano
4th March 2006, 22:51
It's a good iniciative. I would add also an checkbox for "ensure compatibility with Standalones".
I know that it is in profiles dropdown, but it is with an "strange" name and isn't visible at all. As this tread is to help newbies with Xvid setings, I think that this can help too.
CruNcher
5th March 2006, 02:36
"ensure compatibility with Standalones"
that wont work some devices support b-vops some do not SP (first generation SOC's) and ASP (second generation SOC's) how do you wan't to manage that ? and then theres the problem of packed bitstream better is to leave it allways off for any Standalone and Qpel and custom matrices another thing you can't generalize not if you don't wan't to go into compromises on Quality for second generation Chips like the MT1389 series.
Caroliano
5th March 2006, 03:17
Then "ensure compatibility with Divx Certified Standalones".
raeltheimperialaerosolkid
6th March 2006, 14:21
Then "ensure compatibility with Divx Certified Standalones".
This wouldn't be so difficult in terms of features...
The only ones that REALLY create problems are Qpel, Packed bitstream and GMC.
In terms of settings, things could be more compllicated... i.e. SAP have problems with higher resolutions (over 800pixels) and very high bitrate (over 5-6Mbps).
Anyway this could be a way to go. The SAP users are becoming a very big legion...:D
Teegedeck
6th March 2006, 14:34
Again, what do you think the profile dropdown-menu is there for? Right. Hardware-considerations will have no place in presets, their place is the profiles. If the hardware profiles work as they should, they will mercilessly deactivate any feature that isn't profile-compliant. Be it part of the 'preset' or not.
By the way, in course of the weekend I tested with two chapters from LOTR3 (one high-action, one mixed) and a chapter from The Mummy (mixed), producing about 70 clips. Seems to work out like expected. The transition points (forced through capped quantizers) from extreme compression --> high compression --> (V)HQ compression seem quite well-balanced already. Not too narrow space in between the points and the points at quite the right...point. Only that I meditate about giving the recommendations on what preset to use based upon compressibility instead of original VOB-size. Would have the drawback that users who have no clue how to do a compressibility test manually would be lost. Humm.
Also I realized that when XviD hits the capped upper quantizer of a profile in order to prevent quality from going bad (that's wanted behaviour because the presets are quality-presets) the b-frames are scaled surprisingly mildly. (Like, when p-frames are capped at 6, b-frames are scaled to 8. Shouldn't they scale 1.62 x 6 =~10?). I don't know why. (Curve compression?) Maybe I'll try capping b-frames at p-frame quant + 1.
Caroliano
6th March 2006, 19:01
Again, what do you think the profile dropdown-menu is there for? Right. Hardware-considerations will have no place in presets, their place is the profiles. If the hardware profiles work as they should, they will mercilessly deactivate any feature that isn't profile-compliant. Be it part of the 'preset' or not.
I think that the profile drop-down is too hiden, and the divx profiles could be moved to somewere close to the presets, not to be part of the presets. Simple that.
Teegedeck
6th March 2006, 19:23
Too hidden? Well, it's at the very top of the main window; couldn't be less hidden than that IMHO. :)
http://img118.imageshack.us/img118/581/mainwindow5vb.th.png (http://img118.imageshack.us/my.php?image=mainwindow5vb.png)
Caroliano
6th March 2006, 21:18
It is in an rarely used/explained drop down menu, without any indication that going there you can have a Xvid encode compatible with your divx certified DVD. I don't think that it is newbie friendly, IMHO.
foxyshadis
6th March 2006, 21:28
You could call it "Hardware Profile".
Teegedeck
6th March 2006, 21:36
Anyway, there were far more radical proposals (http://forum.doom9.org/showthread.php?p=529757#post529757) for meaningful changes to the GUI (many of them from yours truely :)) but the problem with them is that no-one really cares to invest the time and re-create the XviD GUI. At the moment I, too, would have exciting and wonderful suggestions on how to improve the GUI even more -- but I think you already guessed it: If you want to write a new XviD GUI, please do!
Baseline is, there's not much sense in voicing such wishes in this thread, I'm afraid!
Edit: If you want I can append your posts here to the old thread mentioned above and thus revive it.
Teegedeck
8th March 2006, 16:32
Currently thinking whether for the sake of coherence the 'fast' 3-CD preset should be made a bit faster by deactivating VHQ for b-frames and whether there should be an 'HQ' 2-CD preset that uses EQM HR instead of LR (would using VHQ=4 instead of VHQ=1 plus the use of B-VHQ make up for the growth in filesize so that it would be worthwhile?). On the other hand, it already is a _lot_ of presets IMHO and one doesn't really need such high-quality settings in the middle-of-the-road area (again IMHO). Ahhhrg... I see some more dozen test encodings coming up...
I'd also like to add a max. quantizer restriction to the 1-CD presets - it's called a 'quality' preset after all, not a 'rotten' preset. ;) If it doesn't fit on 1 CD with the '1 CD preset' then you'll have to reduce the resolution, simple 's that...
Edit: And the quantizer restrictions seem to need some tightening in general.
Edit: I'm pretty sure now that after coming to terms with the things above, I'm gonna post a new thread and ask our forum members to help testing some basic but quite specific points.
Teegedeck
9th March 2006, 12:37
Currently thinking whether for the sake of coherence the 'fast' 3-CD preset should be made a bit faster by deactivating VHQ for b-frames and whether there should be an 'HQ' 2-CD preset that uses EQM HR instead of LR (would using VHQ=4 instead of VHQ=1 plus the use of B-VHQ make up for the growth in filesize so that it would be worthwhile?). At least the latter one can be answered with a 'yes'. EQM v3HR with 'HQ' settings produces almost exactly the same filesizes at same quantizer as v3LR with 'fast' settings. So I think there will be two presets for 'strong compression' after all.
On the other hand the 'insane' preset with EQM v3UHR is not worthwhile as it is now. I've tested on a noisy source and while it expectedly occupies roughly the same compressibility range as the medium compression presets with SixOfNine, there's no notable improvement in perceived quality. It seems more sensible to go from SixOfNine straight to using EHR without b-frames for the 'insane' preset. EHR at quant=4 (without b-frames ) yielded about the same filesize as the medium presets (with SixOfNine) at quant=2 and preserved noticeably more detail of that wretched source. Of course we're talking about compressiblity ranges that no-one really uses, here - i.e. 60% of the original DVD's size and more.
Speeding up the 'fast medium' preset seems OK, but I'm still a bit hesitant.
Sharktooth
9th March 2006, 13:36
UHR was tuned down to rise the compression.
The original UHR (rev 1) had 8s in place of 10s and was showing more detailed noise than 6of9 at high bitrates.
It was tested by someone but cant find that thread right now.
Teegedeck
9th March 2006, 14:26
As my first post doesn't reflect the changes made anymore (I kinda made a mess when I accidentally 'lost' the 'fast' setting at strong compression and replaced it with the 'medium' one on the way; and also I changed the 'normal' setting in medium compression...), here's a summary of where these presets stand now:
These presets are meant for two-pass. Of course you can also use the presets for constant-quantizer encoding but it makes little sense. The quantizer restrictions won't work then, so that quality cannot be guaranteed.
We got four categories of speed in the presets and four categories of quality/compression - though not all of them are paired. That is because we don't need 4x4=16 presets; differences would be too small and it would be annoying like heck.
compression categories: extreme, strong, medium, low
speed categories: fast, normal, slow, slower
You realize that I now decided to drop the 'fast' category entirely.
The meaning of the speed categories is:
fast: VHQ=1 [not used]
normal: VHQ=1, VHQ for b-frames
slow: VHQ=4, VHQ for b-frames
slower: VHQ=4, no b-frames, GMC
The meaning of compression categories now is:
extreme: EQM v3ULR, AQ
strong: EQM v3LR or -HR, depending on speed-preset
medium: SixOfNine, QPel
low: EQM v3EHR, QPel
actual pairings: extreme(normal, slow), strong (normal, slow), medium (normal, slow), low (slower)
So we have seven basic presets.
In addition to this we have two presets for special purposes that stand apart:
a fast, 'near lossless' preset for editing, 1-pass only: ME6, VHQ=1, no b-frames, chroma ME, EQM EHR, constant quantizer = 2
an 'anime' 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
The seven basic presets in detail again:
normal extreme compression: VHQ=1, VHQ for b-frames, AQ, EQM v3 ULR, 1st pass @q=4, curve-compr. H30, L15, quantizer-restrictions min. 3, max. 5
slow extreme compression: VHQ=4, VHQ for b-frames, AQ, EQM v3 ULR, 1st pass @q=4, curve-compr. H30, L15, quantizer-restrictions min. 3, max. 5
normal strong compression: VHQ=1, VHQ for b-frames, EQM v3 LR, 1st pass @q=3, curve-compr. H20, L7, quantizer-restrictions min. 3, max. 4
slow strong compression: VHQ=4, VHQ for b-frames, EQM v3 HR, QPel, 1st pass @q=3, curve-compr. H20, L7, quantizer-restrictions min. 3, max. 4
fast medium compression: VHQ=1, VHQ for b-frames, SixOfNine, Qpel, 1st pass @q=3 curve-compr. H15, L5, quantizer-restrictions min. 2, max. 5
slow medium compression: VHQ=4, VHQ for b-frames, SixOfNine, Qpel, 1st pass @q=3, curve-compr. H10, L3, quantizer-restrictions min. 2, max. 5
DVD-R perfect:ME precision=4, VHQ=3, VHQ for b-frames, b-frames 1/1.00/1.00, b-frame sensitivity=-3, SixOfNine, QPel, 1st pass @q=2, no curve-compression, quantizer-restrictions min., 2 max. 3
slower low compression: VHQ=4, VHQ for b-frames, b-frames 1/1.00/1.00, b-frame sensitivity=-3, GMC, EQM v3UHRv1 QPel, 1st pass @q=4, quantizer-restrictions min., 2 max. 4
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.
First pass settings:
Same CQM as in second pass; same b-frame max. nr., ratio, 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.
These are how the settings could actually be named in the config:
normal extreme compression: fast, 1 - 2 CD-Rs
slow extreme compression: HQ, 1 - 2 CD-Rs
normal strong compression: fast, 2 - 3 CD-Rs
slow strong compression: HQ, 2 - 3 CD-Rs
fast medium compression: fast, 3 CD-Rs
slow medium compression: HQ, 3 CD-Rs
slower low compression: insane, 3 CD-Rs - 1 DVD-R
anime
for editing only
And these would be tooltips:
[tooltip for the title:]100 minutes at full resolution (if you get undersizing choose a higher preset, if you get oversizing choose a lower preset)
fast, 1 - 2 CD-Rs: at ~15-25% of original filesize
HQ, 1 - 2 CD-Rs: at ~15-25% of original filesize, apt for sports
fast, 2 - 3 CD-Rs: apt for standard DVD backup at ~25-35% of original filesize
HQ, 2 - 3 CD-Rs: apt for standard DVD backup at ~25-35% of original filesize
fast, 3 CD-Rs: apt for transparent DVD backup at ~30-60% of original filesize, also for noisy sources at >40%
HQ, 3 CD-Rs: apt for transparent DVD backup at ~30-60% of original filesize
DVD-R perfect: apt for transparent DVD-to-DVD-R backup at >90% in Enc comp. check, preserves film-grain MPEG-2-style
DVD-R sharpen: apt for DVD-to-DVD-R backup (clean sources) at >50% of original filesize, also for noisy sources at >60
anime: ?
for editing only: fast, near lossless encoding, huge filesizes, NOT for archiving purposes
Hope I didn't mix anything up. Edit: Already found and corrected some mistakes.
Edit: How to choose the right preset
You can use the percentage of the original VOB-file that you aim for as a pointer. But that only works if you encode at full-resolution and the VOB doesn't contain audio. It's rather a rule of thumb.
You can also do a quick compressibility check with Enc (http://forum.doom9.org/showthread.php?s=&threadid=50714) which should take only 10 minutes or something. This could be a bit more precise. (BTW, it's a good idea to try and keep the full resolution of the source if possible. No sense in encoding 320x at the DVD-R preset...) Just start up Enc, select your .avs, choose 'compressibility check' and enter the filesize you're aiming for in kilobytes. 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 and no other switches at all. (That means, it'll go damn fast...) Then run Enc. The outcome will be a percentage value. And here are pointers as to how to interpret the result:
<30%: bad luck, decrease resolution
>30%: you can use the 1-2 CD preset
>44%: you can use the 2-3 CD preset
>60%: you can use the 3CD - DVD-R preset
>90%: you can use the DVD-R preset
Attention: still not thoroughly tested; if you get over- or undersizing please report!
Edit: After further testing back to UHRv1 for DVD-R preset; also corrected max. quant. for that mode.
Edit: After obviously using the presets at for wrong target-filesizes is not unusual, here's very 'restrictive restrictions'... Try it.
Edit: The presets are hardly overlapping anymore, now. And the extreme preset can not compress that extremely, anymore, really. But at least its results cannot look that bad anymore, either.
Edit: QPel for HQ, 2 - 3 CD-Rs
shpitz
9th March 2006, 14:50
that is an excellent summary, thanks !
Teegedeck
9th March 2006, 15:21
UHR was tuned down to rise the compression.
The original UHR (rev 1) had 8s in place of 10s and was showing more detailed noise than 6of9 at high bitrates.
It was tested by someone but cant find that thread right now.But it does seem OK to use EQM v3EHR instead, keeping in mind that this is meant to represent better quality than the 3-CD preset? Kind of a 'hyper-ultra-super-extra-insane' quality that some people with big disks keep wishing for. EHR @4 seems to make for a smooth transgression from SixOfNine @2. I have only tested this on one source (Closer) as of yet, so I'm not entirely sure.
The 'old' UHR version vs. SixOfNine as contenders for the 'HQ' 2-CD preset would probably be not an easy comparison and I'm a bit weary of testing already ATM.
BigDid
10th March 2006, 04:20
... The only ones that REALLY create problems are Qpel, Packed bitstream and GMC.
In terms of settings, things could be more compllicated... i.e. SAP have problems with higher resolutions (over 800pixels)
Even over 640 width for some
and very high bitrate (over 5-6Mbps)
Even 4mbp/s for some
Anyway this could be a way to go. The SAP users are becoming a very big legion...:D +1
I also have read Teegedeck true reflexion about hardware profile but... it is just my reflexions aloud; Could it be possible -in term of information- or hints to display a "SAP friendly" notice somewhere like:
* normal extreme compression: fast, 1 - 2 CD-Rs
Most "SAP friendly" (custom matrix may not be playable)
* slow extreme compression: HQ, 1 - 2 CD-Rs
Most "SAP friendly" (custom matrix may not be playable)
* normal strong compression: fast, 2 - 3 CD-Rs
Some "SAP friendly" (1/custom matrix may not be playable, 2/Over 2cd may be too much bitrate)
* slow strong compression: HQ, 2 - 3 CD-Rs
Some "SAP friendly" (1/custom matrix may not be playable, 2/Over 2cd may be too much bitrate)
* fast medium compression: fast, 3 CD-Rs
Few "SAP friendly" (1/custom matrix may not be playable, 2/Over 2cd may be too much bitrate, 3/ Qpel seldom playable)
* slow medium compression: HQ, 3 CD-Rs
Few "SAP friendly" (1/custom matrix may not be playable, 2/Over 2cd may be too much bitrate, 3/ Qpel seldom playable)
* slower low compression: insane, 3 CD-Rs - 1 DVD-R
Not "SAP friendly" (GMC not playable)
* anime
Most "SAP friendly" (Over 2cd may be too much bitrate)
* for editing only
Few "SAP friendly" (1/custom matrix may not be playable, 2/Over 2cd may be too much bitrate)
All this if I understand correctly; if not other propositions are welcome.
Did
Teegedeck
10th March 2006, 09:02
It's simply that 'the better the quality, the more probable it is that your hardware player won't play it'! Do you really need another tooltip in order to remember that? ;)
But you can help me telling me one bit: What I thought is that hardware profiles should just deactivate features that don't comply with them. Do they do that? I haven't ever tried it as I don't own a standalone and don't intend buying one.
yaz
10th March 2006, 11:09
@teegedeck
1st of all, big thx for all of your efforts. i'm sure it is the way of bringing down this continuous 'how-to-set' problem.
however, having read your proposal some questions occured to me.
what's the reason of not using b-frames while using gmc at 'slower lo-comp' (very last settings) ? using b-frames will (would) increase compression and decrease speed (esp.w/vhq). so, i can't get it.
as regards gmc itself. imho, it is (can be) useful for anime but 'real movies' benefit insignificantly from it. while it drops down the encoding speed significantly and causes problems for lots of hw players. (note, in most instances, the term 'capable of playing xvid gmc' in feature lists means only that the player wont stop/jerk/hook on s-frames, nothing more)
what is the logic behind the curve-compression settings ? would u point me/us some info about it ? say, i've been never able to figure out what's the difference between H25/L15 and H10/L0. by watching it i can't see the difference. (which accords to my simple math sense) :confused:
further, 'cd-scaled compression' is a bit misleading for me. it prompts sg depending on the aim of the user not on the characteristics of the video stream. some movies may be compressed well to 1cd others may result in horrible quality at the same size. imho, using the percent (compression) scale exclusively would be more adequate here.
as i see, compression is mainly governed by cqms. wout doubting any of your selections what if cqm is not applicable (for any reason) ? remember, lots of ppl encodes for hw players, where cqm may be problematic.
stone-carving me6 prompts that (almost) noise-free sources are considered only. for noisy sources me6 is suboptimal, imho.
it's not obvious how to perform the 1st pass. would it be the same settings or sg different ? if the latter, what exactly ? (if not, why not ? ;) )
pls, take it all as my loud murmur :D (any smell of offense or negativism was unintentional).
thx, again
y
Teegedeck
10th March 2006, 13:54
First of all, thanks for the encouragement! :)
what's the reason of not using b-frames while using gmc at 'slower lo-comp' (very last settings) ? using b-frames will (would) increase compression and decrease speed (esp.w/vhq). so, i can't get it.Well-spotted. The overall concept of these presets is that when you choose higher presets quality rises and speed drops (except for anime & editing presets) but this is of course not always true. While b-frames slow down encoding, they don't improve quality at bitrates/filesizes where you don't really need b-frames anymore. Like, when you transcode a DVD to a DVD-R you don't need b-frames. The 'insane' AKA DVD-R preset is just what it claims to be: insanely slow, insanely high-filesize and insanely high quality. No nonsense and relentless, uncompromising quality...
as regards gmc itself. imho, it is (can be) useful for anime but 'real movies' benefit insignificantly from it. while it drops down the encoding speed significantly[...]As I wrote above, the idea is, quality goes up, speed drops. The highest preset will logically be the one that uses the slowest and highest-quality settings.
Are you sure GMC improves anime signifcantly?
[...] and causes problems for lots of hw players. (note, in most instances, the term 'capable of playing xvid gmc' in feature lists means only that the player wont stop/jerk/hook on s-frames, nothing more)You shouldn't use that preset then. Or manually deactivate GMC after selecting it. But really, if you have selected the correct hardware profile shouldn't GMC be deactivated at any rate? (And BTW, wouldn't any standalone choke on bitates of 3-5 Mbps with peaks of, dunno, 9 Mbps?)
To repeat it once again: These presets are quality-presets, not hardware-presets. Either the hardware-profiles work correctly and then you needn't worry about incompatiblilities because GMC is deactivated automatically or if it doesn't someone should fix hardware-profiles.
These presets are meant to deliver the best quality at full anamorphic resolution for the respective filesize. The filesizes to be covered range from 1 CD to 1 DVD-R. Hardware players are bound to be unable to play back files encoded at best quality settings. In this respect the very concept of quality presets conflicts with standalone compatibility. The solution to this conflict is working hardware profiles. Not the watering-down of quality presets.
If hardware-profiles don't work you'll have to work out up to which preset your standalone still plays back the results. If you have found that point, that is the maximum quality your standalone delivers and henceforth you can forget about the higher presets.
what is the logic behind the curve-compression settings ? would u point me/us some info about it ? say, i've been never able to figure out what's the difference between H25/L15 and H10/L0. by watching it i can't see the difference. (which accords to my simple math sense) :confused:I am not an expert in curve-compression usage myself but some curve-compression is almost always better than none because if you use none, if your 2nd-pass average quantizer is 3.5, the decision which frame is compressed at 3 and which one is compressed at 4 will be rather arbitrary. With CC, the smaller frame should be compressed at 3 and the bigger frame should be compressed at 4. That's the economically sane and psychovisually safe decision. It means 'bitrate' is shuffled from one big frame, where you shouldn't realize much, unto several smaller frames where you would possibly have realized a higher quantizer. The higher the flucuations in a second pass are (bigger quantizers, higher-coefficient matrices), the more important CC should grow. So while I cannot predict whether a user would use a preset at it's upper limit (high quantizers or not) I do know that the lower presets use high-coefficienty CQMs. So that's why these presets also use higher CC-values. One can also guess that the 'fast' presets will trigger higher quantizers in 2nd pass than their 'HQ' counterparts and thus attain slightly higher CC-values to them, too. The visible difference should not be much but, as said, it is better to have some CC than none.
further, 'cd-scaled compression' is a bit misleading for me. it prompts sg depending on the aim of the user not on the characteristics of the video stream. some movies may be compressed well to 1cd others may result in horrible quality at the same size. imho, using the percent (compression) scale exclusively would be more adequate here. You're absolutely right there and I don't like that naming-convention. But a user-reaction (asking whether the medium-compression HQ preset with SixOfNine was good for 1-CD encodes) prompted me to think that there are worse things than vastly inaccurate names - that is to say, giving the user a hint for correct usage that he doesn't understand and thus ignores. So I'm gonna go for the terribly inaccurate indication that at least implies clearly that higher quality will need appropriately higher filesizes anyway and I'd leave the percentages and the 'for noisy sources'-hints to the (hypothetical) tooltips. At least it is a working general pointer: If you want a 1-CD encode of a terribly noisy source the 1-2 CD-preset will be better for that than the 2-CD preset anyway. And if you use the wrong preset you get either undersizing or oversizing but NEVER bad quality... :p
Let's face it; while it's fine for us to check the filesize for some VOBs - which we made sure carry just video, not audio - the average user would possibly prefer an ogg/lamedropxp-like usability: Drag'n drop a video file onto the XviD-proggie which is preconfigured to deliver 1-CD encodes and there it goes. (Such functionality is of course more of AutoGK's or MeGUI's field, but those could use XviD presets, too, like lamedrop uses lame-presets, and it really isn't important where presets are stored.) We have to kinda of bear that in mind. And I think presets as the ones I suggest would offer better usability to those people and also to expert users who could load a preset and then just change a few settings, like usage of GMC, instead of reconfiguring everything again and again manually for different projects.
as i see, compression is mainly governed by cqms. wout doubting any of your selections what if cqm is not applicable (for any reason) ? remember, lots of ppl encodes for hw players, where cqm may be problematic.Read above, I don't concern myself with hardware-incompatibilities. If your player can't play maximum quality, it simply can't. Without CQMs there's really not so much visible difference and presets would be hardly worthwhile
stone-carving me6 prompts that (almost) noise-free sources are considered only. for noisy sources me6 is suboptimal, imho.That is a point I'd really like to delve into. There are voices that recommend ME=4 but I'd like to test that personally in 2-pass thoroughly before I'd accept the enormous waste in filesize/bitrate that this would ensue. If it proves to be worthwhile, ME=4 will have its place in the 'fast' presets that are recommended (in the hypothetical tooltips) for noisy sources (fast 2-CD preset, fast 3-CD preset).
it's not obvious how to perform the 1st pass. would it be the same settings or sg different ? if the latter, what exactly ? Presets would only make sense if the same CQM is used in both passes . And the first pass would be performed at the recommended quantizer, of course. Other than that, fast first pass switches off a lot of things as it is now, too. But I would like fast first pass to use ME=5 instead of 3 because it is much more accurate in filesize-prediction and not so much slower.
pls, take it all as my loud murmur :D (any smell of offense or negativism was unintentional).Thanks again for your interesting comments/questions and the encouragement! You're welcome.
Edited: Lots already. Have you ever tried to edit posts on an ancient computer running Win98? Don't do it, it's hell. I don't know why but some of my edits are gone. And gone again. And again. I have no idea why. I have written the whole darn post at least three times over now! Edit: And now I see why - apparently instead of editing it posted the post anew two times...
shpitz
10th March 2006, 15:52
lol, that's why when i have something long to write, i write it in notepad 1st, then after i'm done i paste into the reply box.
Teegedeck
10th March 2006, 16:21
Come to think of it, I used to do that, too, when I still had Win98 on my own PC. :) Nowadays I tend to forget such security measures, I just keep Firefox open for days and weeks and haven't lost anything for as long as I can remember.
BigDid
10th March 2006, 21:37
... What I thought is that hardware profiles should just deactivate features that don't comply with them. Do they do that? ...
Well it was not the case end of 2005, I remember big trouble for AGK user's when len0x had updated Xvid and the theatre profile kept packed bitstreams instead of removing it, I think it is now corrected but this is one recent example.
Mtk users are lucky because Celtic-Druid is, quite regularly (2 or 3 times a year IMO), updating his MTK and MTK 6000 profiles but it is programming instead of just creating a preset and re-using it.
However, I appreciate the efforts you are making to promote the ease of use for the presets. I read a lot of people have enthusiasm for this project as I do. I believe the actual questions or demands are just reflecting this enthusiasm.
When I will get out of my survivor situation (got a major overvoltage, actually running with an old small Power supply and an old graphic card) I will also try using/testing these presets to be able to speak of concrete experience instead of great notions or ideas (I'm targetting myself only :) )
Continue the good work.
Did
elenhil
17th March 2006, 14:12
Sorry for not being able make it out from all you've written here myself: do quantizer-restrictions min./max. apply to I- & P-frames or to I- & P- & B-frames?
Teegedeck
17th March 2006, 21:44
Well, yes; but b-frame max. quantizers are actually ('given value' x ratio) + offset . It's not really a very meaningful restriction but more of a safeguard; except if you'd set it lower than the max. p-frame quant...
elenhil
18th March 2006, 13:53
What about "anime" preset - can it be optimized for various speed/quality settings or there is really no point in applying different matrices, quantizer-restrictions etc. to such a content?
Teegedeck
18th March 2006, 15:22
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.
elenhil
18th March 2006, 15:52
In fact, I was wondering if there could be lower bitrate settings for anime (well, not anime proper, but for cartoons in general). Something closer to "extreme compression" profile.
Anyway, here's another question: what settings from these profiles should be used in compressibility check?
micmac
18th March 2006, 17:00
Hi guys,
I'd like to have an IPod Video profile as well :)
Why? With xvid 1.0.3 I can just choose Simple Profile L3 and the codec still uses my bitrate and resolution. Say 1000kbit/s and 480x368. With xvid 1.1 it doesn't use my bitrate anymore, it uses ~340 no matter what.
Now I'd have to use AS5 or something and this can be a pain because I don't really know what options the IPod accepts :(
So yes, I really'd like an IPod Video profile.
Thank you!
mic
Teegedeck
18th March 2006, 17:04
Please read the whole thread. This has been talked to death already.
elenhil
18th March 2006, 20:27
It is not addressed to me, is it? My question was what settings from these profiles should be used in a compressibility check? Found no discussion about it in this thread.
As I understand it, owing to quantizer-restrictions these presets limit the resulting filesize themselves (giving under-/oversized results when the content exceeds the limits of a particular matrix' applicability). But it is a rather long way to find that you should have used another preset. Compressibility check can help, or so it seems, but what settings should one use for it? Those for the 1st pass? How exactly do its results (% value) correspond to the possible under-/oversizing?
Teegedeck
18th March 2006, 21:46
Ah, sorry, this was adressed to micmac. (micmac, I'm sorry if hardware-profiles don't work anymore - someone should really fix it then. How about posting to the XviD mailing-list?)
elenhil, use the first-pass-settings given for the preset, yes. As I never do compressibility-checks but only fixed-quantizer-based filesize predictions, I cannot give you precise recommendations as to a percentage that you should aim for. Well, ideally it should be 100%. :) The easiest way is a fixed-quantizer prediction with Enc at the one-but-highest quantizer. If such a filesize predictions exceeds what you are aiming for, then use the next-lower preset. The other way round, if a prediction at the minimum quantizer gives less filesize than you planned for, use the next-higher preset. Certainly one could work out a compressibility-check which would vaguely point to the correct preset to use in one go - and really, I have already thought of that - but, well, I haven't started on finding out how to set this up.
At the moment, just have a look at the recommendations as to 'percentages of original (VOB) filesizes' that I've given. These are rough, yet should be basically reliable. Take a look at the VOBs you want to compress (VOBs that don't contain audio, of course) and calculate at how many percent of their combined size you're aiming.
Like, the 2-3 CD preset being "apt for standard DVD backup at ~25-35% of original filesize". At full resolution (no resizing, just cropping) is always implied
henryho_hk
20th March 2006, 05:48
is it "1st pass" or "one pass" ?
Teegedeck
20th March 2006, 10:05
OK, sorry that I didn't spell that out: If you want to use these presets, you cannot do a first pass at the usual XviD defaults. Most importantly, you have to use the CQM according to the preset, you should use AQ if AQ is mentioned for that preset and you have to set a zone with a constant quantizer that I mention as '...first pass @ quant=....'. Apart from that I'd say use no XviD feature but Trellis and VHQ=1; set ME precision to 5, using Turbo seems a good idea.
henryho_hk
21st March 2006, 04:14
Trellis and VHQ=1; set ME precision to 5, using Turbo seems a good idea.
Actually, I am writing a VBS script to automate all these with the help of the wonderful avs2avi program. Also, the script will insert keyframes at chapter point (by zones) for subsquent OGM & MKV muxing.
Hence, I would like to know the proper way to instruct XviD to use q=3 for all zones for the 1st pass. Is it sufficient to specify the min/max I-quant values? Or must I specify the quant mode for all the zones in the 1st pass and use weight mode in the 2nd pass?
EDIT ---> I just discovered the wonderful xvid_encraw utility! All can be done on a single command line now! No need for any VBScript! For example:
for %%i in (*.avs) do (
start "Pass 1" /b /wait /low xvid_encraw.exe -i %%~ni.avs -type 2 -avi %%~ni_p1.avi -max_bframes 2 -bquant_ratio 162 -bquant_offset 0 -bitrate 1350 -vhqmode 1 -bvhq -qpel -qmatrix Didees-SixOfNine-HVS.cqm -nopacked -imin 2 -imax 5 -bmin 2 -bmax 8 -pmin 2 -pmax 5 -progress 300 -pass1 %%~ni.stats -turbo -quality 5 -zq 0 3
start "Pass 2" /b /wait /low xvid_encraw.exe -i %%~ni.avs -type 2 -avi %%~ni_p2.avi -max_bframes 2 -bquant_ratio 162 -bquant_offset 0 -bitrate 1350 -vhqmode 1 -bvhq -qpel -qmatrix Didees-SixOfNine-HVS.cqm -nopacked -imin 2 -imax 5 -bmin 2 -bmax 8 -pmin 2 -pmax 5 -progress 300 -pass2 %%~ni.stats -quality 6 -chigh 10 -clow 3 -zw 0 1
)
pause
Teegedeck
21st March 2006, 08:11
The min. and max. quantizers (=quantizer-restrictions) work only for the second pass, for the first pass you need to specify the constant quantizer by using a constant quantizer for zones. And in the second pass, it's 'weight=1.00' in the zones, yes. :)
henryho_hk
21st March 2006, 08:23
for the first pass you need to specify the constant quantizer by using a constant quantizer for zones.
I found XviD (1.2 packaged w/ AutoGK 2.27) drops to Q=2~3 after encoding for 30 minutes in the 1st pass even when I put it in constant q=3 mode in all zones (about 37 zones). Any hint?
Teegedeck
21st March 2006, 12:44
Nope, I've never encoded with that many zones (mostly only two) and I've never used AutoGK. I really don't know whether AutoGK allows you complete control over your 1st-pass settings.
henryho_hk
21st March 2006, 13:46
No no no... I used the XviD version bundled w/ AutoGK 2.27.... I did not encode through AutoGK. I used avs2avi.
EDIT -> I have switched to xvid_encraw.exe
Teegedeck
21st March 2006, 16:51
Oh, sorry, you mentioned that above. Perhaps a slip in the commandline? I'm not 'fluent in XviD CLI' myself...
henryho_hk
22nd March 2006, 06:57
Oh, sorry, you mentioned that above. Perhaps a slip in the commandline? I'm not 'fluent in XviD CLI' myself...
There is no such problem after I switched to xvid_encraw (which does support 37 zones :cool:).
In addition, all these presets use 2-pass encoding. What bitrate values can I use for extreme, strong, medium, etc. compression?
Teegedeck
22nd March 2006, 14:08
Bitrates are a sham, don't trust them buggers! :)
Please inform yourself about the relation between content-type, resolution, fps and filesizes.
henryho_hk
23rd March 2006, 07:37
content-type, resolution, fps and filesizes.
As such, how many minutes for a 2 CDR backup of a typical movie is considered an "extreme" compression?
Teegedeck
23rd March 2006, 08:03
Ho-humm - how about actually reading the first post and its upated version before asking such questions? It's all there you just need to read thoroughly.
http://forum.doom9.org/showthread.php?t=107897
http://forum.doom9.org/showthread.php?p=796900#post796900
Edit: OK, the 'minutes'-pointer was missing from the 'updated post'. Still, it's only a sham. All settings are for a purely virtual, non-existing average movie of 100 minutes. A 70-minute-movie may come out larger at the same quantizer than a 120-minute-movie, these are all guestimates. The presets should be quite tolerant. For example, the 3CD preset is allowed to use quantizers from 3-5; this probably means a filesize varying between about (again, for a virtual, non-existing average movie) 2.5 GB and 1 GB. If you hit the sweet spot of usage that it's really meant for it's quant 3 or 4, meaning perhaps 2.5 to 1.5 GB. If you could turn that around, that may well mean you can use this preset to put an average 70-minute movie on 3 CD-Rs as well as an average 120-minute-movie and it would certainly never look bad.
The presets are designed to let you choose a setting by using your intuition. It's doesn't need exact calculations and lets you get away with this huge inaccuracy. You still get well-tuned settings. All this is only possible because XviD doesn't really need to be meticuously tuned for each different movie. All that should be improved over the standard preset courtesy of sysKin is a few things to optimize quality and a safeguard that prevents utter crap.
henryho_hk
24th March 2006, 03:58
I swear that the minute figures were not there :( :( :( :(
Teegedeck
24th March 2006, 07:31
Well, the figures in the second post weren't there because, as I said, I had forgotten them. :)
henryho_hk
25th March 2006, 12:16
I have drafted a batch file implementing the presets. Please enjoy.
Unfortunately, i dunno how to obtain the movie length in commandline. Hence, I am still using bitate as a parameter. The bitrate is for reference only. The file will still be undersize or oversize due to those tight quantizer restrictions.
====> Updated 20060531: corrected the -bmax parameters
====> Updated 20060327: now you can specify the target size in M or in K.
====> Updated 20060406: updated settings & dvd_r preset
====> Updated 20060409: updated settings; presets added: edit_1pass, anime_2pass, dvdr_2pass and (my own) dirty_1pass; all seem to be working
====> Updated 20060409b: fixed a bug in the -zones parameters
====> Updated 20060410: slower_low renamed to dvdr_sharpen; some settings updated
====> Updated 20061004: obsolete old code deleted
Usage:
Save the BAT as, e.g., xvid1xenc.bat
Put it in the same directory as, xvid_encraw.exe, Didees-SixOfNine.cqm, eqm_v3hr_rev1.xcm, eqm_v3lr_rev1.xcm and eqm_v3ulr_rev3.xcm
Command-line is "xvid1xenc.bat <method> <bitrate>", "xvid1xenc.bat <method> <size>K" or "xvid1xenc.bat <method> <size>M"
For <method>, normal_extreme, normal_strong, slow_strong and slow_medium are available. Default is slow_strong.
For <bitrate>, use the defaults or specify one yourself.
To encode, put the avs file (say, input.avs) in the same directory; if you want to have keyframes in chapter points, put a plain text file (say, input_zones.txt) listing the frame numbers on its own lines. After that, run xvid1xenc.bat and wait.
When it finishes, your CPU load goes down to zero. :D
boombastic
25th March 2006, 18:25
How can i use this batch file?Should i put it in the same folder of xvid encrew?How can i tell the source directory?Sorry if i missed something...
Teegedeck
25th March 2006, 21:35
Why don't you put it into your encraw directory and try it out, I'm curious myself! :)
BTW, @henryho_hk::thanks:
squid_80
26th March 2006, 04:35
Nice batch file. :) But what exactly do you mean by this:
Unfortunately, i dunno how to obtain the movie name in commandline. Hence, I am still using bitate as a parameter.?
JoeBG
26th March 2006, 07:10
Very nice skript :)
Maybe two remarks:
-nopacket is no longer needed
-vhqmode 1 is not neede, 1 is default
One question:
-quality 5 for the first pass, why?
squid_80
26th March 2006, 07:24
-nopacket is no longer needed
Not true, packed mode is on by default with avi output.
Unfortunately, i dunno how to obtain the movie length in commandline.Ok now I get it. There's a program somewhere around called avsutil which takes an avisynth script or avi file as a parameter and returns the number of frames in %errorlevel%. Might be useful, if you know the framerate of the material being processed.
(Sorry for getting slightly off-topic.)
Teegedeck
26th March 2006, 10:31
Sorry, henryho_hk, just changed those settings... :D
For the DVD-R preset the orginal idea of using EQMv3 UHRv1 with b-frames 1/1.00/1.00 and sensitivity=-3 is more realistic for not-so-clean sources after all. Also, a max. quant. of 5.
henryho_hk
26th March 2006, 12:34
For the DVD-R preset the orginal idea of using EQMv3 UHRv1 with b-frames 1/1.00/1.00 and sensitivity=-3 is more realistic for not-so-clean sources after all. Also, a max. quant. of 5.
Why do you use UHRv1 but not UHRv2?
And since I can't find b-frame sensitivity option in xvid_encraw, your "slower_low" preset is not implemented. :P
BTW, squid_80, I have 4 questions on xvid_encraw.exe
Is there a "discard 1st pass" option?
How can I enable the chroma optimizer option for zones?
Is there a b-frame sensitivity option for zones?
Should I use some -qtype value for custom matrices?
squid_80
26th March 2006, 13:15
BTW, squid_80, I have 4 questions on xvid_encraw.exe
Is there a "discard 1st pass" option?
How can I enable the chroma optimizer option for zones?
Is there a b-frame sensitivity option for zones?
Should I use some -qtype value for custom matrices?
To discard 1st pass, simply don't specify an output file (drop the -avi switch).
B-frame sensitivity and chroma optimizer can be specified only using the alternative -zones switch. For the format see this post: http://forum.doom9.org/showthread.php?p=702759#post702759
It should be possible to use multiple -zones switches instead of separating them with a /.
Older versions required -qtype 1 in addition to -qmatrix <matrix> in order to work correctly. This has been fixed since then. But it would probably be better to be safe and add it to the command line anyway.
Teegedeck
26th March 2006, 14:25
Why do you use UHRv1 but not UHRv2? Because v1 yields results that are hardly different from SixOfNine encodes. v1 produces larger files but there is a visible difference. So it fits for a DVD-R preset. EHR produces files too large for even the DVD-R preset.
henryho_hk
27th March 2006, 02:22
B-frame sensitivity and chroma optimizer can be specified only using the alternative -zones switch.
It is possible to omit the end frame of zones in this switch? Getting the end frame is a bit too complicated for this simple batch, especially since I can't find anywhere to download "avsutil.exe" now. Also, XviD 1.1's configure panel/registry does not require specifying the end frames.
squid_80
27th March 2006, 03:45
avsutil. (http://forum.doom9.org/showthread.php?p=798368#post798368) I haven't tested this build though, I compiled it myself using the source code given in the same thread.
Sorry I forgot I dropped the end frame parameter for zones, it is meant to be left out.
A zone will run until the start of the next zone or the end of the movie, same as in the vfw config.
Teegedeck
27th March 2006, 09:27
Very nice skript :)
One question:
-quality 5 for the first pass, why?Sorry, forgot about that question. ATM ME precision 4 is XviD's default for 1st pass AFAIK which is not much different from ME precision 3. This is superbly fast but delivers very inaccurate results in terms of filesize-prediction if you use VHQ etc. in 2nd pass. An unprecise prediction results in quite unnecessary quantizer-fluctuations in 2nd pass. The general recommendation is to use a full-quality first pass if one aims for highest quality. But that is of course much slower than it needs to be. Especially if your full-quality first pass includes VHQ=4. I think ME precision 5 is a good compromise, much more accurate and still much faster than a full-quality first pass.
BTW, I just might radically revamp that DVD-R preset and this might include using ME precision=4... In such a case the first pass should also be done at 4, of course.
henryho_hk
29th March 2006, 01:21
The script is updated.
BTW, I was using Didees-SixOfNine-HVS.cqm but not Didees-SixOfNine.cqm. Do the outcomes differ much?
henryho_hk
29th March 2006, 01:26
B-frame sensitivity and chroma optimizer can be specified only using the alternative -zones switch.
Thank you very much. I have updated the script accordingly. Does the syntax support a negative B-frame sensitivity value? The value does not seem to affect my test clip outputs.
Teegedeck
29th March 2006, 01:34
The script is updated.
BTW, I was using Didees-SixOfNine-HVS.cqm but not Didees-SixOfNine.cqm. Do the outcomes differ much?Yes, they do. The HVS-version produces an output that's less sharp and aims at slightly lower filesizes.
henryho_hk
29th March 2006, 02:20
Yes, they do. The HVS-version produces an output that's less sharp and aims at slightly lower filesizes.
I have reverted to the non-HVS version now.
BTW, could you please help to verify the quant. min/max settings? For i-min=2, i-max=5 and b-ratio=1.62, does it mean that p-min=i-min, p-max=i-max, b-min=i-min and b-max=roundup(i-max*1.62)=roundup(8.1)=9 ?
tehpwner2
29th March 2006, 02:28
Ok so where are the following settings in the xvid program??
(1st pass @q=3, curve-compr. H10, L3, quantizer-restrictions min. 2, max. 6)
I've just recently installed Xvid1.1.0 but I'm not sure what you're talking about here.
squid_80
29th March 2006, 04:02
Does the syntax support a negative B-frame sensitivity value? The value does not seem to affect my test clip outputs.
I'm 90% percent sure it does. I think you'd need to use a large -max_bframes setting to test properly.
firered
31st March 2006, 19:55
[QUOTE=Teegedeck
low&fast medium&fast strong&fast
low&norm medium&norm strong&norm
low&slow medium&slow strong&slow
[
Speed
As for the 'speed' axis, I'd suggest
line 1 could imply ME 5, no VHQ, no chroma ME
line 2 could imply ME6, VHQ=1, VHQ for b-frames, chroma ME
line 3 could imply ME6, VHQ=4, VHQ for b-frames, chroma ME
'near lossless' or 'for editing' could imply ME6, VHQ=4, VHQ for b-frames, b-frames 1/1.0/1, chroma ME and GMC + Sharktooth's UHR matrix and would be meant specifically for near-lossless encoding.
'anime' could trigger using the H.263 matrix, cartoon mode(!), a mild b-frame setting like ratio 1.0, offset=1, ME6, VHQ=1, VHQ for b-frames, chroma ME.
those presets you mentioned you use them as well for 2nd pass?
Teegedeck
31st March 2006, 22:09
You really shouldn't quote such a lengthy post just to ask one simple question.
The answer is: Yes, of course. Those are settings for the 2nd pass. I'm gonna change that post in order to make clear what the 1-pass settings should look like.
BigDid
1st April 2006, 00:35
+1
Please shorten your post (by editing it)
Even with page scrolling, I had to scroll down 5 times. For a lazy guy like me this is awful :D (this is a joke as the smiley indicates it)
Thank you.
Did
firered
1st April 2006, 20:23
You really shouldn't quote such a lengthy post just to ask one simple question.
The answer is: Yes, of course. Those are settings for the 2nd pass. I'm gonna change that post in order to make clear what the 1-pass settings should look like.
Thanks for showing those presets it help me out alot, the only thing that is a little confusing is that are the presets for both 2 pass or just for the 2nd pass
shon3i
1st April 2006, 20:58
I tested some presents for DVD backup and all work great, I think what about overflow treatment what to set, i in most cases use 0/4/9 or 0/5/5. Teegedeck can you put overflow treatment in presents. Thanks
Teegedeck
3rd April 2006, 16:08
Alas, I have little experience with overflow settings, I always keep the defaults because I don't care much about some MB over- or undersizing. :-\
Something completely different:
I have come up with a first, still very untested way of determining the right preset to choose via compressibility-testing: It's at the bottom of the up-to-date preset-post (http://forum.doom9.org/showthread.php?p=796900#post796900). Help testing if you feel like it.
shon3i
3rd April 2006, 21:04
Alas, I have little experience with overflow settings, I always keep the defaults because I don't care much about some MB over- or undersizing. :-\
I don't know where is that treat about overflow treatment on this forum but 0/5/5 have big and better quantizers distribution but not over/undersize instead 5/5/5. sysKin somewhere thold that but i can remeber. Anyway thanks
Something completely different:
I have come up with a first, still very untested way of determining the right preset to choose via compressibility-testing: It's at the bottom of the up-to-date preset-post. Help testing if you feel like it.Very useful. Can you put this on the first page or put to sticky.
shpitz
3rd April 2006, 21:11
Very useful. Can you put this on the first page or put to sticky.
i second that !
i missed it myself and that is a critical piece of information right there ;-)
thanks Teege for all your hard work, i really appreciate it. it is all starting to come together for me. thanks !
Teegedeck
3rd April 2006, 21:39
Well, this is really just testing some stuff out but good if it helps you. :)
I hope that someday we will have these or similar presets actually accessible in the GUI.
Things that still need extensive testing now are: Determining how to change the DVD-R preset (the current one oversharpens which is OK for clean sources but I'm gonna at least add another DVD-R preset with SixOfNine, optimized for sources with film-grain). Checking out whether the 'fast' presets should perhaps also get different settings for coping better with grain. Overflow treatment.
Once this has more or less been tackled I think I'm gonna wrap that post up and open a new thread.
shpitz
3rd April 2006, 21:51
hehe.
i think you should also give some recommendations for DVB capture of some sort since this is, i think, becoming a major source, not only DVDs and VHSs.
since DVB is an mpeg2 that is highly compressed i wonder if there is something that can be done to ease the pain of watching the SD capture after seeing HD :D
BigDid
4th April 2006, 00:36
Hi Teegedeck,
There might be a typo in the edited clean-up:
The seven basic presets in detail again:
* normal extreme compression: VHQ=1, AQ, EQM v3 ULR, 1st pass @q=4, curve-compr. H30, L15, quantizer-restrictions min. 3, max. 5
It seems the VHQ for B-frames disappeared :confused:
Did
shpitz
4th April 2006, 01:05
ok Teege, i've done the following compression test:
a football match from DVB capture, 544x480 30fps.
i've done a compression test shooting for 2 cds (1400mb).
settings for the test were set just as you described, 5% extended method.
the football match is 1hr 42mins and the compression test using vdubmod took just over 6mins.
the compression test yielded 45.85% so i chose 'HQ, 1 - 2 CD-Rs: at ~15-25% of original filesize, apt for sports'.
i split the encode into 2 cds, cd1 came out around 50mb undersized while cd2 came out 105mb undersized (i'm excluding audio).
i've used the following simple script:
mpeg2source("F:\football1.d2v",iPP=true,cpu=0,moderate_h=25,moderate_v=30)
colormatrix()
LeakKernelDeint(order=1, sharp=true, forceCPU=5)
Crop(8,6,-14,-14)
bicubicResize(640,480,0,0.75)
how can i get closer to my target size? the resulting bitrate was around 1600, i would much rather have it fill the whole 700mb per cd and get much higher bitrate.
thanks
Teegedeck
4th April 2006, 07:07
Hi Teegedeck,
There might be a typo in the edited clean-up:
It seems the VHQ for B-frames disappeared :confused:
DidThanks for keeping a watchful eye! :) Though actually I dropped it from the 'fast' and 'normal' presets. Note to myself: add 'testing whether this really is a good idea' to my to-do list.
@shpitz: Well, the idea is that whenever you get undersizing you choose a higher preset. Thanks for the help in testing. BTW, didn't a 45% result point to using the 2-3CD preset? Of course a prediction based one comp-tests isn't an exact science. I'm gonna lower the threshold for the 2-3CD recommendation to 44% then.
firered
4th April 2006, 07:32
yea the presets are working for me just have tweak them a little change a value to get what im looking for but hey thanks for doing this
neutrogenik
4th April 2006, 12:01
I have a small question : how do you do "no b-frames" ?
NeD tHe OnE
4th April 2006, 13:22
I have a big problem with presets given in this thread ... "
slow extreme compression: VHQ=4, VHQ for b-frames, AQ, EQM v3 ULR, 1st pass @q=4,
curve-compr. H30, L15, quantizer-restrictions min. 4, max. 7
"
I get way undersized files .. But after making some changes like quantizer-restrictions min. 1, max. 31 .. I get perfect Video size with good quality...!
Can anyone explain?
Teegedeck
4th April 2006, 13:35
YES:
Firstly, you got the quant-restrictions wrong; for 'extreme' it is 'min. 3, max. 5', now.
If that doesn't solve it there is these general rules on how to use the presets:
If you get undersizing use a higher preset
If you get oversizing use a lower preset
If you get oversizing at the lowest preset, decrease your resolution
Starting out with full resolution (anamorphic, no resizing) would be a good idea.
:)
Thanks for reporting back anyway!
And BTW, quant=1 is just there to waste bits, using it doesn't make sense.
shpitz
4th April 2006, 13:39
Teege,
my problem is how do i approach a situation like this?
i mean, i got it undersized, how can i pre-determine what the bitrate should be in order to fill 700mb with video? is there a formula or a calculation i can make to find out?
for example, i got around 1600kbps average and the file turned out to be around 50mb short of my target. can i estimate what the bitrate should be in order to achieve the desired filesize?
also, is there a way to know that it will be undersized BEFORE i do a full encode of the source? waiting 4hrs just in order to see if i'm right on target is a total waste of time... or is it?
thanks
EDIT: also Teege, how do i set "curve-compr. H30, L15" ? not setting that could've resulted in undersized encode?
Teegedeck
4th April 2006, 13:49
Ahem (http://forum.doom9.org/showthread.php?p=808661#post808661).
I have a small question : how do you do "no b-frames" ?max. consec. b-frames=0
for example, i got around 1600kbps average and the file turned out to be around 50mb short of my target. can i estimate what the bitrate should be in order to achieve the desired filesize?If your first attempt is undersized just use the next-higher preset. Each higher preset can produce results that are a few hundred MBs bigger than the next-lower preset. So the second guess should always be right and it should never be necessary to encode the same video three times.
You did a compressibility check to determin which preset to use and it came out just on the border between two presets. So your first attempt could go wrong. I'm sorry i tightened those presets a little but I felt it necessary. The undersizing is a pointer that you don't get the best quality you could get with that preset.
NeD tHe OnE
4th April 2006, 13:50
Teege,
I am trying 2 rip 704*272 res, length 96 mins VOB file to Xvid same res (if its possible or will go for resizing ) 96 kbps vorbis [for 1CD]... and if i want to go for 2 CD then i'll choose higher preset with 6ch vorbis 300 kbps audio
Now my question is which preset should for either these and what should be the resolution?
Thank you
shpitz
4th April 2006, 14:34
thanks for the information, i will experiment more with it.
EDIT: also Teege, how do i set "curve-compr. H30, L15" ? not setting that could've resulted in undersized encode?
can you answer that question as well?
thanks
shon3i
4th April 2006, 14:43
Starting out with full resolution (anamorphic, no resizing) would be a good idea.Did you mean always to try to encode @ 720x576 only crop for example 720x400.
Teegedeck
4th April 2006, 14:50
Now my question is which preset should for either these and what should be the resolution?That differs from movie to movie, so there is no general answer. The naming of the presets ("1-2CD", "2-3CD"...) is just a general pointer and assumes using full resolution - more like 704x432 than like 704x272. Here's some hints:
If you get undersizing use a higher preset
If you get oversizing use a lower preset
If you get oversizing at the lowest preset, decrease your resolution
Starting out with full resolution (anamorphic, no resizing) would be a good idea. (http://forum.doom9.org/showthread.php?p=809083#post809083)I have come up with a first, still very untested way of determining the right preset to choose via compressibility-testing: It's at the bottom of the up-to-date preset-post (http://forum.doom9.org/showthread.php?p=796900#post796900). Help testing if you feel like it.I hope that helps.
also Teege, how do i set "curve-compr. H30, L15" ? not setting that could've resulted in undersized encode?Nope, all you should do is choose a higher preset. Sorry, that means doing both passes again. :( You set the curve-compression in the two-pass settings; accessible if you click on the 'more'-button next to the second pass filesize.
BTW, since when am I 'Teege'? If you have to use a short form of my nick, 'Tee' is traditional. :)
Did you mean always to try to encode @ 720x576 only crop for example 720x400.Right on! :) (Though most of the time it's something like '704x432'.) Crop away the black bars completely and keep in mind that the resulting resolution must be a multiple of 16 (even though this means cropping into the picture) in order to avoid problems with some hardware. Use XviD's aspect ratio feature and the movie will automatically resize to 16:9 on playback (i.e. to 1024x432 or something).
It's darn easy, you only ever use one of two AR settings. Either 16:9 or 4:3. I'm reffering to Pixel Aspect Ratio settings: For anamorphic movies use '16:9 PAL' or '16:9 NTSC' accordingly; for TV content use '4:3 PAL/NTSC'.
For correct playback, enable ffdshow's 'allow output format changes during playback' and 'use
overlay mixer' options in its 'output' tab.
NeD tHe OnE
4th April 2006, 15:05
YES:
Firstly, you got the quant-restrictions wrong; for 'extreme' it is 'min. 3, max. 5',
So , where will i find "correct" preset settings ...
NeD tHe OnE
4th April 2006, 15:09
And as u said "Starting out with full resolution (anamorphic, no resizing) would be a good idea." then Bits/(pixel*frame) would be less ... and by doing that the output might be of low quality
Teegedeck
4th April 2006, 15:15
So , where will i find "correct" preset settings ...In front of your nose! Sorry but if you want answers you have to read them. How many times do I have to link to this post (http://forum.doom9.org/showthread.php?p=796900#post796900) till you realize it?
And as u said "Starting out with full resolution (anamorphic, no resizing) would be a good idea." then Bits/(pixel*frame) would be less ... and by doing that the output might be of low qualityNo, it won't. If you mess up your encode will be oversized.
One more time:
If you get undersizing use a higher preset
If you get oversizing use a lower preset
If you get oversizing at the lowest preset, decrease your resolution
which you might also translate as:
If your bitrate is too high for the chosen quality you get undersizing
If your bitrate is too low for your chosen quality you get oversizing
If your chosen resolution is too high you'll get oversizing even at the lowest quality preset
NeD tHe OnE
4th April 2006, 15:18
What shd b d optimum Bits/(pixel*frame) value 4 1cd and 2 cd?
NeD tHe OnE
4th April 2006, 15:20
Thank You SIR
Teegedeck
4th April 2006, 15:20
None! Forget that bits and pixel thing. This is a completely different system. It forces you to encode at good quality, the only thing you have to do is to find out which preset fits and I described in detail how that works (either percentage of original VOB or compr. check). Edit: OK, OK, you probably could base your decision on Bits/(pixel*frame) values but please don't, it's imprecise. Rather use a compressibility check.
Edit: Where I do get your meaning, I hope is, that if you already have to use the 'extreme' preset you could think about lowering resolution even before your get actual oversizing. But in your case I'd well think about using full resolution.
Edit(2): No need for 'Sir-ing' me; but I really don't like to repeat the same things over and over. The top line of the very first post of this thread links to the valid presets and it says "Read an up-to-date version of the presets here" in shiny, blue letters. Did you mistake that for a heading instead of a link? I'll try to make that more clear. Also I've linked to them several times in the last few posts of mine. Sorry if I came across as rude.
shon3i
4th April 2006, 15:26
Bits/(pixel*frame) i think is only good for DivX3 SBC.
Teegedeck
4th April 2006, 15:37
The bits'n'pixel thing is meant for guessing a fitting resolution before/without doing a compr. check. But the guesses it allows are so unprecise that I refuse to give recommendations based upon it. Even looking at the size of the original VOBs gives you a better idea on which preset to use. It's also not really needful because you're not supposed to adjust your resolution unless the 'extreme' preset gives you oversizing.
NeD tHe OnE
4th April 2006, 15:54
So while we are encoding the resolution should be like this '720*420' The resulting video will be stretched bu height and while playin we can use 16:9 AR for correct AR ....
Is this good?
Teegedeck
4th April 2006, 15:56
Yes, actually it is what DVD-players (and DVD playback apps like WinDVD) do.
Edit: Note that the lowest preset is called '1-2CD preset'. It rarely works storing a movie in full resolution onto 1 CD with XviD at good quality! I encourage people to go for 2 or 3 CD-Rs. Compressibility checks are incredibly helpful.
shpitz
4th April 2006, 16:35
BTW, since when am I 'Teege'? If you have to use a short form of my nick, 'Tee' is traditional. :)
LOL, note taken. i will call you Mr. T from now on hehe
NeD tHe OnE
4th April 2006, 16:37
Yes, actually it is what DVD-players (and DVD playback apps like WinDVD) do.
Edit: Note that the lowest preset is called '1-2CD preset'. It rarely works storing a movie in full resolution onto 1 CD with XviD at good quality! I encourage people to go for 2 or 3 CD-Rs. Compressibility checks are incredibly helpful.
So what should we do? If we want a 90 mins movie backup only for 1 CD
Teegedeck
4th April 2006, 16:43
Well; do a comp. check. If it comes out lower than 30% reduce the resolution. Reduce the resolution till the comp. check comes out 30% or higher. That should about equal an average quant=4.
(Remember that the % recommendations are yet based on only few tests yet; but 30% seems a good value from all we know till now. If you want it more precise do a size prediction with Enc instead of a comp. check. Set XviD to the 'extreme' preset in Enc and set it to one-pass at constant quant=4. If that comes out to a bigger filesize than you aimed for, then you definitely have to reduce resolution.)
Edit: The 'extreme' presets allow for max. quant=5 in order to benefit from curve-compression but quant=5 should never be constant. So try to avoid getting near oversizing at the extreme preset.
shon3i
5th April 2006, 14:31
Teegedeck i must to ask why in this two present won't use QPEL, QPEL helps in low bitrate, i ask this becouse i wanna put DVD's at full resoulution on averge duration 1:30 hours @ 700mb.
normal extreme compression: VHQ=1, AQ, EQM v3 ULR, 1st pass @q=4, curve-compr. H30, L15, quantizer-restrictions min. 3, max. 5
slow extreme compression: VHQ=4, VHQ for b-frames, AQ, EQM v3 ULR, 1st pass @q=4, curve-compr. H30, L15, quantizer-restrictions min. 3, max. 5
shpitz
5th April 2006, 14:53
If you get undersizing use a higher preset
If you get oversizing use a lower preset
If you get oversizing at the lowest preset, decrease your resolution
ok, i've done a 2nd encode, this time i went to a higher preset, from originally using "slow extreme compression: HQ, 1 - 2 CD-Rs" which yielded 650mb file instead of 700mb, to the "slow strong compression: HQ, 2 - 3 CD-Rs" which yielded 850mb instead of 700mb.
1. how can i get it close to my target size if it is so unpredictable?
2. when i encode, in xvid settings for 2nd-pass, should i calculate bitrate using the calc button or should i just set a target size in the editbox to 700mb?
in the 2nd encode that yielded 850mb i used the calc function to calculate the bitrate, could that be the thing that threw the outcome out the window? was i supposed to only tell xvid 2nd pass that i want a filesize of 700mb?
thanks
Teegedeck
5th April 2006, 18:11
ok, i've done a 2nd encode, this time i went to a higher preset, from originally using "slow extreme compression: HQ, 1 - 2 CD-Rs" which yielded 650mb file instead of 700mb, to the "slow strong compression: HQ, 2 - 3 CD-Rs" which yielded 850mb instead of 700mb.To exclude the possibility that this is merely a miscalculation: You actually wanted the video to be 700 MBs big? No audio? So you did enter a destination filesize of 716800 KB? XviD doesn't care how you arrive at the size that you enter in the dialogue box, it just aims at reaching that figure. I would use GKnot to calculate the video size.
The target filesize in the main windows is really the only figure that counts. If XviD doesn't reach it, there's something wrong with the presets. And you can make sure by doing a filesize prediction in Enc at constant quantizer; the highest allowed quantizer (from the quant. restrictions) of a preset should always produce a smaller filesize than the lowest allowed quantizer of the next-lower preset.
Teegedeck i must to ask why in this two present won't use QPEL, QPEL helps in low bitrate, i ask this becouse i wanna put DVD's at full resoulution on averge duration 1:30 hours @ 700mb.Actually it is highly disputed at which levels of compression Qpel helps and it is also a matter of taste. The only thing everyone agreed on (up till now) was that it certainly isn't useful at very strong compression. High quantization --> motion vectors get shorter --> QPel which makes long motion vectors more precise doesn't help (also QPel itself uses additional bits, thus triggering slightly higher quantization).
Putting a DVD onto 1 CD-R at full resolution might or might not work with these quality presets. Use Enc for filesize-prediction, configure it to the extreme preset but do a constant-quantizer one-pass at quantizer=4. If the predicted filesize is too high you should not even try it and rather turn to AVC.
Teegedeck
5th April 2006, 18:22
Some stuff from my list.
Things that still need extensive testing now are: Determining how to change the DVD-R preset (the current one oversharpens which is OK for clean sources but I'm gonna at least add another DVD-R preset with SixOfNine, optimized for sources with film-grain).
Done. Many, many thanks to Didée for his tremendous technical insights! Without you I'd never even have tried that.
Checking out whether the 'fast' presets should perhaps also get different settings for coping better with grain.Nope, they're actually better the way they are now.
Overflow treatment.Pending.
Note to myself: add 'testing whether this really is a good idea' to my to-do list.Nope, certainly not. The speed gain is not worth the quality-loss. B-VHQ back in for all presets!
Working on wrapping up that post now...
shon3i
5th April 2006, 19:37
Actually it is highly disputed at which levels of compression Qpel helps and it is also a matter of taste. The only thing everyone agreed on (up till now) was that it certainly isn't useful at very strong compression. High quantization --> motion vectors get shorter --> QPel which makes long motion vectors more precise doesn't help (also QPel itself uses additional bits, thus triggering slightly higher quantization).
Putting a DVD onto 1 CD-R at full resolution might or might not work with these quality presets. Use Enc for filesize-prediction, configure it to the extreme preset but do a constant-quantizer one-pass at quantizer=4. If the predicted filesize is too high you should not even try it and rather turn to AVC.This is very interesting answer, i must ask how you backup DVD's to XviD, did you put it to 1,2,3 CD,DVD. I am nearly switched to x264 but his is so slow, i get with enc about 35% at compresivity test for most movies in 2 hours range in time, XviD for me have good picture at low rates but sometimes is whrose, i can't wait until XviD AVC come into public.
Teegedeck
5th April 2006, 21:10
35% sounds OK to me.
I put 2 movies onto 1 DVD-R, occasionally only one movie per DVD-R. My idea of a backup is that it should be undistinguishable from the original. So I'm quite comfortable with XviD, not much need for using AVC yet.
henryho_hk
6th April 2006, 06:00
The speed gain is not worth the quality-loss. B-VHQ back in for all presets!
"slow strong" is looking too similar to "normal strong".... both are at VHQ=1. Should "slow strong" use VHQ=4 too?
Can I use VHQ=1 in the first pass for all slow presets?
[trying to update my script file too....]
Teegedeck
6th April 2006, 08:49
Oh, I'm sorry - it seems I only ever said 'In the first pass I'd like to see ME=5 instead of =4, meaning the rest should be set up as in XviD's default first-pass. But that doesn't suffice, so as we're at it now:
First pass settings:
Same CQM as in second pass; same b-frame max. nr., ratio, 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.
Thanks for noticing!
As for 'slow strong' --> 'normal strong'. [Well, yes, the only difference between the 'normal' and the 'slow' speed is the VHQ level. But this difference is still good for 50%-100% speed improvement for the fast setting. The idea is that the fast settings should produce almost the same quality as the HQ settings but simply at a much better speed.]
Sorry, I read your post before I had my coffee! Indeed, you have spotted a typo. Thanks a lot! :)
I'm a sloppy typer; I need your sharp eyes!
(The new DVD-R preset doesn't fit into these categories, it's dedicated to sacrifice efficiency for the sake of accurate reproduction of the source - which incidentally means it's quite fast.)
shon3i
6th April 2006, 15:23
I put 2 movies onto 1 DVD-R,That is about 3cd per movie, that is almost near the lossless encodig.
occasionally only one movie per DVD-R.Why should copy simply this DVD to another whitout recompression
So I'm quite comfortable with XviD, not much need for using AVC yet.
XviD is great solution becouse have near quality to the AVC, but XviD devs now stoping updating him, XviD now need small optimizations like better AQ, Skal now work on XviD AVC and i think is right time to jump to AVC when XviD AVC come up. I now working some movies with XviD and some with x264.
Teegedeck
6th April 2006, 15:43
That is about 3cd per movie, that is almost near the lossless encodig.
Why should copy simply this DVD to another whitout recompressionBeeep! Wrong answer. :) The last time I checked the average size of the VOBs containing a movie was around 5 GB, and that's not counting audio. The available space on a DVD-R is about 4480 MB. Half a DVD is about 2240 MB. Try (real) lossless codecs and see how the filesize darts up to several dozen GBs (somewhere around 30 GB, I guess)...
I think it's nifty if I have a 1:1 copy of a movie at 35-40% of the original filesize. Add to that the costs and I don't understand why anyone would want to go for anything less. Half a DVD costs about 60 Cents over here so the utmost possible saving if you go for 700 MBs instead would be 40 Cents; using CD-Rs you would even loose money on the deal.
Even if occasionally I compress only down to 70% or something in order to fit one single movie onto one DVD-R, this is still better than recompressing in MPEG-2. It delivers an absolutely perfect copy while MPEG-2 shows annoying signs of overquantization. Note that I only do that when I have a movie where I want to keep the film-grain in. But as a rule you get a copy that is undistinguishable from the original at >40% of that original's filesize with XviD. That's why the '3CD-R preset' is described as 'transparent'.
shon3i
6th April 2006, 17:48
The last time I checked the average size of the VOBs containing a movie was around 5 GBYes that is correct becouse DVD's is recording to DL disks.
Try (real) lossless codecs and see how the filesize darts up to several dozen GBs (somewhere around 30 GB, I guess)...
Yes, right but picture isn't bad with that high bitrate for 2,2GB bitrate should be over 1500kbs that for XviD is insane for averge 1:30 hours duration of movie
It delivers an absolutely perfect copy while MPEG-2 shows annoying signs of overquantization.Hmm, i see that error's on picture when try to shrink some long movie, i agree with you about that.
In all cases your right.
henryho_hk
6th April 2006, 18:00
...First pass settings...
My script is now in sync w/ your presets again:
http://forum.doom9.org/showpost.php?p=804680&postcount=87
Please see if I have made any typo too. :D
Teegedeck
6th April 2006, 20:51
Yes, right but picture isn't bad with that high bitrate for 2,2GB bitrate should be over 1500kbs that for XviD is insane for averge 1:30 hours duration of movie.Naw... "XviD shows to be 60% more efficient than MPEG-2",* that doesn't sound insane to me... :D Now, compressing movies at full res onto single CD-Rs, that does sound insane to me. ;) (Just joking, it sounds interesting.) Throwing away half the resolution by going 640x272 or something, such stuff sounds insane, too.
*= Same quality at 40% of the size of MPEG-2
...You see, it's all a matter of perspective. For me, sacrifing any of the original quality is totally out of the question; for you using more than a defined amount of space seems out of the question.
shon3i
6th April 2006, 21:11
Now, compressing movies at full res onto single CD-RsI can't belive that you newer try to put movie to single CD-R with sound. For me XviD give perfect quality in bitrates 800-900 per movie @ 640x272
*= Same quality at 40% of the size of MPEG-2Yes it's insane but is not that whorse. How about this "put 3 hours movie with AVC and with 5.1 HE-AAC" is not that whrose but never can be like original of course.
BigDid
6th April 2006, 21:47
Naw... "XviD shows to be 60% more efficient than MPEG-2",* that doesn't sound insane to me... :D Now, compressing movies at full res onto single CD-Rs, that does sound insane to me. ;) (Just joking, it sounds interesting.) Throwing away half the resolution by going 640x272 or something, such stuff sounds insane, too. ...
On the opposite side, there was an interesting fun/testing encode discussion for a KingKong encode on 3,2Gb: http://forum.doom9.org/showthread.php?p=809648#post809648
RonSpencer used MP3 128 CBR, but with DTS sound, it could approach the full 1DVD size limit :)
Did
Teegedeck
6th April 2006, 21:59
Im a simple-minded kinda guy; all this talking about bits/pixels/frames/compressiblity>100% etc. confuses the hell out of me! :D And in the end all the calculating amounts to keeping bloated DTS-sound but not going anamorphic, eh? :)
BigDid
6th April 2006, 22:02
I can't belive that you newer try to put movie to single CD-R with sound. For me XviD give perfect quality in bitrates 800-900 per movie @ 640x272 ...
Hi,
This is near my goal: 1/5 DVD, 640width, 900 to 1200kb/ps and VBR MP3 up to 176kb/ps. But I will not say "perfect quality", rather good to very good quality (that is IMO).
To achieve perfect quality or rather "video transparency" IMO I will have to use some of the "HQ, 2 - 3 CD-Rs" preset and as I will keep the AC3 5.1, the file size will rise to 1/3 or 1/2 DVD depending on the movie length.
All this for use in a MTK SAP and as soon as I will be able to encode again (I have received the replacements but have my serialHD main partition gone havoc :( )
Did
BigDid
6th April 2006, 22:10
Im a simple-minded kinda guy; all this talking about bits/pixels/frames/compressiblity>100% etc. confuses the hell out of me! :D And in the end all the calculating amounts to keeping bloated DTS-sound but not going anamorphic, eh? :)
It is
1/ for discussion fun
2/ the delight of AGK (the 100%stuff)
As stated in the above post If I want full sound I keep the 5.1 AC3 not the DTS but -for discussion- if I want to use Shrink for a concert DVD you advise me to keep the 5.1 AC3 not the DTS? Could you detail?
Did
shon3i
6th April 2006, 22:15
But I will not say "perfect quality", rather good to very good quality (that is IMO).
I agree with you but XviD have perfect quality for that bitrate, comparing to other non-AVC codecs. Right
Btw my goal is to put movie to one CD-R, but sometimes is that no good idea.
Teegedeck
6th April 2006, 23:50
As stated in the above post If I want full sound I keep the 5.1 AC3 not the DTS but -for discussion- if I want to use Shrink for a concert DVD you advise me to keep the 5.1 AC3 not the DTS? Could you detail?Personally I would never keep DTS. Because I know that I cannot tell the difference between DTS and AC3 but can very well tell the difference between good and bad video quality.
BigDid
7th April 2006, 02:55
Personally I would never keep DTS. Because I know that I cannot tell the difference between DTS and AC3 but can very well tell the difference between good and bad video quality.
That's a very good point, I'll go back compare DTS and AC3 :cool:
Thanks for answering.
Did
shon3i
7th April 2006, 13:13
@BigDid you must have a big ear to see that different's.
Teegedeck
8th April 2006, 13:48
QPel would seem to begin to make sense from the '2-3CD-R HQ' preset upwards according to my tests/taste, so I'm probably gonna update that soon. BTW, do users really single-mindedly look at hints for the 'bitrate' that a preset aims for? We all know that naming schemes like '1-2CD-Rs', '2-3CD-Rs' etc. are treacherous. Just now I did a movie which compresses so well that it amounts to 600 MB at full resolution using the '2-3CD-R HQ' preset... I'd much prefer a neutral, funny naming scheme like "S, M, L, XL..." ;)
shpitz
8th April 2006, 17:14
Just now I did a movie which compresses so well that it amounts to 600 MB at full resolution using the '2-3CD-R HQ' preset... I'd much prefer a neutral, funny naming scheme like "S, M, L, XL..." ;)
can you elaborate on that? what was the compression % you got from Enc?
Teegedeck
8th April 2006, 17:28
Actually I did constant-quant filesize predictions instead, but I still can do a compressibility check and give you the results later. Anyway, when I ran my usual filesize prediction at my preferred '3CD - DVD-R HQ' preset at constant quant=3 the predicted filesize came out as 1140 MB... It's only 90 minutes but still... As the picture is horribly lowly detailed I decided to devote only around 600 MB to the movie, just to be able to say I did a 1-CD encode for once! :)
Edit: The comptest for 600MB filesize shows 55%. And indeed, at the '2-3CD-R HQ' preset the outcome was almost constant quant=3. This seems to go quite well along the lines of comp. percentages we have established so far but not perfectly.
Further comp. checks showed a picture like this: Predicted filesize for '2-3CD-R' at constant quant=3 (lowest allowed quantizer) is 633 MB (probably representing 58% compressibility), predicted filesize for '3CD-R - DVD-R' at constant quant=4 (highest allowed quantizer) is 586 MB; so the presets only slightly overlap but the filesize would have been reached using either preset(!). That's good. For this movie 655 MB probably represent the '60%-border' on which using the 3CD-R-DVD-R preset is recommended - and that would be just slightly above what the 2CD-preset could produce. So, for this movie 58% (I need to do the actualy comp-test, just caculated the value) already would have been the actual border from which upowards one you should have used the higher preset; at 59% you would have got slight undersizing with the lower preset. Maybe we should shift the barrier down by a percent or two?
It's not an exact science...
I guess there's a lot of comp. checks in front of us...
henryho_hk
9th April 2006, 07:28
I have updated my script (http://forum.doom9.org/showthread.php?p=804680#post804680) again to include all presets (except for the anime preset, because xvid_encraw's -cartoon switch is not working).
Please don't be offended by the bitrate settings, since they are dominated by the quantizer settings.
edit: anime preset should be working now! thanks to joebg & squid_80!
JoeBG
9th April 2006, 11:14
I have updated my script (http://forum.doom9.org/showthread.php?p=804680#post804680) again to include all presets (except for the anime preset, because xvid_encraw's -cartoon switch is not working).
Please don't be offended by the bitrate settings, since they are dominated by the quantizer settings.
-cartoon is available in zones. You can set a zone from the beginning to end and enable this option.
shpitz
9th April 2006, 14:32
Actually I did constant-quant filesize predictions instead, but I still can do a compressibility check and give you the results later. Anyway, when I ran my usual filesize prediction at my preferred '3CD - DVD-R HQ' preset at constant quant=3 the predicted filesize came out as 1140 MB... It's only 90 minutes but still... As the picture is horribly lowly detailed I decided to devote only around 600 MB to the movie, just to be able to say I did a 1-CD encode for once! :)
Edit: The comptest for 600MB filesize shows 55%. And indeed, at the '2-3CD-R HQ' preset the outcome was almost constant quant=3. This seems to go quite well along the lines of comp. percentages we have established so far but not perfectly.
Further comp. checks showed a picture like this: Predicted filesize for '2-3CD-R' at constant quant=3 (lowest allowed quantizer) is 633 MB (probably representing 58% compressibility), predicted filesize for '3CD-R - DVD-R' at constant quant=4 (highest allowed quantizer) is 586 MB; so the presets only slightly overlap but the filesize would have been reached using either preset(!). That's good. For this movie 655 MB probably represent the '60%-border' on which using the 3CD-R-DVD-R preset is recommended - and that would be just slightly above what the 2CD-preset could produce. So, for this movie 58% (I need to do the actualy comp-test, just caculated the value) already would have been the actual border from which upowards one you should have used the higher preset; at 59% you would have got slight undersizing with the lower preset. Maybe we should shift the barrier down by a percent or two?
It's not an exact science...
I guess there's a lot of comp. checks in front of us...
this just totally doesn't make any sense lol
you got from 2-3cd preset 633mb and with the 3cd-dvd preset you got 586mb??? it's contradicts any logic i had...
can you explain?
Teegedeck
9th April 2006, 15:35
If you quoted only the parts that mattered you might have understood:
Predicted filesize for '2-3CD-R' at constant quant=3 (lowest allowed quantizer) is 633 MB (probably representing 58% compressibility), predicted filesize for '3CD-R - DVD-R' at constant quant=4 (highest allowed quantizer) is 586 MB; so the presets only slightly overlapYou better be a thorough reader before 'lolling'...
Seriously, you don't have to understand any- and everything about how these things called 'presets' work if you just want to use them; that's what they are there for after all: making encoding to excellent results with XviD a no-brainer. :) But if you feel compelled to take part in this discussion I expect you to at least make a serious attempt at comprehension.
Shall I draw you a picture? Well:
http://img83.imageshack.us/img83/1748/picture19ms.png (http://imageshack.us)
Note that these MB values are for the movie 'Flightplan' - and those '0 MB' are definitely wrong...;)
For your average movie I'd expect MB values to be about three times as high as those above.
Edit: The presets need to overlap or otherwise you'd get under- or oversizing very often. If on the other hand they'd overlap too much the presets wouldn't really enforce quality. Looking at the curious results of 'Flightplan', you might also understand why I don't like the 'bitrate-based' naming-convention of the presets.
Teegedeck
10th April 2006, 10:58
Corrected: Max. quant for 'DVD-R perfect' preset should be '3', not '4'! Max. quant for 'DVD-R sharpen' preset should be '4', not '5'! It's high time I get this 'wrapping up' of the thing done...
I know that this creates a very slight 'gap' between the '3CD-R' and the 'DVD-R perfect' preset and a larger gap between the '3CD-R' and the 'DVD-R sharpen' preset. Maybe we should allow min-quant=2 for the 3CD-R preset. Or redefine the DVD-R presets somewhat differently. Let's see...
henryho_hk
10th April 2006, 12:50
Max. quant for 'DVD-R sharpen' preset should be '4'
I want to implement this preset but I can't find it in http://forum.doom9.org/showthread.php?p=796900#post796900
Teegedeck
10th April 2006, 13:04
Ah, I use the 'catchy' names; it's also known as 'slower low compression'. The same post with 'DVD-R sharpen' highlighted (http://forum.doom9.org/showthread.php?p=796900#post796900&highlight=dvd-r&sharpen).
Plamen234
16th April 2006, 15:28
suggest an approach, please
1. HR/UHR @ higher max Q
or
2. the MPEG matrix @ lower max Q (or even without B-frames)
p.s.: 1 movie on 1 dvd-r, full res, (anamorphic)
Teegedeck
16th April 2006, 16:20
Had you read this thread you wouldn't need to ask this question.
Hi All!
I was wondering if some one could make some MeGUI profiles for the presets on page 5 or 6, I don't remember which. I would do it myself except I can't find all of the parameters mentioned and I don't understand some of the other parameters.
Can someone do this please?
Thanks!
Teegedeck
3rd May 2006, 21:06
Hmmm.... Why not, really? Anyone out there who has more time than I got on my hands?
buzzqw
3rd May 2006, 22:22
i tryed with my mkvmagic... and some of these works.
In latest build (1.16) on xvid panel there are prove of your great works !
any tips is more than welcome
BHH
Teegedeck
4th May 2006, 07:22
Thanks for integrating them into your application! :) Does mkvmagic set a preset automatically or does the user have the choice? (I can't find that in the documentation.) (Ah! Found it! In the XviD CLI-tab...)
Uh-oh, now that they get actually used I really have to do that 'cleaning up' that I promised to do a long time ago...
buzzqw
4th May 2006, 08:15
Thanks for trying mkvmagic !
in next release i have update the routines for dumping xvid setting (now will dump only the first pass upon click "WriteCMD")
The preset are a good start but user can freely change settings.
whenever you will uppdate the preset i will update too :thanks:
BHH
Is there a good preset for encoding Disney/Pixar animations? You know - Bugs Life, Toy Story, Monsters Inc, Ice Age, etc.
Also, whats the best preset for straight up cartoons like Tarzan, Winnie the Pooh, etc?
Teegedeck
4th May 2006, 10:39
There's been some posts in this thread about the 'anime-preset'. In broad terms the anime-preset is also apt for CG animation as well as for 'cartoons'. If you have enough space try the CG matrix for CG animation - but restrict max. quantizers to '3'. If you get oversizing you'd better stick with H.263 quantization.
And yes, cartoon-mode it is...
Teegedeck
7th May 2006, 14:29
Can anyone help this old man cross the street? I can't load CQMs in MeGUI; only H.263 or MPEG quantization is available from the Main tab and in the Zones tab the fields for loading quantizer matrices aren't functional. Is it only me?
shon3i
7th May 2006, 15:20
Can anyone help this old man cross the street? I can't load CQMs in MeGUI; only H.263 or MPEG quantization is available from the Main tab and in the Zones tab the fields for loading quantizer matrices aren't functional. Is it only me?
MeGUI now not support XviD matrices, but you can load with xvid_encraw with comandline. Aslo i don't now how xvid_encraw need two matrices one for inter and one for intra. I don't now how to split to two parts.
Teegedeck
7th May 2006, 15:58
Thanks. So implementing those presets in MeGUI will have to wait.
sander815
7th May 2006, 17:55
how do i use these presets?
Teegedeck
7th May 2006, 18:33
With your keyboard and mouse, the usual way. ;)
Damn! I was really hoping to jump right on to these presets. Oh well, I will just have to wait until matrices are unlocked.
shon3i
8th May 2006, 13:57
@Teegedeck i just ask MeGUI devs for this look this (http://forum.doom9.org/showthread.php?p=824872#post824872)
Teegedeck
13th May 2006, 21:35
Some posts moved here (http://forum.doom9.org/showthread.php?p=827049#post827049).
berrinam
20th May 2006, 10:13
Hi there,
MeGUI has supported xvid CQMs for a little while now, and it also has a reliable profile import/export function which manages the CQM files as well as the profiles. Furthermore, these archives can be installed by the AutoUpdate system I just added. If someone wants to make a set of profiles, I will be happy to include it in MeGUI's AutoUpdate files so that they are easily accessible.
Teegedeck
20th May 2006, 12:04
Many thanks! :)
So, I'm gonna give it a go in the course of next week.
Edit: Alright! I didn't realize that dev-builds were not hosted on sourceforge. With build 2146 CQMs just work. Fine, fine.
MatMaul
21st May 2006, 03:58
I have drafted a batch file implementing the presets. Please enjoy.
Unfortunately, i dunno how to obtain the movie length in commandline. Hence, I am still using bitate as a parameter. The bitrate is for reference only. The file will still be undersize or oversize due to those tight quantizer restrictions.
====> Updated 20060327: now you can specify the target size in M or in K.
====> Updated 20060406: updated settings & dvd_r preset
====> Updated 20060409: updated settings; presets added: edit_1pass, anime_2pass, dvdr_2pass and (my own) dirty_1pass; all seem to be working
====> Updated 20060409b: fixed a bug in the -zones parameters
====> Updated 20060410: slower_low renamed to dvdr_sharpen; some settings updated
Usage:
Save the BAT as, e.g., xvid1xenc.bat
Put it in the same directory as, xvid_encraw.exe, Didees-SixOfNine.cqm, eqm_v3hr_rev1.xcm, eqm_v3lr_rev1.xcm and eqm_v3ulr_rev3.xcm
Command-line is "xvid1xenc.bat <method> <bitrate>", "xvid1xenc.bat <method> <size>K" or "xvid1xenc.bat <method> <size>M"
For <method>, normal_extreme, normal_strong, slow_strong and slow_medium are available. Default is slow_strong.
For <bitrate>, use the defaults or specify one yourself.
To encode, put the avs file (say, input.avs) in the same directory; if you want to have keyframes in chapter points, put a plain text file (say, input_zones.txt) listing the frame numbers on its own lines. After that, run xvid1xenc.bat and wait.
When it finishes, your CPU load goes down to zero. :D
@echo off
setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
set WAY=%1
set SIZ=%2
if /I not "%WAY%"=="dirty_1pass" if /I not "%WAY%"=="edit_1pass" (
if /I not "%WAY%"=="normal_extreme" if /I not "%WAY%"=="slow_extreme" (
if /I not "%WAY%"=="normal_strong" if /I not "%WAY%"=="slow_strong" (
if /I not "%WAY%"=="normal_medium" if /I not "%WAY%"=="slow_medium" (
if /I not "%WAY%"=="anime_2pass" if /I not "%WAY%"=="dvdr_perfect" (
if /I not "%WAY%"=="dvdr_sharpen" set WAY=normal_strong
)
)
)
)
)
if /I "%SIZ:~-1%"=="M" (
set /a SIZ1=!SIZ:~0,-1! * 1024
set SIZ=-size !SIZ1!
) else if /I "%SIZ:~-1%"=="K" (
set /a SIZ1=!SIZ:~0,-1!
set SIZ=-size !SIZ1!
) else (
if "%SIZ%"=="" (
if /I "%WAY%"=="dirty_1pass" set SIZ=9999
if /I "%WAY%"=="edit_1pass" set SIZ=9999
if /I "%WAY%"=="normal_extreme" set SIZ=1000
if /I "%WAY%"=="slow_extreme" set SIZ=1000
if /I "%WAY%"=="normal_strong" set SIZ=1400
if /I "%WAY%"=="slow_strong" set SIZ=1400
if /I "%WAY%"=="normal_medium" set SIZ=1800
if /I "%WAY%"=="slow_medium" set SIZ=1800
if /I "%WAY%"=="anime_2pass" set SIZ=1400
if /I "%WAY%"=="dvdr_sharpen" set SIZ=2700
if /I "%WAY%"=="dvdr_perfect" set SIZ=4500
)
set SIZ=-bitrate !SIZ!
)
if /I "%WAY%"=="dirty_1pass" (
set PP0=-single -cq 4 -max_bframes 2 -bquant_ratio 162 -bquant_offset 0 -vhqmode 1 -qtype 1 -qmatrix apps\eqm_v3lr_rev1.xcm -nopacked -quality 6 -nochromame -turbo
set ZBS=
set NUMPASS=1
)
if /I "%WAY%"=="edit_1pass" (
set PP0=-single -cq 2 -max_bframes 0 -vhqmode 1 -qtype 1 -qmatrix apps\eqm_v3uhr_rev1.xcm -nopacked -quality 6
set ZBS=
set NUMPASS=1
)
if /I "%WAY%"=="normal_extreme" (
set PP1=-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 9 -pmin 3 -pmax 5 -quality 5 -nochromame -turbo
set PP2=-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 9 -pmin 3 -pmax 5 -quality 6 -chigh 30 -clow 15 %SIZ%
set P1Q=4
set ZBS=
set NUMPASS=2
)
if /I "%WAY%"=="slow_extreme" (
set PP1=-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 9 -pmin 3 -pmax 5 -quality 5 -nochromame -turbo
set PP2=-max_bframes 2 -bquant_ratio 162 -bquant_offset 0 -vhqmode 4 -bvhq -lumimasking -qtype 1 -qmatrix apps\eqm_v3ulr_rev3.xcm -nopacked -imin 3 -imax 5 -bmin 3 -bmax 9 -pmin 3 -pmax 5 -quality 6 -chigh 30 -clow 15 %SIZ%
set P1Q=4
set ZBS=
set NUMPASS=2
)
if /I "%WAY%"=="normal_strong" (
set PP1=-max_bframes 2 -bquant_ratio 162 -bquant_offset 0 -vhqmode 1 -qtype 1 -qmatrix apps\eqm_v3lr_rev1.xcm -nopacked -imin 3 -imax 4 -bmin 3 -bmax 7 -pmin 3 -pmax 4 -quality 5 -nochromame -turbo
set PP2=-max_bframes 2 -bquant_ratio 162 -bquant_offset 0 -vhqmode 1 -bvhq -qtype 1 -qmatrix apps\eqm_v3lr_rev1.xcm -nopacked -imin 3 -imax 4 -bmin 3 -bmax 7 -pmin 3 -pmax 4 -quality 6 -chigh 20 -clow 7 %SIZ%
set P1Q=3
set ZBS=
set NUMPASS=2
)
if /I "%WAY%"=="slow_strong" (
set PP1=-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 7 -pmin 3 -pmax 4 -quality 5 -nochromame -turbo
set PP2=-max_bframes 2 -bquant_ratio 162 -bquant_offset 0 -vhqmode 4 -bvhq -qtype 1 -qmatrix apps\eqm_v3hr_rev1.xcm -nopacked -imin 3 -imax 4 -bmin 3 -bmax 7 -pmin 3 -pmax 4 -quality 6 -chigh 20 -clow 7 %SIZ%
set P1Q=3
set ZBS=
set NUMPASS=2
)
if /I "%WAY%"=="normal_medium" (
set PP1=-max_bframes 2 -bquant_ratio 162 -bquant_offset 0 -vhqmode 1 -qtype 1 -qmatrix apps\Didees-SixOfNine.cqm -nopacked -imin 2 -imax 5 -bmin 2 -bmax 9 -pmin 2 -pmax 5 -quality 5 -nochromame -turbo
set PP2=-max_bframes 2 -bquant_ratio 162 -bquant_offset 0 -vhqmode 1 -bvhq -qpel -qtype 1 -qmatrix apps\Didees-SixOfNine.cqm -nopacked -imin 2 -imax 5 -bmin 2 -bmax 9 -pmin 2 -pmax 5 -quality 6 -chigh 15 -clow 5 %SIZ%
set P1Q=3
set ZBS=
set NUMPASS=2
)
if /I "%WAY%"=="slow_medium" (
set PP1=-max_bframes 2 -bquant_ratio 162 -bquant_offset 0 -vhqmode 1 -qtype 1 -qmatrix apps\Didees-SixOfNine.cqm -nopacked -imin 2 -imax 5 -bmin 2 -bmax 9 -pmin 2 -pmax 5 -quality 5 -nochromame -turbo
set PP2=-max_bframes 2 -bquant_ratio 162 -bquant_offset 0 -vhqmode 4 -bvhq -qpel -qtype 1 -qmatrix apps\Didees-SixOfNine.cqm -nopacked -imin 2 -imax 5 -bmin 2 -bmax 9 -pmin 2 -pmax 5 -quality 6 -chigh 10 -clow 3 %SIZ%
set P1Q=3
set ZBS=
set NUMPASS=2
)
if /I "%WAY%"=="anime_2pass" (
set PP1=-max_bframes 2 -bquant_ratio 100 -bquant_offset 1 -vhqmode 1 -qtype 0 -nopacked -imin 2 -imax 6 -bmin 2 -bmax 6 -pmin 2 -pmax 6 -quality 5 -nochromame -turbo
set PP2=-max_bframes 2 -bquant_ratio 100 -bquant_offset 1 -vhqmode 1 -bvhq -qtype 0 -nopacked -imin 2 -imax 6 -bmin 2 -bmax 6 -pmin 2 -pmax 6 -quality 6 %SIZ%
set P1Q=2
set ZBS=C
set NUMPASS=2
)
if /I "%WAY%"=="dvdr_sharpen" (
set PP1=-max_bframes 1 -bquant_ratio 100 -bquant_offset 1 -vhqmode 1 -qtype 1 -qmatrix apps\eqm_v3uhr_rev1.xcm -nopacked -imin 2 -imax 4 -bmin 2 -bmax 4 -pmin 2 -pmax 4 -quality 5 -nochromame -turbo
set PP2=-max_bframes 1 -bquant_ratio 100 -bquant_offset 1 -vhqmode 4 -bvhq -qpel -gmc -qtype 1 -qmatrix apps\eqm_v3uhr_rev1.xcm -nopacked -imin 2 -imax 4 -bmin 2 -bmax 4 -pmin 2 -pmax 4 -quality 6 %SIZ%
set P1Q=4
set ZBS=-3
set NUMPASS=2
)
if /I "%WAY%"=="dvdr_perfect" (
set PP1=-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 3 -pmin 2 -pmax 3 -quality 4 -nochromame -turbo
set PP2=-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 3 -pmin 2 -pmax 3 -quality 4 %SIZ%
set P1Q=2
set ZBS=-3
set NUMPASS=2
)
for %%i in (*.avs) do (
@echo off
set ZP1=-zones 0,q,%P1Q%,KO%ZBS%
set ZP2=-zones 0,w,1,KO%ZBS%
if exist %%~ni_zones.txt for /f %%f in (%%~ni_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
rem @echo on
if !NUMPASS! EQU 2 (
echo start "%WAY% - Pass 1" /b /wait /low apps\xvid_encraw.exe -i %%~ni.avs -type 2 -pass1 %%~ni.stats -progress 100 %PP1% !ZP1!
start "%WAY% - Pass 1" /b /wait /low apps\xvid_encraw.exe -i %%~ni.avs -type 2 -pass1 %%~ni.stats -progress 100 %PP1% !ZP1!
echo start "%WAY% - Pass 2" /b /wait /low apps\xvid_encraw.exe -i %%~ni.avs -type 2 -avi %%~ni_p2.avi -pass2 %%~ni.stats -progress 100 %PP2% !ZP2!
start "%WAY% - Pass 2" /b /wait /low apps\xvid_encraw.exe -i %%~ni.avs -type 2 -avi %%~ni_p2.avi -pass2 %%~ni.stats -progress 100 %PP2% !ZP2!
)
rem if
if !NUMPASS! EQU 1 (
echo start "%WAY%" /b /wait /low apps\xvid_encraw.exe -i %%~ni.avs -type 2 -avi %%~ni_1p.avi -progress 100 %PP0% !ZP2!
start "%WAY%" /b /wait /low apps\xvid_encraw.exe -i %%~ni.avs -type 2 -avi %%~ni_1p.avi -progress 100 %PP0% !ZP2!
)
rem if
)
rem for
pause
after few test, I think bmax must be equal to imax (and pmax).
I think the encoder does the calculation for the max bframes, according to this encode :
C:\Documents and Settings\MatMaul\Bureau\xvid_encraw>xvid_encraw -i "test.avs" -
type 2 -pass2 -bitrate 1000 -max_bframes 2 -bquant_ratio 162 -bquant_offset 0 -z
ones 0,w,1,O -quality 6 -vhqmode 4 -bvhq -qpel -nopacked -imin 2 -imax 5 -pmin 2
-pmax 5 -bmin 2 -bmax 5 -chigh 10 -clow 3 -max_key_interval 250 -progress -mkv
"test.mkv"
xvid_encraw - raw mpeg4 bitstream encoder written by Christoph Lampert 2002-2003
Trying to retrieve width and height from input header
Input colorspace is YV12
xvidcore build version: xvid-1.2.0-dev
Bitstream version: 1.2.-127
Detected CPU flags: ASM MMX MMXEXT SSE SSE2 TSC
Detected 1 cpus, using 1 threads.
1501 frames(100%) encoded, 7.23 fps, Average Bitrate = 1150kbps
Tot: enctime(ms) =207655.00, length(bytes) = 8633712
Avg: enctime(ms) = 138.25, fps = 7.23, length(bytes) = 5748
I frames: 22 frames, size = 15178/ 333931, quants = 4 / 4.77 / 5
P frames: 874 frames, size = 8073/7056415, quants = 2 / 4.99 / 5
B frames: 604 frames, size = 2058/1243366, quants = 4 / 7.93 / 8
With -bmax 5, I obtain a lot of bframes with quant 8 (5*1.62=8.1)
Teegedeck
21st May 2006, 09:28
Please try to keep your quotes short; quote only what's necessary.
With -bmax 5, I obtain a lot of bframes with quant 8 (5*1.62=8.1)That's just how it should be. Or didn't I get what you wanted to ask?
MatMaul
21st May 2006, 13:19
Sorry for the quote.
In your profile, bmax=5 for example (slow_medium) then the real max quant for bframes is 8.
henryho_hk uses directly bmax=9, so I think it's not good : I think he must use bmax=imax=pmax=5, and the encoder does the calculation itself.
Teegedeck
21st May 2006, 17:05
Indeed, I guess you're right there.
henryho_hk
22nd May 2006, 02:17
henryho_hk uses directly bmax=9, so I think it's not good : I think he must use bmax=imax=pmax=5, and the encoder does the calculation itself.
Thank you very much for pointing it out!
I will double-check with the usage.txt file. :) :) :)
-------------------------------------------------------
edit: My batch file is updated. ^_^
Teegedeck
31st May 2006, 20:40
Just an update: Creating profiles for MeGUI ran into some slight problems; the options HQ AC Coeffcients and Chroma Optimization in MeGUI don't seem to be supported by xvid_encraw (http://forum.doom9.org/showthread.php?p=779261#post779261) and indeed they don't get stored in the XML-files. (These are not an integral part of the presets as in this thread but it just bothered me because I'd wanted to use chroma-opt. and I spent some time on that.) And - strangely - lumimasking always is active when I load my profiles although nothing like that is in the XML-file. Gonna have another look at that and file a bug report.
Sharktooth
1st June 2006, 01:25
yes please, report all the problems with xvid. we are in the bug-fixing phase before releasing a stable version of megui.
squid_80
1st June 2006, 10:41
Creating profiles for MeGUI ran into some slight problems; the options HQ AC Coeffcients and Chroma Optimization in MeGUI don't seem to be supported by xvid_encraw (http://forum.doom9.org/showthread.php?p=779261#post779261) and indeed they don't get stored in the XML-files. And - strangely - lumimasking always is active when I load my profiles although nothing like that is in the XML-file.
Chroma optimizer is possible with my encraw via zones. I don't know exactly what HQ AC coefficients is but I have a hunch it's one of the things that is set depending on the -quality option.
The lumimasking thing: you mean MeGUI always passes it in the commandline or encraw is using it without being told to?
Teegedeck
1st June 2006, 10:41
Actually that was my mistake. I was too sloppy and overlooked that [edit:] the parameter 'LumiMasking' seems to be deprecated; I should have set 'AdaptiveQuant' to 'false'. Strange, as AdaptiveQuant doesn't seem to be an encraw input option.
Valeron
5th June 2006, 01:56
questions about preset for anime(XviD 1.1 final):
i encode an episode good detail Basilisk DVD with different settings of QPel(not recommend in your preset), GMC and Cartoon mode with 1st pass only. B frame 1/1.0/1, constant Q2, H.263 quantization. Trellis, VHQ1, VHQ for B, chroma optimization.
from the 1st pass result in the XviD status, with QPel on, bitrate increase about by 1.8%, it tends to code more I frame and reduce total number of P and B frames;with GMC on, bitrate decrease by1.2%; with Cartoon mode on, bitrate incredibly decrease up to 4.1%!:eek:
that is, with QPel only, you should produce the largest filesize and possible the best detail(theoretically), and with GMC and cartoon mode on, you can get the smallest filesize at the same quant(but in principle, GMC is very implementation dependent, cartoon mode definitely hurt details too).
my question is, do XviD 1.1 change a bit in this point or even make my knowledge outdated?
question in another perspetive: does XviD do bits saving with GMC and cartoon mode on(for this good detail anime) in way with quality degradation?
Teegedeck
5th June 2006, 09:14
The effects of encoding features on bitrates you have found are well-known and true. (If you did only a first pass, I assume that you did a zone-based first pass like described in the presets? Otherwise you wouldn't see any differences because Qpel and GMC aren't used in the standard 1st pass.)
Qpel makes for 1-2% bigger files, GMC saves about 0.5% (and is very slow), cartoon mode saves about 4%. As there is visually hardly anything to gain from Qpel in anime, and as the savings from GMC usually are very small and make encoding much slower, these are not used in the preset. Cartoon mode makes for astounding savings and thus delivers overall better quality in two-pass, so it is used.
No, cartoon mode never hurt any details in my tests. If this is more than a gut-feeling from your side, please come forward with screenshots to prove it (remember; only two-pass results are valid for the comparison).
See here (http://forum.doom9.org/showthread.php?p=621806#post621806) for some screenshots I took a while ago.
Valeron
5th June 2006, 16:10
@Teegedeck:
i can hardly tell the differences between the two sample you post~
but the feedback from my friends are vary
i'll stick to cartoon mode off for whatever i think very good detail source(i would like to pay 4% more bits to avoid anything unpredictable), but for most not so good detail DVD, i'll leave it on.
but for Basilisk, there's so many rainning scene, it's hard to encode, maybe zone encode will help me out
Teegedeck
5th June 2006, 18:49
That conscientious and certainly better than blindly saying 'cartoon mode is no good'.
This whole cartoon mode debate that we once had on the forum always struck me as funny. Isn't it strange how some people don't feel that cartoon mode is good for anime while they relentlessly denoise all detail to death, anyway? And how people used to be afraid of detail-loss because of cartoon mode in XviD and now have absolutely no bad feelings about using x264 with deblocking set to '0' which equals total destruction of any detail? ;-)
Valeron
6th June 2006, 02:18
That conscientious and certainly better than blindly saying 'cartoon mode is no good'.
This whole cartoon mode debate that we once had on the forum always struck me as funny. Isn't it strange how some people don't feel that cartoon mode is good for anime while they relentlessly denoise all detail to death, anyway? And how people used to be afraid of detail-loss because of cartoon mode in XviD and now have absolutely no bad feelings about using x264 with deblocking set to '0' which equals total destruction of any detail? ;-)
:goodpost: ,sir
that's why i only apply nothing more than convolution3d or even serve cleanly with only "MPEG2Source" and stick to XviD for my anime dvd backup. why denoise so much, i need the original dvd but not a reproduced one, right?
i have to state, i didn't say cartoon mode is not good, for my eyes it doesn't get rid of details/noise like AVC codec generally do. i'll somehow consider it a superior solution. nevertheless not everyone(mostly) would like to watch anime with that kind of noise/detail.
PS: the two sample you post is very static scenes. in PRINCIPLE they would not be hurt by the way catoon mode work. i'll try some BRIGHT&fast motion scence. Basilisk is generally too dull:(
btw, any ideas to make the rain looks pretty close to the original dvd?
berrinam
12th June 2006, 02:40
I don't want to appear impatient, but I'm wondering what the situation with XviD presets for MeGUI is.
Are you waiting for the naming issues to be resolved, because I haven't touched them because I don't use XviD and thus have no idea what is going on. If you tell me what the problems are, I can fix them.
Teegedeck
12th June 2006, 12:56
Oh, sorry - I haven't had any time lately. I hope those presets haven't held up things with MEGui.
You could actually save me some time if you can tell me how I best force a first pass to be performed at a defined quantizer. Restricting quants or meddling with zone-settings? That's it really; no other problems, just thinking about things other than video encoding ATM takes up all my time. I promise to be quick with these presets, when the above thing is worked out.
berrinam
12th June 2006, 13:06
It's not supported at the moment through any mechanism I know of. There (I think) is one turbo option, which restricts the features always in the same predefined way. I can change the way it behaves when pressing turbo to whatever you want, however that is only if there is a single set of first-pass options which is used for all the profiles. If not, then some other approach (probably something like having 'inner profiles' or something similar) needs to be looked into.
Is it enough just to hardcode what the turbo option is, or do you have different first passes for the different presets? How is it supported in XviD-VFW?
BTW, don't worry about holding MeGUI development up -- it isn't affecting it at all; I just wondered about the presets because they sound like a good thing for XviD+MeGUI. If I can help in any other way, let me know.
Teegedeck
12th June 2006, 16:26
Thanks for your help. :)
The thing about the first pass being performed at a different quantizer than the standard '2' is that in most cases '2' results in a bitrate too far from the aimed-at filesize for 2nd pass (especially true when using high-bitrate matrices). The curve is harder to normalize and we get an uneven quantizer distribution.
The usual solution when using the VfW interface is setting a zone with a constant quantizer for 1st pass. (This also disables fast first pass.)
If you can force quantizer=3 through the 'turbo' switch that would be fine by me; I'd wanted to revise the presets to '1st pass at quant=3' all over, anyhow.
So, this would probably mean I wouldn't need to create separate profiles for the 1st pass if 'turbo' is by default used in the 1st pass and if setting the 'turbo' switch would trigger the wanted settings? If it works that way one could of course ruthlessly alter the settings to meet what those preset-thingies require. Don't know whether others would regard this a 'misuse', though...
If you think it's viable this would be what I have in mind for a unified 1st pass behaviour (some compromises* included):
Quantizer=3, VHQ=1, motion search precision=5
Some folks would perhaps not like the change to motion search precision as '5' not exactly triggers a 'turbo-speed'..?
The rest should be standard 1st-pass behaviour (i.e. deactivated QPel, GMC, VHQ for-b-frames, chroma ME).
---------
*= motion search precision = 5 means an artificially small first pass for the DVD-R preset which runs at msp=4 in the second pass. Maybe the higher VHQ mode in 2nd pass will make up for it, probably not.
berrinam
13th June 2006, 08:08
I don't actually understand why you would want a high motion search precision in the first pass. What does it matter what the filesize is that pass?
Anyway, you are probably the best judge of how people will react to changes I make to XviD in MeGUI, so I have two things I could do:
Set turbo to behave exactly as it is needed for your profiles, meaning that mse5 would be enabled on turbo.
Support 'first pass settings' as a special configuration for the codecs (perhaps just XviD).
Now that I write it down, I think that 2. is better, but what do you think?
Teegedeck
13th June 2006, 18:20
Those first-pass settings are a compromise between a 'full quality first pass' and a 'fast first pass'. See this thread here (http://forum.doom9.org/showthread.php?p=644721#post644721), especially Koepi's and Didée's posts.
If you could without going to too much trouble work solution #2 that would be great, of course. :)
Sharktooth
13th June 2006, 23:59
Uhm... i dont think a Q4 first pass is a good idea for ULR matrix though.
It usually produces about 1000kbps @ Q2(Q4 for B frames) for 640/720px sources.
Teegedeck
14th June 2006, 09:27
The "1-CD" preset using EQMv3 ULR was meant for extreme compression ('extreme' as in 1000 kbps at full resolution, not 640x - so 'pretty extreme', I'd say...) and I thought it a good idea to use the middle-ground of 'allowed' quantizers for the first pass; i.e. '4'. But I myself wasn't so convinced that this was a good idea as you can see from this:
[...]I'd wanted to revise the presets to '1st pass at quant=3' all over, anyhow.[...]
If you think it's viable this would be what I have in mind for a unified 1st pass behaviour (some compromises* included):
Quantizer=3, VHQ=1, motion search precision=5
Sharktooth
15th June 2006, 02:48
Yep, quant 3 is much better... even if i would leave quant 2...
ULR compresses really much and sometimes, with particularly compressible or denoised movies, even using Q2 is not enough to fit 1CD...
Teegedeck
15th June 2006, 09:41
That's pretty rare at full resolution. More importantly - the aim of those presets is not that each and every one of them can be used to fill a CD, 2 CDs, a DVD, whatever. If the preset which utilizes the ULR matrix doesn't fill a CD you're supposed to use the next-higher preset. The idea is to use CQMs at their sweet-spot. The '1CD'-etc. tags are only there to give a vague idea.
For example, here's some figures from the most compressible source I've tested so far:
1CD fast@quant3: 497 MB (EQMv3 ULR)
2CD fast@quant4: 397 MB (EQMv3 LR)
2CD HQ@quant4: 439 MB (EQMv3 HR)
You see that if one uses the '1CD preset' at quantizer=3 one could already start using the '2CD preset' at quantizer=4 (even the 'HQ' version of it which uses EQMv3 HR) - and that would look much better indeed. So there's little sense in allowing a lower minimum quantizer than '3' for the '1CD preset' IMHO. It's not a nice method but I decided to use quant-restrictions in order to prevent the 'misuse' of a preset after it became apparent that such things would actually happen. :)
Edit: For means of comparison, here the same for the least compressible source I've tested so far (2-hour-movie!):
1CD fast@3: 1668 MB
2CD fast@4: 1511 MB
2CD HQ@4: 1734 MB <---- an obvious problem; for some movies the outcome just is different... I think I will change the max. quantizer of that preset to '5'
It really is so futile to assign absolute figures in bitrate or filesize to the presets; what would you think of 'grade A', 'grade B' etc.?
Teegedeck
16th June 2006, 18:29
OK, here's some (not all) MEGui profiles with the necessary CQMs. ATM it's for testing, OK? :) You should be able to just go to MeGUI file menu and choose 'import profiles'. Until berrinam has added custom first-pass settings to MeGUI you'll have to adapt your first pass settings manually to read:
Quantizer=3, motion search precision=5 (except for the '90% preset' where it should be '4'), VHQ=1
Actually I have no idea whether you can change the first-pass quantizer by adding a constant-quantizer zone in MEGui at all...
Spelled out:
* XviD '>30% comp. check' (fast): MSP=6, VHQ=1, VHQ for b-frames, AQ, EQM v3 ULR rev.3, 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 ULR rev.3, 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
Settings that are always active if not specified otherwise: chroma ME, Trellis, chroma opt., b-frames: max. 2 consecutive, ratio 1.62, offset 0. NOTE: MEGui does not support chroma optimizer.
Naming has changed:
1-2CD preset --> 30% comp. check
2-3CD preset --> 45% comp. check
3CD preset --> 58% comp. check
DVD-R perfect preset --> 90% comp. check
I know that will trigger the inevitable question "what comp.-check?!?"* but I just couldn't come up with anything else that makes sense. Perhaps someone else has a thrilling idea.
The 'sharpen' preset will turn up as a specialized preset together with the 'for editing' and the 'Anime' presets lateron.
--------------
*: Compressibility check with Enc (http://forum.doom9.org/showthread.php?s=&threadid=50714); 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.
Edit: forgot that "constant quantizer =3" for the comp. check. Sorry.
berrinam
17th June 2006, 00:10
You can let MeGUI manage the CQMs if you use File->Export Profiles. I've attached what it produces, which you can install by dragging onto MeGUI or by using File->Import profiles.
Teegedeck
17th June 2006, 12:26
Thanks; I've replaced my attachment with what you have uploaded.
Cool feature, by the way.
henryho_hk
18th June 2006, 06:53
XviD '>45% comp. check' (fast) and XviD '>45% comp. check' (HQ) seem different much. Any typo there?
Now I am trying to figure out how to make a comp test in Enc using commandline
Teegedeck
18th June 2006, 09:02
XviD '>45% comp. check' (fast) and XviD '>45% comp. check' (HQ) seem different much. Any typo there?They've always been quite dissimar. Apart from the obvious ('fast' uses faster settings) they use different matrices. The filesizes that EQMv3 HR and LR produce are not as different as for example the filesizes that LR and SixOfNine produce. When you use VHQ=4 with the HR matrix and VHQ=1 with the LR matrix the difference gets very small. What has changed in this revision is though that the HQ preset gets a higher max. quantizer because with sources that compress badly this preset at quant=4 is still 2% or something above the filesize of what the 30%-presets produce at quant=3. Let's see if it works out, it sure ain't a perfect world...
Now I am trying to figure out how to make a comp test in Enc using commandline:cool:
loro
18th June 2006, 12:22
Hey Teegedeck, first I wan't to say that this is great what your doing here because I tried some of the presets and I was amazed with the quality of some of my rips. I wan't to ask you someting. Only setting in xvid I do not fully understand are quantizer-restrictions. So here is my first question:
Example:
I'm doing a DVD rip and my compressibility check in Enc was 70,94% so I have decided to use this preset:
very high quality 2 - 3 CDs: slow medium compression:
VHQ=4, VHQ for b-frames, SixOfNine, Qpel, 1st pass @q=3, curve-compr. H10, L3, quantizer-restrictions min. 2, max. 5
My first question is about setting the quantizer-restrictions min. 2, max. 5. Is this for all frames (I,P,and B)
The second question is about using the setting "Qpel". Because i have a DVD-Divx standalone player, it doesn't have support for Qpel in Divx nor Xvid. If I deactivate Qpel will that affect the overall quality?
Thanx in advance.
Teegedeck
18th June 2006, 12:35
My first question is about setting the quantizer-restrictions min. 2, max. 5. Is this for all frames (I,P,and B)As you can read above, I just changed it so that I-frames max. quant. is '4'. And the min. quant is '3'. The b-frame max. quantizer is entered as '5' but will actually be calculated as 5 x 1.62 = 8 (well, roughly). Yes, that's not intuitive but apparently it is how XviD works.
The second question is about using the setting "Qpel". Because i have a DVD-Divx standalone player, it doesn't have support for Qpel in Divx nor Xvid. If I deactivate Qpel will that affect the overall quality?A little, yes. I didn't have hardware considerations in mind at all when I decided to work on presets; IMHO XviD's hardware profiles should do that job. Just deactivate QPel when you want to keep it compatible.
loro
18th June 2006, 12:45
So lets see If I got it right:
very high quality 2 - 3 CDs: slow medium compression:
Quantization Settings in Xvid for second pass:
Min I-frame quantizer: 2
Max I-frame quantizer: 4
Min P-frame quantizer: 2
Max P-frame quantizer: 5
Min I-frame quantizer: 2
Max P-frame quantizer:5
You see I'm kind of a new when it comes to quantizer-restrictions settings.
Teegedeck
18th June 2006, 12:50
The up-to-date presets are here. (http://forum.doom9.org/showthread.php?p=841263#post841263)
'3 CD preset (HQ)', formerly known as 'slow medium compression' now is called '>58% comp. check (HQ)'. I'm working hard to keep you all confused. :)
loro
18th June 2006, 13:08
Hehe I can see that, thanx for the link.
shon3i
18th June 2006, 20:02
@Teegedeck because i am interest for 1CD encoding (to keep quality much as possible) i use 30% HQ preset because enc show me 35%, after few hours of encoding i get file wery undersized. My target been 620mb (80mb for audio)=700mb, but i get 510mb video, i founded a i think is that problem, restricting quants to 3/5, 2/5 soloves problem.
Teegedeck
18th June 2006, 21:07
What does the XviD statsreader say about the first pass' filesize? Could you do a filesize prediction with Enc for the >45% comp. check (fast) preset at constant quantizer 4 as well?
Are you sure you've used these comp. check settings:
SixOfNine CQM, 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?
Thanks for reporting.
shon3i
18th June 2006, 21:25
Stats reader says 542mb
Are you sure you've used these comp. check settings:
SixOfNine CQM, 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?
Of course, ad i work first pass with q=3
Could you do a filesize prediction with Enc for the >45% comp. check (fast) preset at constant quantizer 4 as well?
Latter, maybe tomorow, i do this.
Teegedeck
18th June 2006, 21:29
Thanks, that's a big help! I do hope that for the vast majority of movies the comp. values I have given hold true. But it would be hoping too much that they hold true for every case.
ATM I'm happy to collect data. Even such that invalidates my data...
henryho_hk
19th June 2006, 01:37
Actually, the movies I encoded with your presets + xvid_encraw are very hard to make seeks. Much harder than conventional XviD VFW defaults. Does the increased # of b-frame make it harder to seek? It may also be xvid_encraw ignoring the "-max_key_interval 300" setting. Time for more testing. ^_^
Teegedeck
19th June 2006, 07:41
Increased number of b-frames? I don't think so; 2 max. consecutive is the XviD default... And for the 90% preset there's even a negative b-frame sensitivity, i.e. fewer b-frames. Nah, must be something else. (Seeking works fine over here.)
foxyshadis
19th June 2006, 08:55
Writing mp4 and mkv straight out of a lot of apps gives you almost unseekable files, but remuxing usually fixes that up.
shpitz
19th June 2006, 23:22
i ran xvid_encraw on a full football match. ~1:30hrs long using this command:
xvid1enc1.bat slow_extreme 1000 wc_720p.avs
this is the output:
start "slow_extreme - Pass 1" /b /wait /low xvid_encraw.exe -i default.avs -type
2 -pass1 default.stats -progress 100 -max_key_interval 300 -max_bframes 2 -bqua
nt_ratio 162 -bquant_offset 0 -vhqmode 1 -lumimasking -qtype 1 -qmatrix eq
m_v3ulr_rev3.xcm -nopacked -imin 3 -imax 5 -bmin 3 -bmax 5 -pmin 3 -pmax 5 -qual
ity 5 -nochromame -turbo -zones 0,q,4,KO -threads 4
xvid_encraw - raw mpeg4 bitstream encoder written by Christoph Lampert 2002-2003
Trying to retrieve width and height from input header
Avisynth open failure:
AVISource autodetect: couldn't open file 'C:\Dokumente und Einstellungen\tobias\
Desktop\tmp\ELDER\ELDER_beta4\default.avi'
Error code: 3
(default.avs, line 7)
start "slow_extreme - Pass 2" /b /wait /low xvid_encraw.exe -i default.avs -type
2 -avi default_xvid.avi -pass2 default.stats -progress 100 -max_key_interval 30
0 -max_bframes 2 -bquant_ratio 162 -bquant_offset 0 -vhqmode 4 -bvhq -lumimaskin
g -qtype 1 -qmatrix eqm_v3ulr_rev3.xcm -nopacked -imin 3 -imax 5 -bmin 3 -bmax 5
-pmin 3 -pmax 5 -quality 6 -chigh 30 -clow 15 -bitrate 1000 -zones 0,w,1,KO -th
reads 4
xvid_encraw - raw mpeg4 bitstream encoder written by Christoph Lampert 2002-2003
Trying to retrieve width and height from input header
Couldn't open statsfile 'default.stats'!
start "slow_extreme - Pass 1" /b /wait /low xvid_encraw.exe -i wc_720p.avs -type
2 -pass1 wc_720p.stats -progress 100 -max_key_interval 300 -max_bframes 2 -bqua
nt_ratio 162 -bquant_offset 0 -vhqmode 1 -lumimasking -qtype 1 -qmatrix eq
m_v3ulr_rev3.xcm -nopacked -imin 3 -imax 5 -bmin 3 -bmax 5 -pmin 3 -pmax 5 -qual
ity 5 -nochromame -turbo -zones 0,q,4,KO -threads 4
xvid_encraw - raw mpeg4 bitstream encoder written by Christoph Lampert 2002-2003
Trying to retrieve width and height from input header
Input colorspace is YV12
xvidcore build version: xvid-1.2.0-dev
Bitstream version: 1.2.-127
Detected CPU flags: ASM MMX MMXEXT SSE SSE2 TSC
Detected 4 cpus, using 4 threads.
163301 frames( 99%) encoded, 20.18 fps, Average Bitrate = -1293kbps
Tot: enctime(ms) =8094685.00, length(bytes) = -879412230
Avg: enctime(ms) = 49.55, fps = 20.18, length(bytes) = -5382
I frames: 942 frames, size = 62092/58491355, quants = 4 / 4.00 / 4
P frames: 80877 frames, size = -21546/-1742642542, quants = 4 / 4.00 / 4
B frames: 81557 frames, size = 9867/804738957, quants = 6 / 6.00 / 6
start "slow_extreme - Pass 2" /b /wait /low xvid_encraw.exe -i wc_720p.avs -type
2 -avi wc_720p_xvid.avi -pass2 wc_720p.stats -progress 100 -max_key_interval 30
0 -max_bframes 2 -bquant_ratio 162 -bquant_offset 0 -vhqmode 4 -bvhq -lumimaskin
g -qtype 1 -qmatrix eqm_v3ulr_rev3.xcm -nopacked -imin 3 -imax 5 -bmin 3 -bmax 5
-pmin 3 -pmax 5 -quality 6 -chigh 30 -clow 15 -bitrate 1000 -zones 0,w,1,KO -th
reads 4
xvid_encraw - raw mpeg4 bitstream encoder written by Christoph Lampert 2002-2003
Trying to retrieve width and height from input header
Input colorspace is YV12
xvidcore build version: xvid-1.2.0-dev
Bitstream version: 1.2.-127
Detected CPU flags: ASM MMX MMXEXT SSE SSE2 TSC
Detected 4 cpus, using 4 threads.
163301 frames( 99%) encoded, 9.01 fps, Average Bitrate = -2842kbps
Tot: enctime(ms) =18137247.00, length(bytes) = -1934683806
Avg: enctime(ms) = 111.01, fps = 9.01, length(bytes) = -11841
I frames: 942 frames, size = 53174/50089911, quants = 3 / 4.99 / 5
P frames: 80877 frames, size = 22749/1839901905, quants = 3 / 5.00 / 5
B frames: 81557 frames, size = 5766/470291674, quants = 4 / 8.00 / 8
after many many encodes this was the best encode that looked closest to lossless yet produced the smallest file.
3 questions:
1. it didn't matter which bitrate i specified in the command, it will always encode to the smallest filesize possible for the certain profile i chose.
2. when i went to mux the encode with the audio nandub said the keyframes are totally out of wack and i should rekey the file. the muxed output cannot seek at all.
3. there are several errors reported in the log, are they of any concern?
thanks
am i doing something wrong?
henryho_hk
20th June 2006, 01:25
Thank you for using my BAT script!
Please remember to use the most updated code in this post (http://forum.doom9.org/showpost.php?p=804680&postcount=87) because I made updates directly there.
Your command-line seems wrong. There is no need to specify the AVS name. My BAT will process every AVS file in the same directory automatically. The 2nd param is actually "<bitrate>", "<size>K" or "<size>M" (the param is for reference only because the preset quantizer settings has more prevailing effects.)
The "slow_extreme" preset uses the ultra-low bitrate matrix and so your encode is small. For bigger size, you should use slow_strong or slow medium. (All credit goes to Teegedeck) BTW, I have not updated my BAT to use Teegedeck latest presets yet.
As for the keyframe issue, I notice it too. Seeking through those AVIs seem much more difficult than those produced by AVS2AVI or VirtualdubMod. Still no idea, though.
Thank you again for using my BAT script. ^_^
shpitz
20th June 2006, 06:01
henry, i did use the latest code you posted.
the encoded file ended up being 2.6gb in size keeping 720p resolution and looking lossless to me (only difference from source is 60fps compared to 30fps encode).
i'm wondering what tools i can use to quantify the quality of a clip compared to the original...
can anything be done regarding the keyframe issue?
squid_80
20th June 2006, 10:04
xvid_encraw uses MS's AVIFile API for writing avi files, which chokes when files get larger than 2gb. Outputting to mkv works better but it's still a good idea to remux with mkvmerge to create cues.
shpitz
20th June 2006, 14:33
thanks squid, i'll give mkvmerge a shot.
henryho_hk
21st June 2006, 01:38
(only difference from source is 60fps compared to 30fps encode)
That's strange. Why is your fps changed after the encode? Is your source 720i?
As for the seeking issue, I suspect that it may be a problem of OGMuxer as the ogm produced (or even remuxed) by VirtualdubMod does not seem to have this problem.
I am now thinking if I can use MKV as intermediate output and then muxing it into OGM with VirtualdubMod (all in commandline).
shpitz
21st June 2006, 15:26
source is 720p, i used selecteven to reduce it to 30fps.
henryho_hk
21st June 2006, 18:05
Teegedeck, are there still "turbo=yes" and "chroma me=no" for the 1st pass? Is the 1st quantizer "2" or "3" for the 1st pass of >90% presets?
Teegedeck
21st June 2006, 20:08
Yes, yes and 'three'. :)
firered
23rd June 2006, 07:54
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
in your presets i noticed something called sixofnine what is that excatly? and where in the options is it
Adub
23rd June 2006, 08:07
six of nine is a quantization matrix put together by Didee. It is used to improve compression and keep details, etc. It is included in berrinam's profile zip. (see earlier pages)
BigDid
23rd June 2006, 08:24
There is a recent thread on the subject with alternate location here: http://forum.doom9.org/showthread.php?p=839915#post839915
or on the author's page here: http://forum.doom9.org/showthread.php?p=840582#post840582 :)
Did
henryho_hk
24th June 2006, 21:49
The new BAT script with Enc comptest and new presets is under alpha testing. ^_^ The batch processing capability is temporarily gone because you need to click 2 buttons in Enc to start its comptest anyway.
I am also switching from ogm to mkv output because since squid_80 said Xvid_Encraw cannot write >2G avi files and I found some problems in Ogmuxer. Let's see if MKVmerge works better.
---------------------
I need more time to test.... because the HQ presets are really SLOW.... while the quality is.... AWESOME!
Teegedeck
24th June 2006, 22:24
You actually did it?!? Man, that's ace. :cool: Way cool.
loro
25th June 2006, 18:46
Hello Teegedeck I'm doing a Concert DVD Rip. It's 149 minutes long and I used both original audio files. Avarage Bitrate is like 1250 kbps. Then I did comprssibiltity check for 3 cd's with enc and I got 45% result so I used The SLOW HEAVY COMPRESSION preset and I got almost 400Mb oversized File
Aiming Size = 1365916 KB = 1334 MB
Result size = 1768000 KB = 1726 MB
Teegedeck
25th June 2006, 20:28
I'm sorry that you lost time with that encode but I hope we can clear this up.
Do you mean you used the preset that used to be called 'slow extreme compression' (with EQM ULR matrix) or the one that was called 'slow strong compression' (with EQM HR matrix)?
I suppose you meant 'slow strong compression' - which now has undergone a name-change and is called XviD '>45% comp. check' (HQ)'
From looking at the preset's new name you can already tell that your comp. check result was just on the border of things (BTW '>45%' reads 'more than 45%'), and not-so-long-ago it really could happen in such a case that at the maximum allowed quantizer you could not reach the desired filesize.
That's why I raised the maximum allowed quantizer for that preset to '5'. Because you still used the old name, I could well imagine that you've also used the previous version of the preset that only allowed for max. quantizer=4?
But at 45% compressibility - and in all cases that are just on or slightly below the mark - I would advise to use the next-lower preset; in this case that would be the '>30% comp. check' (HQ) preset.
Thanks for testing those presets.
henryho_hk
26th June 2006, 01:35
xvid_encraw ..... Outputting to mkv works better
xvid_encraw produces a MKV of fourcc MPEG4 (codec private actually). How can I change it to "xvid"?
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.