View Single Post
Old 4th December 2008, 15:55   #3308  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 7,815
Quote:
I thought I read somewhere here that you would show your size calculation algorithm Atak, but I can't seem to find it.
Code:
if copyaudiostream=1 then audiobitrate:=strtofloat(audiobps)/1000*1024; //audio bitrate taken via MediaInfo
      if audiobitrate=196608 then multiplier:=1/(size*0.008267196)/100 else  //0.00027 for 4480 MB
      if audiobitrate=229376 then multiplier:=1/(size*0.013130252)/100 else  //0.00017
      if audiobitrate=262144 then multiplier:=1/(size*0.010629252)/100 else  //0.00021
      if audiobitrate=393216 then multiplier:=1/(size*0.009704969)/100 else  //0.00023
      if audiobitrate=458752 then multiplier:=1/(size*0.013130252)/100 else  //0.00017
      if audiobitrate=655360 then multiplier:=1/(size*0.008267196)/100 else  //0.00027
      if audiobitrate=786432 then multiplier:=1/(size*0.0067640693)/100 else //0.00033  dts real bitrate is lower 737 kbps
      if audiobitrate=1572864 then multiplier:=1/(size*0.0044642857)/100;    //0.00050  dts real bitrate is lower 1474 kbps



      if audiobitrate=0 then overhead:=1.074 else overhead:=1+(duration*multiplier+4.34)/100; //if m2ts has no audio overhead is constant 

        
    if copyaudiostream=0 then tempcalc:=( (size*1048576/overhead-SubtitleFileSize*2) /duration*8-audiobitrate)/1000;
    if copyaudiostream=1 then tempcalc:=(size*1048576/overhead-AudioFileSize*1.024-SubtitleFileSize*2)/duration*8/1000; // SubtitleFileSize*2 was added in v1.11.5 to avoid oversized files with subtitles
        
    calculatebitrate:=round(tempcalc);

Last edited by Atak_Snajpera; 4th December 2008 at 16:01.
Atak_Snajpera is offline   Reply With Quote