digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Video Encoding and Conversion (http://www.digitalfaq.com/archives/encode/)
-   -   target Filesize is always greater than predicted? (http://www.digitalfaq.com/archives/encode/2617-target-filesize-greater.html)

alfredini 02-14-2003 08:37 PM

target Filesize is always greater than predicted?
 
If i calculate a cq with frames/minutes/10*filesize = target filesize e.g. the target Filesize is always greater then predicted. How does the calculation work with a tighter GOP?

Here is my AVS Script:
Code:

LoadPlugin("C:\AVSFilter\Plugins\MPEG2DEC.dll")
LoadPlugin("C:\AVSFilter\Plugins\legalclip.dll")
LoadPlugin("C:\AVSFilter\Plugins\MSharpen.dll")
LoadPlugin("C:\AVSFilter\Plugins\Convolution3D.dll")
LoadPlugin("C:\AVSFilter\Plugins\fluxsmooth.dll")
LoadPlugin("C:\AVSFilter\Plugins\sampler.dll")

AviSource("C:\Anime\GTO1.Avi")
LegalClip()
BilinearResize(336,272,3,0,506,384)
MSharpen()
FluxSmooth(15,10)
AddBorders(8,8,8,8)
LegalClip()
Sampler(length=10)


rendalunit 02-14-2003 09:17 PM

I'm not positive about this but I think you need to change the prediction formula to Predicted MPEG size = (( Total frames/MovieTimeInMinutes) / 10 ) * MPEG sample file size Someone please correct me if I'm wrong :hammer:

alfredini 02-14-2003 09:19 PM

Quote:

Originally Posted by rendalunit
I'm not positive about this but I think you need to change the prediction formula to Predicted MPEG size = (( Total frames/MovieTimeInMinutes) / 10 ) * MPEG sample file size Someone please correct me if I'm wrong :hammer:

This is what i am doing without getting usable results :(
Plz suggest anything! and i will try it :lol:

rendalunit 02-14-2003 09:29 PM

is Detect scene change unchecked in Tmpg?

alfredini 02-14-2003 09:34 PM

yes... unchecked.

rendalunit 02-14-2003 09:47 PM

that's really weird 8O Have you tried sampler(length=24)?

alfredini 02-14-2003 09:51 PM

Quote:

Originally Posted by rendalunit
that's really weird 8O Have you tried sampler(length=24)?

yes... with length=24 and GOP(max)=24 i get the predicted filesize but not with gop=10 (or 12 or 15) :(
What.... can... i.... do.........????? hm.... :roll:

kwag 02-14-2003 10:04 PM

Re: Anime. GOP = 10..15! How to calculate Filsize?
 
Quote:

Originally Posted by alfredini
If i calculate a cq with frames/minutes/10*filesize = target filesize e.g. the target Filesize is always greater then predicted. How does the calculation work with a tighter GOP?

The tighter the GOP, the less the compression, and the more samples must be taken. 10 is just not enough frames for an accurate calculation unless you take many more samples. Try taking 250 samples of 10 frames. :roll:

-kwag

alfredini 02-14-2003 10:29 PM

Re: Anime. GOP = 10..15! How to calculate Filsize?
 
Quote:

Originally Posted by kwag
The tighter the GOP, the less the compression, and the more samples must be taken. 10 is just not enough frames for an accurate calculation unless you take many more samples. Try taking 250 samples of 10 frames. :roll:

-kwag

You mean something like:
Code:

IL = Framecount / 250
SL = 10
SelectRangeEvery(IL,SL)

??????
How would be the prediction formula then?

rendalunit 02-15-2003 01:01 AM

i think you could do that like this: sampler(samples=250, length=10)

then the formula would be (FrameCount*SampleSize) / (NumberOfSamples*SampleLength) = PredictedFileSize

jorel 02-15-2003 01:34 AM

Quote:

Originally Posted by rendalunit
i think you could do that like this: sampler(samples=250, length=10)

then the formula would be (FrameCount*SampleSize) / (NumberOfSamples*SampleLength) = PredictedFileSize

really good rendalunit,i will try it ! :D

alfredini 02-15-2003 08:58 AM

Thanks rendalunit i'm going to try it :)

alfredini 02-15-2003 10:06 AM

it works it works yoohoo... thanks again kwag and rendalunit :D
:ole:

jorel 02-15-2003 10:43 AM

Quote:

Originally Posted by alfredini
it works it works yoohoo... thanks again kwag and rendalunit :D
:ole:

yes,yes.......(i'm without words)...it's really :wink:

thank you !!!!!!! 8)

jorel 02-15-2003 01:58 PM

Quote:

Originally Posted by rendalunit
i think you could do that like this: sampler(samples=250, length=10)

then the formula would be (FrameCount*SampleSize) / (NumberOfSamples*SampleLength) = PredictedFileSize

hey rendalunit,
i lost something... :? :?

can you post a "sample script" with "numbers" please?
:imstupid: and deserve :gun:

thanks in advance friend!!! :wink:

rendalunit 02-15-2003 02:32 PM

sure, jorel
I'm doing "signs" now with this script
Code:

LoadPlugin("D:\encoding\MPEG2DEC.dll")
LoadPlugin("D:\encoding\FluxSmooth.dll")
LoadPlugin("D:\encoding\blockbuster.dll")
LoadPlugin("D:\encoding\legalclip.dll")
LoadPlugin("D:\encoding\sampler.dll")
LoadPlugin("D:\encoding\Dustv5.dll")
LoadPlugin("D:\encoding\Convolution3D.dll")

SampleSize=11.966
CQ=73

MPEG2Source("C:\Signs\VIDEO_TS\signs.d2v")
LegalClip()
BicubicResize(512,344,0,0.6,3,0,714,480)
SpaceDust()
FluxSmooth()
#Blockbuster(method="noise", variance=0.5, seed=1)
AddBorders(8,68,8,68)
LegalClip()

trim(Round((Framecount/2)-((Framecount/10)/2)),Round((Framecount/2)+((Framecount/10)/2)))
Prediction("Signs", 1, 0.99, SampleSize, CQ, MinAudioBitrate=128).  Sampler(length=24)


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

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

{
movie = default(movie,"No_Title_Defined")
factor = default(factor,0.98)
cds = default(cds,0)
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 = 814080*cds  #1CD=795MB -> (video+audio)


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=$00CCCC, 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(SampleSize),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=$FF0000).
\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
}


jorel 02-15-2003 02:37 PM

:D

thanks friend "ren" (friendalunit)!
now i need time to read and understand it all! :wink:

it's..... 8O for me.

jorel 02-16-2003 12:57 AM

:)
rendalunit,please my friend:

how can i use this "formula":
(FrameCount*SampleSize) / (NumberOfSamples*SampleLength) = PredictedFileSize

i got this script using fitcd:
(i'm thankfull to Kwag and muaddib that helps me a lot to learn(all) fitcd):

LoadPlugin("D:\convert\FitCD_v1.0.5_Prediction&Fil ters_v0.2\MPEG2DEC3.dll")
LoadPlugin("D:\convert\FitCD_v1.0.5_Prediction&Fil ters_v0.2\legalclip.dll")
LoadPlugin("D:\convert\FitCD_v1.0.5_Prediction&Fil ters_v0.2\decomblegacy.dll")
LoadPlugin("D:\convert\FitCD_v1.0.5_Prediction&Fil ters_v0.2\dustv5.dll")
LoadPlugin("D:\convert\FitCD_v1.0.5_Prediction&Fil ters_v0.2\temporalcleanerold.dll")
LoadPlugin("D:\convert\FitCD_v1.0.5_Prediction&Fil ters_v0.2\blockbuster.dll")
LoadPlugin("D:\convert\FitCD_v1.0.5_Prediction&Fil ters_v0.2\sampler.dll")

Mpeg2Source("D:\convert\352x480\01.d2v")
LegalClip()
FieldDeinterlace()
LanczosResize(352,480,8,0,704,480)
SpaceDust()
TemporalCleaner()
Blockbuster(method="noise", variance=.3, seed=1)
#AddBorders(0,0,0,0)
LegalClip()

Sampler(length=24)
## MPEG size = ((Total frames/MovieTimeInMinutes)/24) * MPEG sample file size ##

with:
166274,
93 minutes
/24

got 8,61mb(m2v)
and with headAC3 = 105 mb(mp2)(it's musical and i encode in 160)

then how can i apply this "formula"?

i need a "pratic" to use this for all encodes. :oops:

oh yes,of course...


:imstupid: and :BangHead: and i deserve lots of.... :punch:


please don't be :jawdrop: with me friend.

thanks a lot in advance! :wink:

rendalunit 02-16-2003 02:15 AM

Quote:

Originally Posted by jorel
how can i use this "formula":
(FrameCount*SampleSize) / (NumberOfSamples*SampleLength) = PredictedFileSize

Sampler(length=24)
## MPEG size = ((Total frames/MovieTimeInMinutes)/24) * MPEG sample file size ##

with:
166274,
93 minutes
/24

got 8,61mb(m2v)
and with headAC3 = 105 mb(mp2)(it's musical and i encode in 160)

(FrameCount*SampleSize) / (NumberOfSamples*SampleLength) = PredictedFileSize

Framecount = 166274
Samplesize = 8.61 mb

NumberofSamples = 93
SampleLength = 24

(166274 * 8.61) / (93 * 24) =
1431619.14 mb / 2232 frames = 641.4mb + 105 mb(audio@160kbps) = 746mb

what musical is it? I love music from all the lands :wink:
-ren

jorel 02-16-2003 02:47 AM

:D :D :D :encore: :yippie: :mrgreen:

thanks my "friendalunit" you're fantastic!!!!!! :wink:

with your guide i will get what i need now!!

the musical is "night in eden"(Sarah Brigthman)(write "brightman"? :? )
and after this i will:
la luna (of Sarah too,really cool)
jimi hendrix(all that i got)
led zep(the song remains the same)
roy orbison(black&white night)
and i'm search for beatles(let it be)
rush.....santana
and tons more!

do you like this?
the reason i use 160mp2 and maybe turn to 192 is musicals.
i extract the ac3 to wave,go to sound forge and t-racks,
turbo and clean all that need and encode again in headAC3he to mp2
and normalize to 95%.the result is a clear sound. 8)
i have special atention to quality not for volume,than i normalize to 95%. :wink:
sounds like a soft wind.

thanks again friend rendalunit!
:D


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

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.