Log in

View Full Version : TMPGEnc 1 pass vbr. Accurate file size prediction.


Vorny
25th September 2002, 02:02
TMPGEnc VBR. Accurate file size prediction.

Updated 3 OCT 2002.

Most people encode a sample of a movie to ascertain
visual quality and to estimate final file size.
The problem is where to take this sample from, taking
only one sample does not give a good overall view of the
movie and does not give reliable size prediction.


Simple explanation of the script:
The script takes a x second sample, every
x seconds of the movie, then splices them together.

Brief, how to:
(a) Use DVD2AVI to generate your d2v file.

(b) Open the d2v file in FitCD, check and adjust settings
if necessary, then save in FitCD to get your basic script.

(c) Edit, copy and past your script and mine,(See note 1.)
save as whatever.avs.

(d) Open the avs file in TMPGEnc.

(e) Check and view the source range in TMPGEnc, hit the
default button, move to end frame, adjust the slider
to an even minute mark, then set end frame.

(f) Set TMPGEnc to encode - System (video only).

(g) Encode test file.

(h) Divide, encoded test file size by source range time,
then multiply by full movie time.

(i) Use a data rate calculator to establish audio only file size.

(j) Add calculated video and audio files sizes together for full
movie file size. (See note 2.)


Notes:
1. Anything after a # is ignored by the program.

2. On an average, the final full movie file size is 5%
smaller then estimated.


Any comments, questions or suggestions are welcomed.
Please feel free to test, modify and post your results.


# Start of Script
#
# Paste your script in here.
LoadPlugin("D:\Program files\CDR\MPEG2DEC.dll")
Mpeg2Source("D:\Trains_Plains\movie.d2v")
Crop(11,0,704,576)
TemporalSmoother(2,2)
BicubicResize(320,224,0.333,0.333,0,0,704,576)
AddBorders(16,32,16,32)
FadeOut(75)
#
PT = 20 # theoretically a higher number=greater accuracy.
FR = round(Framerate) # frames per second.
IL = (Framecount / FR) /PT # interval length.
SL = 17 # sample length in frames.
SelectRangeEvery(IL,SL)
#
# End of script.

WarpEnterprises
26th September 2002, 20:41
What about

SelectRange(25*45, 3*25)

:D

Btw 3sec samples are quite short as the encoder than creates "scene changes".

Vorny
27th September 2002, 07:16
You are right, the sample seems quite short.
I have tried a variety of sample times, every x seconds in an aim for greater accuracy .

Could you please explain:
SelectRange(25*45, 3*25), in a bit more detail.

WarpEnterprises
27th September 2002, 12:27
Its a function from mpeg2dec.dll which outputs

SelectRange(every_n_frames, length_in_frames)

Thats the same as
Trim(0,length_in_frames) + trim(every_n_frames,every_n_frames+length_in_frames) + ....

Clear?

Vorny
30th September 2002, 05:30
Thanks for the info WarpEnterprises,
Original post has been updated to reflect your suggestions.
:)

Vorny
1st October 2002, 13:33
TMPGEnc Accurate file size prediction.
Script updated 3-oct -2002.

cfm
24th July 2003, 10:19
The reason why this method will always predict a file size larger than real is because you create a scene change each time the script jumps from one place in the movie to the next. I've use this technique successfully on AVI movies. There I examined the size of the individual frames in the .stats file and ignore the key frames at the start of each segment. This gave me a better predicted size.

Is there a way where one can examine a file equivalent to the .stats file and filter out the artificial key frames before doing the size prediction?