02-24-2003, 04:03 PM
|
Free Member
|
|
Join Date: Jan 2003
Posts: 155
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I´m trying to program a little application to automate file prediction, and I've got these results, using the "standard" prediction formula.
Code:
352x576, 25
Audio Size: 98208288
Required Video Size: 714810867
Factor: 62,5
Desired Sample Size: 11436974
Initial CQ: 60
Sample Size: 9813015
Next CQ: 69,929
Sample Size: 12158440
Next CQ: 65,771
Sample Size: 10783107
Next CQ: 69,694
Sample Size: 12126907
Next CQ: 65,725
Sample Size: 10783176
Next CQ: 69,705
Sample Size: 12126344
Next CQ: 65,738
Sample Size: 10782404
Next CQ: 69,729
Sample Size: 12128252
Next CQ: 65,755
It diverges !
Ok, you gurus, what kind of strategy could I use to stop this thing happen ?
How many times do I need to predict ?
What file size is aceptable (5% deviation of estimated file, 10 %...) ?
Any other advice is really welcome.
Thank you in advance
|
Someday, 12:01 PM
|
|
Site Staff / Ad Manager
|
|
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
|
|
|
02-24-2003, 05:38 PM
|
Free Member
|
|
Join Date: Jul 2002
Posts: 1,224
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
@hedix,
I suppose this is a program you've written. I'm using a macro program
called "AutoIt" to loop (keep excuting) until the target file size is within
+-3%. I supply the audio file size and it does the rest from an avs
script I've created using "MovieStacker". To decide how to help you,
we need to know more about your process.
-black prince
|
02-24-2003, 06:22 PM
|
Free Member
|
|
Join Date: Jan 2003
Posts: 155
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
OK. Here I go.
It is a delphi program. I supose it does basically the things your script does.
I feed an AVS (with filters, gripcrop...etc), the audio file, min and max bitrate, initial CQ, MPG-1 or MPG-2. I pretend to include number of cd's ..etc.
When I finish the program, I pretend it to do the non-thinking things: I will feed the AVS, and the application will extract and compress the audio, the prediction, and then encode.
The source code prediction section:
Code:
//1st pass for prediction
iAudioSize:=FileGetSize(eAudio.Text);
iVideoSpace:=CD_800_SIZE - iAudioSize;
fFactor:= iFrameCount/fMovieTimeInMinutes/24;
iDesiredSampleSize:= Round(iVideoSpace/fFactor);
fNextCQ:=StrToFloat(eQuality.Text);
and then loops
Code:
Set_VTPR_Values(fNextCQ,slVTPR);
ExecWait('"C:\Program Files\TMPGEnc2.58\TMPGEnc.exe"','"'+eWork.Text+'\video.tpr" /Encode /Close');
iSampleSize :=FileGetSize(eWork.Text+'\video.mpv');
fNextCQ:=iDesiredSampleSize/iSampleSize*fNextCQ;
The target of the program is to encode AVIs, and I am programming it for personal use. Obviously, if you find it of general interest, I will give you, when it is finished.
The main reason to develop this is lazyness  , and to learn. I'm learning from delaosa work, ACP, and from DVD2SVCD, a lot.
Matrix and GOP are coded, so the program focus on KVCD.
The question is: What to do when I have "Predicted" six or more times (like in the example in my first post), and I can´t reach that 3% you say.
I think six predictions must be enough... or...
|
02-24-2003, 08:53 PM
|
Free Member
|
|
Join Date: Jul 2002
Posts: 1,224
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
@hedix,
SansGrip was in the process of creating such a program that would give
a final prediction. My process takes 2 to 4 passes before reaching an
approximate file size of +-3%. My program is based on the manual
process we use at KVCD with the new 10% sample in my avs. This
speeds my prediction from ~20 minutes to ~3 or 4 minutes. The results
are close to the actual encoded file size. I would like to see an
automated program available at KVCD for file size prediction. Present
your program in the Delphi forum where there are quote gurus that
can help you with coding problems.  Check with VHelp in the Delphi
Forum here at KVCD.
-black prince
|
02-25-2003, 02:21 AM
|
Invalid Email / Banned / Spammer
|
|
Join Date: Aug 2002
Location: Brasil - MG - third stone from the sun
Posts: 5,570
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
black prince, hedix and all....
my sincere impression without breaking any "rule" :
seems.....
waiting for you and "gurus that can help"!
ps:
you are gurus too!
|
02-25-2003, 06:39 AM
|
Free Member
|
|
Join Date: May 2002
Posts: 438
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Inside the loop:
1) Save previous CQ and Sample Size.
2) Calculate a rate of CQ against Size.
3) use this in a linear equation y=ax+b
Code:
DeltaSize:=(SampleSize-PreviousSampleSize); //Size variation
DeltaCQ:=(NextCQ-PreviousCQ); // for the given CQ variation
CQSlope:=DeltaCQ/DeltaSize; // CQxSize rate
PreviousCQ:=NextCQ; //saves last run CQ
PreviousSAmpleSize:=SampleSize; //saves last run Size
NextCQ:=NextCQ+(DesiredSize-SampleSize)*CQSlope; // calculates the new CQ
Say
PreviousCQ=60
PreviousSampleSize=8000K
NextCQ=70
SampleSize=10000K
desiredSize=9000K
Then
DeltaSize=10000-8000=2000
DeltaCQ=70-60=10
CQSlope=10/2000=0.005
NextCQ=70+(9000-10000)*0.005=70-1000*0.005=70-5=65
This won't diverge unless your movie needs CQ>100 to reach the desired size (so you may want to put a max CQ to stop the looping).
I'd be interested in using your software if you decide to make it public.
GFR
|
02-25-2003, 06:50 AM
|
Free Member
|
|
Join Date: May 2002
Posts: 438
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
PS
You may also want to stop the loop if the CQ changes are below a certain threshold (like for example 0.1 or 0.05).
|
02-25-2003, 06:54 AM
|
Free Member
|
|
Join Date: Jan 2003
Posts: 155
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thank you all !
OK, GRF, I'll try your formula, and I'll tell you.
Black prince wrote Quote:
My program is based on the manual
process we use at KVCD with the new 10% sample in my avs
|
Hey, black prince, I'm trying the 10% thing too, but I can´t get the acuracy you said. Could yo please post the script and formulas for this ultra-low-time prediction ?
Edit: formal prediction results CQ: 67,02
10% prediction results CQ: 64,35
And jorel,
Quote:
jorel: 592 posts  (knowledge, don´t fool me)
hedix: 11 posts
guru....naaaaa...just playing !
|
02-25-2003, 12:11 PM
|
Invalid Email / Banned / Spammer
|
|
Join Date: Aug 2002
Location: Brasil - MG - third stone from the sun
Posts: 5,570
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
@ hedix,
you wrote:
"jorel: 592 posts (knowledge, don´t fool me)
hedix: 11 posts"
an explanation about my 592 posts:
200 was for ask,
250 was for thanks
other posts are mix of: ...i dont understand  ...what?  .....oh no  .....sorry  ....
where is it?  ....heeeeeeeeeeelp!!!  , ...
things like this!
to teach anything: 0 (zero)
to learn in future: maybe,more or less 99999999999999,9 posts
hedix: 11 posts....yeah,but with a big project!
GFR rocks too,like other gurus here!
ps:
don't need to post the names of other gurus,is clever in the forum!
thank you!
|
02-25-2003, 03:07 PM
|
Free Member
|
|
Join Date: Jun 2002
Location: Germany
Posts: 1,288
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
@black prince:
Did you say you had that program done? Well if it works for you, it might work for others  ! This would be more than useful to me because i'm lazy too !
__________________
j3llyG0053
|
02-25-2003, 03:36 PM
|
Free Member
|
|
Join Date: Apr 2002
Location: san jose, Ca
Posts: 1,148
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
hi black prince,
I'm lazy three  Is AutoIt easy to use? What does an AutoIt script look like? I've downloaded AutoIt but I can't install it yet because I'm encoding now
thnx,
ren
|
02-26-2003, 01:45 AM
|
Invalid Email / Banned / Spammer
|
|
Join Date: Aug 2002
Location: Brasil - MG - third stone from the sun
Posts: 5,570
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Jellygoose, ren ,hedix, GFR, black prince:
i'm a lazy four,(and maybe this is a thread "lazy tree").
ren, like you i was download autoit,but don't try yet.
"Well if it works for you, it might work for others..."
yes i think the same!
waiting.....but seems ok and working.
|
02-26-2003, 12:48 PM
|
Free Member
|
|
Join Date: Jul 2002
Posts: 1,224
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
@All,
I want to find a better way than "AutoIt". It still requires some manual
setup, e.g. total frames, total time, sampler frames, etc. I'm almost
as fast as "AutoIt" using Ren's 10% file prediction method. I hope
hedix can develope a stand-alone program to do the same thing.
SansGrip mentioned working on this before he disappeared. I hope
when he returns, he'll continue with an automated program
-black prince
|
02-26-2003, 12:55 PM
|
Free Member
|
|
Join Date: Nov 2002
Location: Ontario, Canada
Posts: 1,135
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by black prince
I hope when he returns, he'll continue with an automated program 
|
I hope he does too  .
|
02-26-2003, 01:05 PM
|
Free Member
|
|
Join Date: Jul 2002
Posts: 1,224
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
@Hey SansGrip,
Great to hear from you!!!  We thought you were drafted into the
war in Iraq on a secret mission and had to leave without telling
anyone. They heard about your filters (e.g. GripFit, etc.) and
needed you to convert satelite video survilance of Iraq into a
KVCD to fit on 1 CD. Any way good to see you again
-black prince
|
02-26-2003, 03:16 PM
|
Free Member
|
|
Join Date: Nov 2002
Location: Ontario, Canada
Posts: 1,135
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by black prince
convert satelite video survilance of Iraq into a KVCD to fit on 1 CD.
|
lol -- now that would be something to put in the "announcements" forum  .
|
03-18-2003, 08:44 AM
|
Free Member
|
|
Join Date: Aug 2002
Posts: 130
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
so what file prediction have we settled on for 1CD and 2CD encodes? I am having trouble setting this since the prediction needs to be changed for the amount of CD's you want. If I set a prediction for 1CD and looks fine then do a 2CD with the same prediction the file sizes are way off.
Thanks
|
03-18-2003, 11:24 AM
|
Free Member
|
|
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi Holomatrix,
You just use the same formula, but target for twice the size. For 2 CD's, it's basically 1600MB - YourAudioSize (if you are using 80 minute CDs )
Use ToK, it's easier
-kwag
|
03-18-2003, 12:47 PM
|
Free Member
|
|
Join Date: Aug 2002
Posts: 130
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
We'll why I ask this, is that the same move, same file prediction gave me 782meg for 1CD and 1800meg for two CD's. So looks like I would need to increase file prediction for 1CD but decrease file prediction for two CD's.
What file prediction do you stick with? 1.15 (74CQ) was good for 101min move "FEARDOTCOM" 528x480 gave me around 800meg file.
Thanks
|
03-18-2003, 01:21 PM
|
Free Member
|
|
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by Holomatrix
1.15 (74CQ)
|
I see 1.15, so I assume you're using KVCDPredictor
Please try ToK instead of predictor, because predictor is still based on the old CQ_VBR method and it might not give accurate results with CQ.
-kwag
|
All times are GMT -5. The time now is 12:26 AM — vBulletin © Jelsoft Enterprises Ltd
|