Quantcast Adjusting File Prediction - digitalFAQ.com Forums [Archives]
  #1  
02-24-2003, 05:03 PM
hedix hedix is offline
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
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
02-24-2003, 06:38 PM
black prince black prince is offline
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
Reply With Quote
  #3  
02-24-2003, 07:22 PM
hedix hedix is offline
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...
Reply With Quote
  #4  
02-24-2003, 09:53 PM
black prince black prince is offline
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
Reply With Quote
  #5  
02-25-2003, 03:21 AM
jorel jorel is offline
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!
Reply With Quote
  #6  
02-25-2003, 07:39 AM
GFR GFR is offline
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
Reply With Quote
  #7  
02-25-2003, 07:50 AM
GFR GFR is offline
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).
Reply With Quote
  #8  
02-25-2003, 07:54 AM
hedix hedix is offline
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:
you are gurus too!
jorel: 592 posts (knowledge, donīt fool me)
hedix: 11 posts

guru....naaaaa...just playing !
Reply With Quote
  #9  
02-25-2003, 01:11 PM
jorel jorel is offline
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!
Reply With Quote
  #10  
02-25-2003, 04:07 PM
Jellygoose Jellygoose is offline
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
Reply With Quote
  #11  
02-25-2003, 04:36 PM
rendalunit rendalunit is offline
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
Reply With Quote
  #12  
02-26-2003, 02:45 AM
jorel jorel is offline
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.

Reply With Quote
  #13  
02-26-2003, 01:48 PM
black prince black prince is offline
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
Reply With Quote
  #14  
02-26-2003, 01:55 PM
SansGrip SansGrip is offline
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 .
Reply With Quote
  #15  
02-26-2003, 02:05 PM
black prince black prince is offline
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
Reply With Quote
  #16  
02-26-2003, 04:16 PM
SansGrip SansGrip is offline
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 .
Reply With Quote
  #17  
03-18-2003, 09:44 AM
Holomatrix Holomatrix is offline
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
Reply With Quote
  #18  
03-18-2003, 12:24 PM
kwag kwag is offline
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
Reply With Quote
  #19  
03-18-2003, 01:47 PM
Holomatrix Holomatrix is offline
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
Reply With Quote
  #20  
03-18-2003, 02:21 PM
kwag kwag is offline
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
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple File Prediction gd_nimrod Avisynth Scripting 12 03-09-2003 07:02 PM
Tmpgenc cannot open source file for file prediction Kane Avisynth Scripting 3 02-03-2003 02:44 PM
File prediction not working for me heyitsme Video Encoding and Conversion 2 01-30-2003 02:30 AM
File prediction problem! bsbeck Video Encoding and Conversion 1 01-18-2003 08:22 AM
KVCD: Is adjusting the letterbox causing the large file? alibrian1 Video Encoding and Conversion 1 05-18-2002 08:40 PM

Thread Tools



 
All times are GMT -5. The time now is 09:41 AM  —  vBulletin Đ Jelsoft Enterprises Ltd