PDA

View Full Version : Question about the "Getting the best out of CCE" guide...


deniro-s
22nd December 2002, 05:26
I was thinking about something, and perhaps I'm wrong, but let's see if I'm understanding this right. I'm referring to the "getting the best out of CCE" guide in the guides section. Now, they say;

1 pass with CCE set at min=0 bps, max=8000 bps, q=60
1 pass using advanced options to do a manual editing of the bitrate

Now, my question is this. It seems that the first pass at q=60 is only done to generate the vaf file, which I'm assuming contains the information for what frames will be encoded at what bitrates. So, this file is neccessary for step 2 where you manually edit the bitrates. Now, I noticed that if I limit the max bitrate to say 2000 my encoding speed goes up, so could I not just run the first pass in CCE with a max bitrate of 1000 to get the vaf file quicker? The first m2v file generated isn't used in the second pass if I am understanding things, so the fact that it is poor quality shouldn't matter (assuming the vaf file is the same) because the encoding is done on the original m2v file specified in the .avs script file. I'm not sure if I want to test this out with a whole movie since that would take a while, but does anyone else think this would work?

paul8883
28th December 2002, 19:18
very interesting! But I couldn't find the function SelectRangeEvery() in avisynth 2.07 (got the error)
When I try to use SelectEvery(1500,15), CCE did claim it does not support Frame rate 25/1500!!!

Another question, what bitrate I need to use when I am playing with Q in CCE?

wfn1
30th December 2002, 01:15
Bach,

Firstly thanks for the RoBa method, excellent work. I have 2 questions (assuming DVD to DVD-R conversion):

1) Would using the filesize prediction method outlined here(1% video to find the Q) be in any way inferior to doing 1passVBR with Q:30, min:0, max:9000, bias:10 to build the .vaf and following it with MultiPassVBR: 1pass and avg. bitrate set in accordance with your other DVD assets? I find that setting Q between 20 and 30 gives me a close enough match of an average bitrate I have to use for the 2nd pass for most movies.

2) Do you think that utilizing CCEGuesser by FP to approximate the min. bitrate for 1passVBR with Q:60 and using the resulting .mpv as final product a bad idea?

Thanks!

paul8883
30th December 2002, 13:07
Thanks Bach, I found the method is very useful! It avoid to use multipass of the whole clip completly. Instead of it, using several time of one pass for 1% of clip for fine tunning of Q to approach the expected size, then finally, one pass vbr with the found Q for the whole clip. Even it all need to be done manually, but it save significant encoding time.

Anothe question, let's suppose we'll use 2 80min CDs for a video clip. Does this method provide more or less the same quality with multipasses with the avegrage bitrate set? (lets say same file size)

Thanks again.

Happy New Year!

wfn1
30th December 2002, 20:36
Originally posted by Bach
The resulting file is almost the same as if you were using CBR=value_of_min_bitrate.


Originally posted by Bach


(...)

I bet you will get a value smaller than 2000 kbps). But, the min_bitrate have priority over the Q.factor. So, if Q=60 and min_bitrate=3000, the encoder don't give a damn for Q.factor and will encode the whole file at 3000 kbps. So, it is a bad idea: you will waste bits in easy scenes, while difficult scenes will have a compression higher than it should be (= quality lost).


Great, thank you for confirming my suspicions. I wanted to hear it from the horse's mouth so to speak.

Originally posted by Bach
btw: my tip to guesstimate the final file size is GOP dependent. So, if you are setting the GOP in CCE using M=3 and N/M=4, you need to use

selectrangeevery(1200,12)


Yes, I realized that when experimenting yesterday. Thank you for a wonderful insight, I will post my findings if I encounter any differences between the 1passBach and 2passRoBa methods. I have a 52" sony plasma + camelot roundtable dvd player so I will be able to pick out the loser (if there is one) immediately.

REECYCUP
31st December 2002, 03:31
bach

i need help(tried selectrange:error)
does mpeg2dec3.dll have this option?
thanks

paul8883
31st December 2002, 15:49
Thank Bach for your Math...
I'll try to compare this method and the long time multi passes method with a same video clip. Actually I don't have dvd writer, I only make svcd/cvd from the home videos (dv) or a few dvd. I'll use min=300, max=2520 and found Q to do one pass and compare with 4 passes with the average bitrate which obtain the same file size.

One more question, to compare two clips, is it enough to use bitrate viewer to see the peak Q and average Q? I means the smaller Q_average and Q_peak in bitrate viewer, the better quality of the encoded file? Beacuse to compare in TV, it's very objective, it depends the person to person.

tyee
1st January 2003, 03:37
Bach
Been looking for a quick Q.method like yours for a while. Thanks a lot, will give it a try. Now all we need is to automate those 10 minutes. I'm going to try and write an 'AutoIt' script to do it, but I don't know if the program can read filesizes.

tyee

tyee
2nd January 2003, 07:32
Here is my first go at the 'AutoIt' script I was talking about. It is of course basically a macro, pressing keys and clicking here and there so there are rules you must follow. They are --

1. Get AutoIt from http://www.hiddensoft.com and install it. AutoIt is freeware!
2. Your desktop must be set to 1024*768 for the mouseclicks to occur at the right place.
3. This script only works on the latest CCE 266.01.07. It may work on previous versions if the window layouts are the same. They are not the same in version 2.5! Modify the script to your liking to make it work with that version if you wish.
4. Make sure Bach's method works properly manually FIRST for you, then try out this script.
5. In the script itself, change the directory and filenames to your liking BEFORE using it. These are located on these two lines --

Runwait, %COMSPEC% /c dir /o-s i:\\test > i:\\filesize.txt
FileReadLine, line6, i:\\filesize.txt, 6

NOTE -- Don't forget to keep the double backslashes or it won't work!

The i:\\test directory is the directory CCE is writing to, to make the .m2v file. Create it on your harddrive and then set it in the CCE encoding window 'Output Files' destination.

The i:\\filesize.txt file is just a DOS directory listing starting in order of largest to smallest filesize. This is so AutoIt can read the created filesize to determine how to change the Q value.

I would recommmend that there is nothing in the i:\\test directory to begin with or you might have problems if there is a file in there that's larger than the size your aiming for because the script reads the size of the largest file, which is on line 6 of the listing.

The Q value returned will be the value that will give you a filesize that is under your desired size (not over). Of course, depending on the Q step value you are asked for at the start of the script, the closer this final filesize will be to your target (wanted) size.

Make sure that CCE is all configured manually by you FIRST before double clicking the script file to start it. Make sure that the initial value of Q you've set is not the value you will be telling the script to use. ie. if you want the Q value to start at say 35, then set Q to anything other that 35 initially. This is due to the way CCE enables the OK button in that config window.

I hope it works for all of you who want to try it out. There will probably be bugs due to operating system, etc. but I have spent a few hours trying to get them out.

Good Luck and thanks to 'Bach' again for the method!!


tyee

FamousPerson
2nd January 2003, 19:55
CCEGuesser algoritm is wrong. The resulting file is almost the same as if you were using CBR=value_of_min_bitrate. The reason is simple: for a source at (720x480)x24fps -which is a film DVD, using Q=60 you are asking to the encoder to use a bitrate as low as possible

Bach:

How does the above make CCEGuesser's algorithm "wrong"? I've found its guess for one-pass variable to be very close every time.

wfn1
2nd January 2003, 20:30
I am happy to announce that after extensive testing I have found no quality difference (subjective) between 1passBach and 2passRoBa encoding methods.

See my post from above if you're interesed in the viewing equipment I used. The test involved SW:E2:AOTC original DVD I own. Video encoded in CCE 2.5, audiotrack was downsampled from 5.1DD-448K to 2DD-96K to allow for higher video bitrate. Recorded at 1x in Pioneer DVR-103 f/w 2.00 to Pioneer DVS-R47A/U DVD-R media. Four testers including myself with at least 20/20 vision (20/10 here) + 1 starter girl.

tyee
2nd January 2003, 21:16
Great news wfn1, I'm going to give it the full test very soon too.

I am wondering though if this 1passVBR method will work for interlaced camcorder DV. I have read in the past on these forums that you must use at least a 2passMultiVBR or the quality is not that good. I will have to try this out as well.

tyee

tyee
3rd January 2003, 06:46
Here's an improved version of the AutoQ finder using AutoIt. It zeros in on the Q according to Bach's theory. No more than 6 passes (about 10 minutes) are required to find a Q between 1 and 80.

tyee

Dvd@Best
3rd January 2003, 15:22
Bach - As many ppls give u apprication of ur work i request u to please accept my appreciation as well.U hv invented a great method.

Last night i was trying your method and i found one thing.
"Increasing the Q factor Decreasing the filesize (1% of mine video )"
i started first with q=8 which give me more then thirce of my desire file size and then i started to increase it.
And at q=50 i got something to close to file size.It is a normal or i am doing something wrong.

Your kind attention would help me lot.

And Thanks again on ur significant work


Dvd@Best

Dvd@Best
3rd January 2003, 15:31
Something wrong now - may be i am guessing it wrong.

On my other pc i tries another movie .This time i got my desire file at q=70.

Is going above 60qfactor = distrotion??


Dvd@Best

paul8883
3rd January 2003, 15:54
I have just tested the Bach 1 pass with found Q method comparing with multipasses vbr method (3 passes). The source is my home video (interlaced mini dv). The output is PAL SVCD. With the same min and max bitrate (300, 2600). The found Q is 2, the avarage bitrate of multipasses is 2520. Here are the results:
Bitrate viewer:
the peak Q and Avarage Q are more or less the same
the peak bitrate and avarage bitrate are more or less the same

the multi passes has a little bit less bitrate peak and avarage
the file size is a little bit smaller

THE QUALITY (both in PC and 32' widescreen TV) HAS NO VIEWABLE DIFFERENCE (at least from my eyes in the distance of 2.5 meters from tv). I'll ask my friends to see if they can the difference.

But there is a big difference in the encoding time at least for my old pc (P III 500 MHz) (2-3 hours against 7-8 hours)

Great Bach! Thanks for your math. and method. Hopefullu one day this method can be included into dvd2svcd directly. But it's quite straghtforward for dv (avi) to svcd conversion even without dvd2svcd.

PS. I'm using CCE SP 2.66 beta

paul8883
3rd January 2003, 16:05
Hi Dvd@Best,
The final Q value depends on the the file size you choosed, the length of the source and the quality of the source, I think. For example, if you fixed a big file size with a short length of source video, you may get a smaller Q (approximate to the constant bitrate of max bitrate). But if you have a long length of video and choose a small file size, you will find a much bigger Q. Tha's my understanding, also from the experience of my several tests I've done until now.

FamousPerson
3rd January 2003, 16:18
Bach:

Your method looks very intriguing. Personally, I only do DVDs...this is good info for people doing DVDs too and I wonder if many DVD-only people ever wander over into this part of the forum.

I have done some initial testing (one movie), and it appears that as the Q increases/decreases, final output size also goes up & down at a constant rate (no curve). If this holds true, it will not be hard for me to modify CCEGuesser to require only one test sample to give a recommended Q to use. This would be much faster than having to do up to six tests.

I will call it the "Bach Method" :) . I'll keep you posted on my findings.

sasmj
3rd January 2003, 20:55
I've used this method on a couple of films now and would like to post my findings and I would appreciate any comments. I work solely with full DVD backups. I tend to keep all audio tracks and all extras. I've found that when keeping so much on the disc and encoding the main movie you need to get the main film down to a rather small size. I've found by using this method that I always end up with a high Q value, typically in the region of 54-60, does this mean anything?. One thing I'm not sure how to check is the quality of the final mpv. In the Robshot method when doing a Multipass VBR and pressing the advanced button, you could see the quality of the film and then adjust accordingly. Is this possible with this new method? I know the whole point is to avoid a second pass but is it possible to see the quality of the overall final film? Thanks in advance.

FamousPerson
3rd January 2003, 21:03
Bach:

Yes, I understand what you are saying about Q=60. It actually explains why CCEGuesser works in the first place. My point was that CCEGuesser only claims to be able to predict the size, which it does. It does not offer any theories as to what is the best way to encode. So, I took a small bit of offense when you said CCEGuesser's algorithm is "wrong". Its algorithm is actually, in contrast, pretty accurate for what it does. I think what you were actually saying was that encoding at 60 is wasteful. Right?

Regarding the straight line theory, I still plan to collect data. All curves are made of little straight lines, right? Who knows, maybe we'll find that within the workable Q range (say, 20-60), the line is always relatively straight. It's certainly worth exploring. On with the quest to faster encoding!

PS thanks again for your "sample" idea. It's a great one.

Dvd@Best
3rd January 2003, 21:05
HI Bach

Thank You Very much for ur math , which explain me lot.
But i wanna ask u wat is the max q we can set for dvd.Coz t'day i did my fourth movie using ur method, which was long in length and i choose smaller file size coz i also want to include extra - almost impossible to fit on dvd-r with Roba method.
But when i saw ur method i thaught i shud give it a try.Guess wat.
I got my desire file size @ q=170.

I hv v lil knowledge abt the video encoding - may be i am doing wrong encoding it at q=170.I need ur help again here.

that is why i asked u before wat max Q we can set for dvds.

just remind u mine min=300 , max=8000

Dvd@Best

FamousPerson
3rd January 2003, 21:11
wow, dvd@best, how long is your movie and how much free space did you have to work with?


From the CCE Guide:

Q.factor Description

1-40 Priority is given to image quality over compression rate
40-80 Standard setting
80-120 Priority is given to compression rate over image quality
120+ Image quality deteriorates considerably

For each encoding mode,one can set the following parameters.

Dvd@Best
3rd January 2003, 21:20
Yea its too big.

But dude at q=170 , the amzing thing is the image quality is unnoticible...
Beleive me guys - if i can set q=200+.Bach i will salute u.
Wat a great way u had showed to us.

I am still waiting to know wat max q i can go - coz i am worried that i will get bitrate error in authring program.

Hope to see answer


Dvd@Best

FamousPerson
6th January 2003, 15:47
OK, I've completed my first attempt at CCEGuesser for this new method. I'm only sending it to this thread in hopes that you guys might test it for me.

Oh and by the way, I've only really tested it for DVD (~4GB) sized output.

It has no documentation included, so here's what to do in a nutshell:

1. Pick a movie to test
2. Do a single sample encode as described above (use "selectrangeevery" in your .avs file, etc) Use any Q factor you like for the sample, but I recommend 30, or even better, use what you think might be close to the correct Q
3. Make note of:
a) The Q you used
b) The # frames in sample (as reported by CCE)
c) The final output size of encoded sample. In bytes for best accuracy.
4. Fire up CCEGuesser
5. Change "CCE MEthod" to "Single Pass (Bach Method)"
6. Fill in all your data in the white boxes. Make sure to set all "KB/MB/Bytes" drop downs properly.
7. The box "Recommended CCE Q" should now give you the proper Q setting for a One Pass VBR encode.
8. Comment out the "selectrangeevery" line from your avs file and change your settings accordingly. (Make sure you use MIN bitrate=0. It may not make a diff but that's what I used in my testing. Also, use MAX=8000 and Quality=5)

Thanks in advance to anyone willing to test this for me. If you find it to be inaccurate, please send any details you can. If you find it useful, feel free to do what you will with it.

You can download it here (http://www.vanhouwelingen.com/marcvh/cceguesser/cceguesser_beta.zip).

tyee
7th January 2003, 03:59
FamousPerson
Whether the bitrate is linear or not is my question. I did a couple of one pass VBR clip tests using Bach's method, NTSC interlaced camcorder video of mine and here's the results ( min=0, max=8000 )--

initial Q=40, Filesize turned out to be 36,774,692 bytes
new Q=60, Filesize turned out to be 32,053,500 bytes
new Q=70, Filesize turned out to be 29,776,296 bytes

From the above it appears it is not linear, at least with NTSC interlaced material. Thoughts??

tyee

FamousPerson
7th January 2003, 04:42
tyee,

Actually, your data looks very linear to me. It makes an almost perfectly straight line, with a slope of -233677 and an offset of 46109859. In other words, for any given Q, multiply by -233677, then add 46109859 to get bytes:

bytes = -233677 * Q + 46109859

I'll bet if you did another sample at 30 you would get a size close to 39,099,549.

Unfortunately this does not exactly jive with the calculation I put into CCEGuesser, but I can use this data. Thanks.

tyee
7th January 2003, 05:59
Yea, thanks for that math wakeup. Now I remember. y=mx+b. Verrry interesting. But doesn't this mean we have to do at a minimum 2 passes to get the slope for the equation?

tyee

FamousPerson
7th January 2003, 14:23
Not if the characteristics of the increase stay the same. I need to build more data to tell.

wrangler53
7th January 2003, 22:36
Thanks for all the informatio. I am not really good at math is there a summary on what settings to choose? I have a HD TV and do DVD backups with just the movie. When it comes down to the actual settings I don't know which is the best method in terms of the avg min and max and Q. Any standard help will be appreciated. Thanks

tyee
8th January 2003, 01:18
Here is my latest AutoIt script, now an .exe, no editing required. You do not need AutoIt installed on your computer anymore! This program is used to get the Q.value for a onepassVBR in CCE. Remember the following points --

1. Desktop resolution must be 1024*768 for mouse clicks to work!

2. Make a directory on your hard drive --> c:\QTest

3. Run CCE 266.01.07 and set all parameter manually, set Q to a value of anything but 20 and point CCE output files directory to c:\QTest.

Only 2 short, 1 minute passes will be required, so total time will be less than 3 minutes typically to get your Q for your desired filesize (which is 1% of what you want for the total CCE encode). Please read all this thread to understand.

Thanks to FamousPerson and Bach for the theory!

tyee

DVD1968
8th January 2003, 02:12
TYEE,

You forgot the attachment. :(

tyee
8th January 2003, 02:43
I think we have to wait for the moderators to OK it. I'll try to post it on my webpage then repost here where it is. Give me a little time.

tyee

tyee
8th January 2003, 03:29
Here it is. (Removed, trying to get more accuracy).


Remember that this value of Q you will get is not exact, it is based on the theory that a graph of Bytes vs. Q is linear. I tried it a couple of times and it's pretty close. Give it a try and let me know.

tyee

tyee
8th January 2003, 07:05
It seems I'm getting negative Q's if I choose filesizes around 40MB. Looks like I need more significant digits in the calculations. I'll try a fix.

tyee

tyee
8th January 2003, 20:50
Well, I'm not that happy with the 2pass/2minute QFinder. More data is needed for higher accuracy. It seems my calculations are correct assuming the linear Bytes vs. Q graph, but it seems that CCE is more non-linear when the Q starts getting pretty low.

However, I am happy with the multipass(less than 10 minute) QFinder. I'll include it here as attachment. Read the same instructions as for the 2pass, five posts up. It is also an .exe file now. No AutoIt or editing required.

tyee

Ntsita
18th January 2003, 19:58
Your "cce_opvbr_qfinder_6pass.zip" doesn't work for me.
Then, i wanted to try to vary your code but I do not know the password (AutoIt.exe => AutoIt.aut, password required). Do you want to say that to me?

Your "cce_opvbr_qfinder_6pass.zip" works (bad) on my system:
Win XP pro
CCE 2.66.01.07

If i want my 1% desidered video file of 30 million of bytes, i must type in Inputbox the value of 300 in order to make to work it.

In my test the final Q (of your script) is 59, but that true is 61 (manual Bach's method, always 6 tests are necessary).

Excuse for my poor English

tyee
18th January 2003, 21:19
Ntsita
Note that I updated the program about a day after I first posted it in order to increase the accuracy. You may have the older version. I should have said version 2. Try downloading again and try it out. It should give you the exact same answer as Bach's manual method.

You must type in 30000000 if you want 30 million bytes for 1% of your desired filesize. Password is 'ccerules' if you want to work with it. If been working on my 2-pass version for the last week and it is accurate to within 1 of the required Q. It's pretty hard to get an exact Q with just 2 passes and then some math, so a Q within 1 is pretty good. I think I'll post it as just a calculator without the macro control of CCE, then people can run the 2 pass of CCE themselves and then enter the values into the calculator.

I've only tried this 2 pass calculator on one DVD in order to finalize the required math operations. Before posting I want to try it out on a couple more to make sure that CCE encoding algorithm has the same curve for various bitrate and Q values. Give me a couple of days to finalize it. I'm also doing an Interlaced version as well. There seems to be two different algorithms that CCE uses depending if it's progressive or interlaced fed to it.

BTW, The program keeps testing for the required Q value, then when it has found a maxQ and a minQ that have a difference of 1, it gives you the maxQ as the answer. This Q value gives you a filesize of just under your entered value. You wouldn't want to spend all that time encoding to find out your just slightly too large and it won't fit on your disc.

tyee

Ntsita
18th January 2003, 22:36
Okay, I'll try it.
Thanks for psw.;)

Ntsita
21st January 2003, 16:18
Well, in attachment there is a my version (named v1.10) of cce_opvbr_qfinder_6pass.zip (originally by Tyee) that have these enhancement:

- Find a Q.value from 1 to 96 (0 doesn't exist)
- Log the job done in filesize.txt
- any system format numeric restricted
- any desktop resolution restricted
- 5 passes if Q.value found <32 (6passes in other case)

Remaining two restrictions:
- Initial Q.value not equal to 32
- "c:\Qtest" dir needed (do you have to create it and... read the txt in zip)

I hope that works for all people that will try it.

N.B. two post forward there is new version 2.00 (NO RESTRICTIONS)

(Attachment v1.10 removed)

tyee
22nd January 2003, 06:32
Here's my new 3 minute (depending on CPU speed) 2pass OnePassVBR calculator. It does not include any CCE macro control anymore. Just do the following. I tried it on two movies and it is accurate to within 1 of the proper Q over a range of 10 to 60. Considering the limited math abilities of AutoIt, I'm very pleased.

NOTE - This calculator is for a "Forced Film", progressive only source fed into CCE. I'm still working on the interlaced version.

1. Read the above posts for the theory on Bach's method of using the AVSynth function 'SelectRangeEvery(1200,12)'. Now add that line to your .avs script file along with the usual other lines for your mpeg2source, etc. and then load the .avs file into CCE.

2. Set up CCE for OnePass VBR encoding and set all the options as discussed on this forum for the best quality. Set minimum bitrate to 0, and max bitrate to 8000kbps.

3. Enter a Q of 10, then let CCE encode the 1% clip for about 1 to 2 minutes depending on your CPU speed. When it finishes, record the bytes it has written to your hard drive. Get it accurate to the byte level, not KB or MB!!!

4. Enter a Q of 60, and let CCE encode again for about the same time and record again the bytes it wrote to the HD.

5. Now run the calculator and enter the two byte values you got from CCE into the calculator (screens 1 is for Q=10 and screen 2 is for Q=60), then enter (in screen 3) your desired value of bytes (which will be 1% of the size you want for the DVD). Hit OK.

6. You now have your answer. Remove the 'SelectRangeEvery(1200,12)' from your .avs file (or comment it out with a '#' at the line start) and encode your movie using the calculated Q. I would leave a little room to spare of course.

Good Luck, let me know how accurate it works for you.
PS. I work with NTSC here, so I hope it's as accurate for PAL.

tyee

Ntsita
24th January 2003, 15:45
I've just finished v2.00 that has no limitations than v1.10
Then:
Run CCE 2.66.01.0x
Load your .avs (with selectrangeevery function)
Set any parameter you want and go back to the main CCE window.

Run this program, enter your 1% wanted file video size and you'll have your right Q value (less than 10min).

Reload your .avs (without SelectRangeEvery) in CCE, enter the Q value found and encode.

That's all.

tyee
24th January 2003, 16:50
Ntsita
Nice to see improvements. I'd like to see your mods, PM me the password, maybe I can learn too!

tyee

Tyris
27th January 2003, 09:13
I did some quick tests on a PAL progressive video, using Q values of 10-100, in increments of 10. The file size definately doesn't appear to have a linear relationship with the Q value. The best fit I've come up with so far is for exponential decay. I'll do some more tests tomorrow. Also, thanks Bach for this new method! Most likely I'll be using this in my ReDVD program.

Ntsita
27th January 2003, 11:44
You can also download my version 2.00 of 'CCE one Pass VBR Qfinder' from this link: CCE One Pass VBR Qfinder v2.00 (http://digilander.libero.it/ntsita/CCE%20opv%20Qfinder%20v2.00.zip)

I wait reply for any program's bug (if there are);)

tyee
27th January 2003, 19:08
Tyris

I found that the best fit is hyperbolic for progressive and quadratic for interlaced. I haven't had time to look for a better interlaced fit yet. I'm told that this OPVBR does not work for interlaced DV and we must use at least a 2pass MultiVBR to get decent quality (so we just enter our desired average bitrate), so maybe I should forget about the interlaced fit.

tyee

wfn1
3rd February 2003, 05:37
Tyee,

I was just playing with cce_3minute2pass_qfinder_progressive.zip and I find that on progressive source I have to add 1 to the Q to fall within my size requirements.

I tried the same Q (of 16 estimated) with bias 10 and bias 30 on a low-mo excellent quality transfer (J.L.Godard's Contempt Criterion) and the .mpv comes out with same exact size on the dot. Makes me think that with that type of source between 10 and 30 bias just doesn't matter. So I played around with some other low-mo good transfer films that I have (Juliette of the spirits, etc.) and I came to a conclusion that I just need to either add one to the Q, or divide my predicted filesize outcome by 105 instead of 100 for the 3rd question.

I haven't had the chance to play with Ntsita's program partially because I do not use CCE 2.66.xx (2.50.01.00) and want to skip all the automation things. For me the best fit is your program with the minor adjustments. I do lose about 50-60MB of available space on the disc but it's a small price to pay for dropping the extra step of MPVbr.

Thank you so much for the time you invested in this and I hope to see some more from you both.

Cheers!

tyee
4th February 2003, 04:03
wfn1
Thanks for letting me know your results. I haven't had time to fine tune yet but I'll try to put in a correction factor to get an exact Q in the near future.

tyee

Ntsita
5th February 2003, 17:46
Update for 'CCE One Pass VBR Qfinder'.

Bugs resolved:
-If CCE main window was resized from its original size, the program don't start enconding and/or has unexpected result.

Click on my home page below for download CCE One Pass VBR Qfinder v2.01

quantum
7th February 2003, 16:53
Is this a bad link? Bounces me somewhere different.

Ntsita
7th February 2003, 19:34
Is this a bad link? Bounces me somewhere different

No, it's good. (I have just tried it)
The file inside it is in another place.

Please retry.

Ntsita
12th February 2003, 17:53
Well, i have just automated the Bach’s method.
In synthesis:
Bach has said (rightly) that for getting the best out of CCE, by the fastest way, it’s possible using mode ‘One Pass VBR’.
But missing the possibility to insert the average bitrate, the final videofile size should be left unknowed less than you know the right Q value to insert to arrive at your desired videofile size.
The next program that i’ll release, resolve the problem.
Be sufficient insert the videofile size that you want (in bytes) and it’ll find the right Q value, it’ll encode the video file (at your choice) and it’ll shutdown the computer (always at your choice).

Limitations: (...there are always present:mad: )
Works with:
-Avisynth script (only one at time)
-Only CCE 2.66.x
-Avisynth 2.5
-Avisynth 2.0x with mpeg*dec*.dll that supports function ‘SelectRangeEvery’

Doesn’t work with:
-chapter list in CCE (it’ll be lost)
-Audio file inserted in “Input Audio from another file” (it’ll be lost)
-Encode Range partially setted up in CCE (it'll be lost)
-Boh? (You can say me with your test)

I think to release “Bach One Pass VBR” perhaps tomorrow in my home page.

Hi :D

Ntsita
13th February 2003, 17:39
Ok, i have released it in my home page. :D :D :D
Try it: 'Bach One Pass VBR'

rkorkie
14th February 2003, 19:18
Hey Ntsita, I tried your Bach One Pass VBR tool, and it doesn't seem to be working for me. The output of your log file was this:

*********************
Start Log of Bach One Pass VBR:
Your desired filesize: 4372996923 bytes (4170 MBytes nearly).
Q=32 --> 000 bytes (0 MBytes nearly).
Q=16 --> 000 bytes (0 MBytes nearly).
Q=8 --> 000 bytes (0 MBytes nearly).
Q=4 --> 000 bytes (0 MBytes nearly).
Q=2 --> 000 bytes (0 MBytes nearly).

The value to use is:
Q=1 with Filesize of 000 bytes (0 MBytes predicted).

ENDLOG. (by NTSITA v1.00)
*********************

However, I then tried your One Pass VBR Finder 2.01, and I got better results, but still mixed results:

*********************
Start Log of CCE Qfinder:
Your desidered filesize: 4372996923 bytes.
Q=32 --> 15283988 bytes.
Q=16 --> 25917704 bytes.
Q=8 --> 39244756 bytes.
Q=4 --> 50068628 bytes.
Q=2 --> 55502576 bytes.

The value to use is:
Q=1 with Filesize of 27751288 bytes. (predicted)

ENDLOG. (by NTSITA v2.01)
*********************

Notice how its calculation for Q is not quite correct. Nevertheless, can you explain to me why the results with both programs? I was doing the movie The Graduate (fyi). Thanx for any help!

Ntsita
15th February 2003, 10:01
Okay, for 'Bach One Pass VBR' post your ?.avs used and ?_SRE.avs created by this tool, so i can examine them.

For 'CCE One Pass VBR Qfinder' you have entered the entire size of your videofile instead of 1% of it.
Retry with 1% of videofile size and it'll surely succeed (your Qvalue will be 6 or 7, observing your log).
Post also this .avs script (i want notice where you have placed function 'SelectRangeEvery').

Hi. (i wait your post)

rkorkie
15th February 2003, 21:00
For the Back one pass, here is my .avs:

***********************
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MPEG2Dec3.dll")
mpeg2source("D:\GRADUATE\graduate.d2v")
#selectrangeevery(1200,12)
AddAudio()
ConvertToYUY2()
***********************

Here is the one generated by your program:

***********************
#Adding 'SelectRangeEvery' by NTSITA

LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MPEG2Dec3.dll")
mpeg2source("D:\GRADUATE\graduate.d2v")
#selectrangeevery(1200,12)
AddAudio()
ConvertToYUY2()
SelectRangeEvery(1200,12)

#Added 'SelectRangeEvery' by NTSITA
***********************

As far as the CCE one pass is concerned, you are right, I screwed up and put 100% of the file size. I must have been confused cause the new program requires 100% of the size, not 1%. My mistake. But any help you can give me with the Bach program would be appreciated. Thanx!

Ryan

rkorkie
15th February 2003, 21:17
Ntsita, by the way, I don't really understand the difference in your programs that you wrote between the "CCE One Pass VBR" and the "Bach One Pass VBR". From what I understand and what I see, they seem to do the exact same thing. Any explanation there? Thanx!

Ntsita
15th February 2003, 23:20
'Bach One Pass VBR' is an update of 'CCE ONE Pass VBR Qfinder' with sostantial improvements so much that i have changed its name.

Hi ;)

rkorkie
16th February 2003, 00:51
so do you have any ideas as to why Bach VBR 1.0 was returning values of Zero, and your previous program (CCE VBR 2.01) was correct in giving me a Q of 7????

Ryan

Ntsita
16th February 2003, 07:41
Bach One Pass VBR Problem

Can you rerun Bach tool with 'graduate.avs'?

While running, keep opened and visible the output videofile dir.
You can notice a file created (temporary and repeatly for each pass) named 'QsizeTemp.txt'.
Try to open it and PM me the content.
Also tell me the ouput dir (also if the same of input avs)
Hi

rkorkie
16th February 2003, 19:39
Well, this could be part of the problem. The file 'QsizeTemp.txt' does NOT appear in that directory anytime during the process. I looked in c:\ and saw a file that you create called ntsita.bat. In that file I see:

dir /o-s "D:\GRADUATE\bob_d1.mpv" > "D:\GRADUATE\QsizeTEMP.txt"

So, it seems there should be a file in D:\GRADUATE, but I carefully watch the directory the entire time and I never see anything appear.

Does that help any?

Ryan

Ntsita
16th February 2003, 20:00
Tomorrow, i verify the tool in relation of this.
(Strange, the two tools for 'QsizeTemp.txt' make same work, and '..Qfinder' functions well for you.:confused: )
Hi

jankster
17th February 2003, 06:44
Ntsita,

I'm not a huge expert here, so excuse me for any ignorance, but doesn't "one Pass VBR" produce flat bitrates, that is CBR. I use "Bitrate Viewer" and see a huge quality improvement with 2 or 3 passes. Is this "Bach One Pass VBR" just for people with very slow computers? I have a XP1700 and can transcode 4 movies in 24 hours with 2-pass.

Ntsita
17th February 2003, 07:58
Noooo:eek: , the 'One Pass VBR' doesn't produce flat bitrate as CBR, but it produces a flat quantization level that is like a Constant Quality in TMPEG.
You, probably, have exchanged, the slightly flat line seen in 'Bitrate Viewer', for bitrate level but it's quantization level.

Depending on the Q value entered in CCE , it's like as you say CCE to encode a movie with a much most possible fixed quantization level that, however, it isn't directly proportional to quantization level.

(Ex. Qvalue=5 doesn't produce a movie with QuantizationLevel=5)

BTW, the quality produced with 'One Pass VBR' is really indistinguishable from that produced in 'MultiPass VBR' (seen with eyes:cool: ), while you want the same filesize produced.

In fact, you should must have the same average quantization level, if you examine them with 'Bitrate Viewer'.

Then, the quality is nearly the same with this two methods (there are however some exceptions).

I repeat that the 'One Pass VBR' isn't be considered till now because, principally, there wasn't a fast way to determinate the average bitrate produced with it (AvgBitRate=Desired FileSize).

Now that there is...;)

Hi, NTSITA.

Ntsita
17th February 2003, 11:37
Well, i have updated 'Bach One Pass VBR' that should must resolve the rkorkie's problem above mentioned.

Download v1.01 from my home page

@rkorkie
Posts the result.

NTSITA

jankster
17th February 2003, 16:07
Ntsita,

Thanks for your responce. I'll chew on it for awhile and play around with it.

rkorkie
19th February 2003, 05:24
Hey Ntsita...thanx for the tool. I don't notice any difference in the output from CCE 2.01, however, maybe it's slightly more automated. Were those the improvements made?

Ntsita
25th February 2003, 11:35
Is anyone interested to 'Bach One Pass VBR' for many .avs input processing?

I'm very undecided if work on this.:rolleyes:

rkorkie
25th February 2003, 16:44
yes, that would be very handy. Typically I do my encoding in batches, so it would be nice if I could find the Q in batches. I've been experimenting with the Roba and the Bach method for transcoding, and I'm not convinced I can tell the differences. What do you think?

Ntsita
25th February 2003, 16:47
Only difference that i have noticed, is in the speed.:D :D :D

VILLA21
26th February 2003, 12:43
"...btw: my tip to guesstimate the final file size is GOP dependent. So, if you are setting the GOP in CCE using M=3 and N/M=4, you need to use
selectrangeevery(1200,12)..."

@Bach, how do u calculate the x,y values of the selecteveryrange command from M and N/M GOP values?

Ntsita
27th February 2003, 08:28
It's simple.
SelectRangeEvery (X,Y)...where
'Y' value= (M)x(N/M)
'X' value= 100 x Y

Hi.:)

humet
6th March 2003, 17:46
Hi,

Ntsita's Bach One Pass VBR v1.01 doesn't work properly on my computer, some of the mouse clicks are off a bit.

Ntsita
6th March 2003, 20:00
During automation, you don't move mouse and keyboard.
If you so did, please be more specific with problem.

humet
6th March 2003, 20:07
I do not move the mouse or keyboard.

The mouse clicks just above the title, and stops.

Ntsita
7th March 2003, 09:04
@Humet
Do you have loaded your *.avs in CCE before run 'Bach one Pass' tool?

humet
7th March 2003, 09:12
@ Ntsita

Yeh i have, what resolution does my screen have to be, does it matter?

thanks

Ntsita
7th March 2003, 09:36
No, it doesn't.
Then, when you run the tool, you:
enter the videofile size
accept the size entered
choose if encode whole movie
choose if shutdown pc (if choosen to encode whole movie)
enter in the 'open file' window the same avs already loaded in CCE

and tool stops here?

(i think you are in Main CCE Window when run the tool, right?)

humet
7th March 2003, 11:19
@ Ntsita

It does all of that, then, the main CCE Window moves, then the mouse cursor moves to just above the row with my AVS file loaded and it clicks.

Ntsita
7th March 2003, 12:11
The problem is in double-click mouse.
Try (when the tool is stopped... actually, it waits a window that doesn't appear) to double-click the avs line.
In this manner, the tool would go to next step.

However this, doesn't resolve the problem.

I'll try to resolve your problem two weeks later on (i'm in vacation for a week).

Hi.

humet
7th March 2003, 15:40
@Ntsita

After I Have double clicked the AVS line, It works, then it stops just above the OK button, it also doesn't change the QValue.

whirlpool
9th March 2003, 18:47
Bach - Question, does determinining the best Q value for Single Pass VBR give as accurate control over the overall reencoded size as using multipass VBR and setting the bitrate? Varying the Q value by 1 does not give as much control as varying the Avge Bit rate by 1, do you get my point?

I've re-written CCE_OPVBR_Q_Finder (mentioned in earlier posts) as it was incorrectly coded (This version uses scriptit and doesn't have any dependency on screen resolution).

It correctly finds the required Q value based on 1% of the film, but, wouldn't it be better to use 1% of the film and VBR 2 pass and optimise the average encoding rate to get a desired size.

It seems to me that varying the average bit rate must produce a finer level of control over the final size, (compared to varying Q. A difference of 1 in the q value can produce a significant difference in the final size).

whirlpool
10th March 2003, 20:57
Bach, thanks for the reply. Yes, I take your point, a good approximation to the desired size may be more preferable to some people than the extra time spent getting closer to the desired size.

I plan to do a test to convince myself that the results from the 1 pass Q approxiation method are visually as good as the multipass VBR method. Once I'm convinced, I'll use the 1 pass method for future reencode projects.

Thanks for the advice.

The_Flash
24th March 2003, 05:34
I was a big fan of running 5-passes w/ CCE. I've tried encoding using an optimal Q in v2.67 and I can visually see very little (if any) difference. That's a good thing. Consider me converted. Thanks to all for the helpful advice and useful tools.