Log in

View Full Version : XviD presets - preliminary thoughts and suggestions


Pages : 1 2 3 [4] 5 6 7 8

Teegedeck
6th April 2006, 14: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, 16: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, 17: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, 19: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, 20: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, 20: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, 20: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, 21: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, 21: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, 21: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, 22: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, 01: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, 12:13
@BigDid you must have a big ear to see that different's.

Teegedeck
8th April 2006, 12: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, 16: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, 16: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, 06: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, 10: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, 13: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, 14: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, 09: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, 11: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, 12: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, 14: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, 15:20
Had you read this thread you wouldn't need to ask this question.

Adub
3rd May 2006, 01:23
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, 20:06
Hmmm.... Why not, really? Anyone out there who has more time than I got on my hands?

buzzqw
3rd May 2006, 21: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, 06: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, 07: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

dexx
4th May 2006, 08:31
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, 09: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, 13: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, 14: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, 14:58
Thanks. So implementing those presets in MeGUI will have to wait.

sander815
7th May 2006, 16:55
how do i use these presets?

Teegedeck
7th May 2006, 17:33
With your keyboard and mouse, the usual way. ;)

Adub
7th May 2006, 18:38
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, 12:57
@Teegedeck i just ask MeGUI devs for this look this (http://forum.doom9.org/showthread.php?p=824872#post824872)

Teegedeck
13th May 2006, 20:35
Some posts moved here (http://forum.doom9.org/showthread.php?p=827049#post827049).

berrinam
20th May 2006, 09: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, 11: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, 02: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, 08: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, 12: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, 16:05
Indeed, I guess you're right there.

henryho_hk
22nd May 2006, 01: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, 19: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, 00: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, 09: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?