Quantcast Manual File Prediction: Mini How-to Guide - Page 4 - digitalFAQ.com Forums [Archives]
  #61  
11-08-2003, 11:51 AM
muhali3 muhali3 is offline
Free Member
 
Join Date: Sep 2003
Posts: 134
Thanks: 0
Thanked 0 Times in 0 Posts
i don't know if this question has already been answered inside this thread, but i don't want to read the whole thing. does the prediction method also work for CQ_VBR?
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
  #62  
11-12-2003, 01:40 AM
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 muhali3
does the prediction method also work for CQ_VBR?
Yes it does.

-kwag
Reply With Quote
  #63  
01-04-2004, 01:38 PM
Encoder Master Encoder Master is offline
Free Member
 
Join Date: Mar 2003
Location: (^_^)
Posts: 504
Thanks: 0
Thanked 0 Times in 0 Posts
*A LITTLE OFFTOPIC*

I predict my file with CQMatic with a Max. Bitrate of 2500kbps first and then I choose the TEST Sample and put it into BitrateView and look how high the max bitrate is and I change the Value and predict again. If I can put the max bitrate lower again I do it and I think it's a very good way to find out the relation between a good CQ and Max. Bitrate.
Reply With Quote
  #64  
01-04-2004, 03:04 PM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
That also depends on the CQ Value and the main problem is that by just taking a sample (no matter if continous one or sliced one) this won't include *all* peaks of your movie so this will be just a "guess" based on your "sampler" peaks.
Reply With Quote
  #65  
02-17-2004, 02:00 PM
nighthawk nighthawk is offline
Free Member
 
Join Date: Dec 2003
Posts: 90
Thanks: 0
Thanked 0 Times in 0 Posts
Is there a way to do manual file size predicition using the new avisynth 2.5? Unless I'm missing something everything here is for the 2.X version of avisynth?

I like Kwags simple script at the top of this thread but how to make it work with avisynth 2.5?

nighthawk
Reply With Quote
  #66  
02-17-2004, 02:27 PM
Prodater64 Prodater64 is offline
Free Member
 
Join Date: Mar 2003
Location: Palma de Mallorca - España
Posts: 2,925
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by nighthawk
Is there a way to do manual file size predicition using the new avisynth 2.5? Unless I'm missing something everything here is for the 2.X version of avisynth?

I like Kwags simple script at the top of this thread but how to make it work with avisynth 2.5?

nighthawk
Like prediction is made in base to calculations, no matter what avisynth version use you. The difference will be in the sample file in accord with the script that you use. Just take the prediction script, put together with your encoding script (in the right way, read the thread), run tmpgenc and get a sample. When the right sample lenght is reached, just comment the prediction line (#) in the script, and you'll get the complete movie.

SCRIPT

LoadPlugin("C:\encoding\MPEG2DEC2.dll")
LoadPlugin("C:\encoding\legalclip.dll")
LoadPlugin("C:\encoding\Dustv5.dll")
LoadPlugin("C:\encoding\BlockBuster.dll")
LoadPlugin("C:\encoding\FluxSmooth.dll")
LoadPlugin("C:\encoding\Sampler.dll")

SampleSize=0
CQ=0

movie="The Bourne Identity"
cds=2
cdtime=80
MinAudioBitrate=128
factor=0.98

Mpeg2Source("D:\THE_BOURNE_IDENTITY\VIDEO_TS\bourn e.d2v")
LegalClip()
BilinearResize(512,344,3,0,714,480)
temporalSmoother(2,2)
AddBorders(8,68,8,68)
LegalClip()

trim(0,round(framecount/10)) # 'mini'-prediction 1/10 prediction- comment this line when cq in range
prediction(movie, cds , cdtime, factor, SampleSize, CQ, MinAudioBitrate). Sampler(length=24)


#------------------------------#
# Prediction Function #
#------------------------------#

function Prediction (clip c, string "movie", int "cds", int "cdtime", float "factor", float "SampleSize", float "CQ", int "MinAudioBitrate")

{
movie = default(movie,"No_Title_Defined")
factor = default(factor,0.98)
cds = default(cds,0)
cdtime = default(cdtime,80)
SampleSize = default(SampleSize,0)
CQ = default(CQ,0)
MinAudioBitrate = default(MinAudioBitrate,128) # lowest audio bitrate wanted

MovieLength = framecount(c)/framerate(c)
FramesTotal = framecount(c)
FramesSample = framecount(Sampler(c,length=24))
CD_Size = (((cdtime*10)-5)*1024)*cds

MinAudio = (((((CD_Size-((MinAudioBitrate/8)*Movielength))*FramesSample)/FramesTotal)*factor))/1000
EncodedSample = (SampleSize==0)? false: true #--------------------------------------------------------------------
SampleSize = (SampleSize==0)? 1: SampleSize # if sample size =0 mb then no previous sample.
CQ = (CQ<=0)? 1 :CQ # set cq between 1-100
CQ = (CQ>100)?100 : CQ #---------------------------------------------------------------------
SampleSizeMessage=(EncodedSample==false)?"no sample encoded yet **********": "Sample Size (mb) : "
SampleCQMessage=(EncodedSample==false)?"no sample encoded yet **********":"Sample CQ : "
TryCQValueMessage=(EncodedSample==false)?"no sample encoded yet ******":"Try CQ value of : "

d=BlankClip(c,1,544,480).

\Subtitle(movie, 272,40, halo_color=$5500FF, text_color=$FFFFFF, font="Courier", size=27, align=5).

\Subtitle("Total Frames : " + String(FramesTotal), 80,60).
\Subtitle("Sample Frames : " + String(FramesSample), 80,80).
\Subtitle("Time (sec) : " + String(round(Movielength)), 80,100).
\Subtitle("Time (min) : " + String(round(Movielength/60)), 80,120).

\Subtitle(SampleSizeMessage+LeftStr(String(SampleS ize),5), 270,60,text_color=$FF0000).
\Subtitle(SampleCQMessage + LeftStr(String(CQ),4),270,80,text_color=$FF0000).
\Subtitle("Min. Audio Bitrate : "+ String(MinAudioBitrate)+" kbps",270,100,text_color=$FF0000).
\Subtitle("Desired Sample Size (mb) : " + LeftStr(String(MinAudio),5),270,120,text_color=$FF 0000).
\Subtitle(TryCQValueMessage + LeftStr(String((MinAudio*CQ)/SampleSize),4),270,140,text_color=$FF0000).

\Subtitle("Desired Sample Size (mb) for " + String(cds) + " CD(s):", 80,165, text_color=$FFFFFF).
\Subtitle("- audio at 96 kbps : " + LeftStr(String((((((CD_Size-((096/8)*Movielength))*FramesSample)/FramesTotal)*factor))/1000),5),80,185).
\Subtitle("- audio at 112 kbps : " + LeftStr(String((((((CD_Size-((112/8)*Movielength))*FramesSample)/FramesTotal)*factor))/1000),5),80,205).
\Subtitle("- audio at 128 kbps : " + LeftStr(String((((((CD_Size-((128/8)*Movielength))*FramesSample)/FramesTotal)*factor))/1000),5),80,225).
\Subtitle("- audio at 160 kbps : " + LeftStr(String((((((CD_Size-((160/8)*Movielength))*FramesSample)/FramesTotal)*factor))/1000),5),80,245).
\Subtitle("- audio at 192 kbps : " + LeftStr(String((((((CD_Size-((192/8)*Movielength))*FramesSample)/FramesTotal)*factor))/1000),5),80,265).
\Subtitle("- audio at 224 kbps : " + LeftStr(String((((((CD_Size-((224/8)*Movielength))*FramesSample)/FramesTotal)*factor))/1000),5),80,285).

\Subtitle("Average Bitrate (kbps) : "+ String(Round(((((CD_Size-((128/8)*Movielength)))/Movielength)*8)*1)), 80,328).

\Subtitle("Predicted Audio File Sizes (mb):", 80,373, text_color=$FFFFFF).
\Subtitle(" 96 kbps = " + String(Round(((( 96*1024)/8)*Movielength)/1048576)),80,395).
\Subtitle("112 kbps = " + String(Round((((112*1024)/8)*Movielength)/1048576)),80,416).
\Subtitle("128 kbps = " + String(Round((((128*1024)/8)*Movielength)/1048576)),80,437).
\Subtitle("160 kbps = " + String(Round((((160*1024)/8)*Movielength)/1048576)),270,395).
\Subtitle("192 kbps = " + String(Round((((192*1024)/8)*Movielength)/1048576)),270,416).
\Subtitle("224 kbps = " + String(Round((((224*1024)/8)*Movielength)/1048576)),270,437).

\BilinearResize(width(c), height(c))
return d+c+d
}

You must replace the text in red, with your own script.
Take care with the text in green.
You must comment (#) the line in blue for full encode.
Reply With Quote
  #67  
02-17-2004, 02:32 PM
nighthawk nighthawk is offline
Free Member
 
Join Date: Dec 2003
Posts: 90
Thanks: 0
Thanked 0 Times in 0 Posts
where can I find athe sampler dll for avisynth ver 2.5?
Reply With Quote
  #68  
02-17-2004, 03:24 PM
Prodater64 Prodater64 is offline
Free Member
 
Join Date: Mar 2003
Location: Palma de Mallorca - España
Posts: 2,925
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by nighthawk
where can I find athe sampler dll for avisynth ver 2.5?

http://wald.heim.at/redwood/511999//...ampler-2.5.dll
or
http://wald.heim.at/redwood/511999//...ampler-2.5.rar

Incredible, thanks for that .
Reply With Quote
  #69  
02-17-2004, 03:30 PM
nighthawk nighthawk is offline
Free Member
 
Join Date: Dec 2003
Posts: 90
Thanks: 0
Thanked 0 Times in 0 Posts


Thanks for the links!!!
Reply With Quote
  #70  
02-17-2004, 07:36 PM
Prodater64 Prodater64 is offline
Free Member
 
Join Date: Mar 2003
Location: Palma de Mallorca - España
Posts: 2,925
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by nighthawk


Thanks for the links!!!
Oh! Your welcome. But only for the links! Well, then I'll delete the previous post.
Reply With Quote
  #71  
03-09-2004, 11:30 AM
p2phunter p2phunter is offline
Free Member
 
Join Date: Mar 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Do these plugins work with AviSynth 2.5?

LoadPlugin("C:\encoding\legalclip.dll")
LoadPlugin("C:\encoding\Dustv5.dll")
LoadPlugin("C:\encoding\FluxSmooth.dll")

Cos.. I think when I tried opening a AVS which used the functions (in these dlls), WMP displayed... it is not a valid Avisynth 2.5 function.
__________________
-p2p hvnt3r-
Reply With Quote
  #72  
03-09-2004, 12:11 PM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
Legalclip is now built-in into avs2.5 and is called "Limiter".
DustV5 don't have any equivalent in 2.5 (and some are sad about that).
Fluxsmooth has a 2.5 version that you can load here :

http://www.avisynth.org/warpenterprises/

Note: as said in the hints in bottom of the message, you are not mandatory to use the provided script ! You can use your own script. So the lack of Dustv5 is not a problem.
Reply With Quote
  #73  
03-09-2004, 01:02 PM
p2phunter p2phunter is offline
Free Member
 
Join Date: Mar 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Dialhot
Note: as said in the hints in bottom of the message, you are not mandatory to use the provided script ! You can use your own script. So the lack of Dustv5 is not a problem.
Yeah... I knew that. To be honest... I dont know what they are for... but just wanted to check them out! thanks for ur info though!
__________________
-p2p hvnt3r-
Reply With Quote
  #74  
05-02-2004, 09:36 AM
gio_vanni gio_vanni is offline
Free Member
 
Join Date: Apr 2004
Location: holland
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to gio_vanni
Quote:
Originally Posted by kwag

Step 1: Determine the Audio file size.
I usually select either 112Kbps for 120+ minute movies or 128Kbps for movies shorter than that. You'll see the audio size is automatically displayed in HeadAC3he. Make a note of the size.

Step 2: Determine the Video file size.
Suppose the audio in step 1 is 87MB, and our CD-R is 700MB 80 minutes. Remember that VCDs are written in what's called "Mode-2", so a 700MB data CD-R will actually fit ~800MB in VCD format. So we'll use an 80 minute CD-R for this example.
Now do this: 800 - 87 = 713. The ~800 is your VCD capacity. So you have ~713MB left for your video stream, and this will be the predicted file size for the video. Now apply the formula like this:

Predicted MPEG size = (( Total frames/MovieTimeInMinutes) / 24 ) * MPEG sample file size [/color]

Say your movie has 198,673 frames and is 138 minutes long. You would do this: 198673 / 138 / 24 = 59.98 and store the value 59.98 in your calculator's memory for a moment. Now do this: 713 / MemoryRecall(which is 59.98 ) = 11.88MB and that's what your sample size has to be. Now you encode with SansGrip "Sampler()" line at the end of your .avs. Here's what a basic .avs script looks like, with the file prediction line added at the end:

Code:
LoadPlugin("C:\encoding\MPEG2DEC.dll")
LoadPlugin("C:\encoding\fluxsmooth.dll")
LoadPlugin("C:\encoding\sampler.dll")
LoadPlugin("C:\encoding\legalclip.dll")
mpeg2source("K:\K19\VIDEO_TS\k19.d2v")
LegalClip()
BilinearResize(672,336,0,0,720,480)
FluxSmooth()
AddBorders(16,72,16,72)
LegalClip()
Sampler()
When the encoder finishes, which should take between 3 to 6 minutes depending on how fast your machine runs, take a look at the sample file size. This is what I do to zero in faster on the correct CQ value:

New_CQ_Value = WantedSize(11.88 in this case) / Encoded_Sample_Size * Current_CQ_Value

Say your sample comes out to 10.0MB, and you are encoding with a CQ value of 25. The new CQ value for the next run is: 11.88 / 10 * 25 = 29.7 So you change the CQ value in TMPEG to 29.7 and encode another sample. It usually takes 3 to 4 samples to hit your target this way.
When you get close to the wanted file size, say < 1%, just remove the line "Sampler()" from your .avs script and when you hit encode again, your complete movie will start to encode.

Hope this helps

-kwag

The som from the calculate ( 11.88 Mb ) is that the sample size for only the video stream or video + audio stream?

24 where is that number for?

And is there a simple calculate for audio + video stream sample together???
__________________
Tha World Is Yours!!!
Reply With Quote
  #75  
05-03-2004, 11:42 PM
gio_vanni gio_vanni is offline
Free Member
 
Join Date: Apr 2004
Location: holland
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to gio_vanni
Nobody has a answer?
__________________
Tha World Is Yours!!!
Reply With Quote
  #76  
05-04-2004, 12:23 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
Quote:
Originally Posted by gio_vanni
Nobody has a answer?
steps one and two that you quoted have the answers for your questions:

1-the sample size for the video stream only.

2-where?...easy to understand but for me is hard to explain, please see the read-me that came with sampler!

3-your question here answer your first question !
no, cos don't need. you know the media and audio size before the prediction and the prediction will find the CQ to get the video size needed

just follow the examples posted in steps one and two!
Reply With Quote
  #77  
05-04-2004, 04:13 PM
gio_vanni gio_vanni is offline
Free Member
 
Join Date: Apr 2004
Location: holland
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to gio_vanni
Quote:
Originally Posted by jorel
Quote:
Originally Posted by gio_vanni
Nobody has a answer?
steps one and two that you quoted have the answers for your questions:

1-the sample size for the video stream only.

2-where?...easy to understand but for me is hard to explain, please see the read-me that came with sampler!

3-your question here answer your first question !
no, cos don't need. you know the media and audio size before the prediction and the prediction will find the CQ to get the video size needed

just follow the examples posted in steps one and two!
Thanx
__________________
Tha World Is Yours!!!
Reply With Quote
  #78  
05-04-2004, 04:20 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 gio_vanni
24 where is that number for?
Frame rate (FPS).

-kwag
Reply With Quote
  #79  
05-06-2004, 07:13 AM
gio_vanni gio_vanni is offline
Free Member
 
Join Date: Apr 2004
Location: holland
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to gio_vanni
Thx kwag
__________________
Tha World Is Yours!!!
Reply With Quote
  #80  
07-10-2004, 02:02 PM
adiinbar adiinbar is offline
Free Member
 
Join Date: Jul 2004
Location: Israel
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to adiinbar Send a message via MSN to adiinbar
Hi Kwag

I was wondering if your prediction method works with CQ_VBR as well as CQ or is it a CQ only thing...
__________________
Here I'm allowed everything all of the time.
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
KVCD Predictor or Manual Prediction vhelp Avisynth Scripting 12 08-08-2004 02:59 AM
Mencoder: New mini-guide for KSVCD maurus Video Encoding and Conversion 0 05-31-2004 04:28 AM
Where to get DVD to mini-kDVD guide ? Critter Video Encoding and Conversion 0 11-03-2003 01:50 AM
Mini guide to make GOOD mp3s! azel Audio Conversion 0 10-03-2003 03:54 PM
File prediction using TMPGEnc method from KVCD guide wretched Avisynth Scripting 8 05-25-2003 05:35 PM

Thread Tools



 
All times are GMT -5. The time now is 11:15 AM  —  vBulletin © Jelsoft Enterprises Ltd