Estimating Handbrake Output File Length - Solved

HandBrake for Windows support
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Locked
MajorHeadrush
Posts: 1
Joined: Tue Jun 11, 2019 7:57 pm

Estimating Handbrake Output File Length - Solved

Post by MajorHeadrush » Tue Jun 11, 2019 8:16 pm

Estimating Handbrake Output File Length - Solved

So Handbrakes programmers cant figure out how to estimate output file size in a way that is helpful to users so i figured it out and will program it in qb64.

Its pretty simple really

so handbrake knows the size and length of the source and the preview... it simply needs to take this information and produce the estimate. from the tests ive run it seems like if a video is over 500 mbs you should times your estimate by 1.3... as people mess with this algorithem they may find differnet formats react differently to the algorithem and other variables may affect it... those will probably need to have special adjustments to make the algorithem more accurate... remember were not trying to come up with the exact size of the output file... were just trying to get a rough estimate so people can adjust their settings to get a outputfile size close to what they want. So here it is....

say your source file is 28:52
28x60=1680+52=1732 seconds long
your 10 second preview file size is 335kb
335x1732=580220 just move the decimal over 58.02mb
actual size turned out to be 57.59mb
ive found for really big files with short lengths for instance 750mb file only 23 minutes long the estimate falls short so the program i write to do this little estimate is going to times files 500mb and bigger at 1.3... in my tests that gives me a close estimate but as people use it they will find different formats and other variables are going to affect this very simple program so people will have to compensate by identifying the reason for the discrepancies and programming in code that compensates.... generally speaking this program works really well for 30min videos and 1.5-2 hour videos just with the simple algorithm i have described... when i get done programming it in qb64 ill append the code to this post and post it again as a new post to the thread

mduell
Veteran User
Posts: 6547
Joined: Sat Apr 21, 2007 8:54 pm

Re: Estimating Handbrake Output File Length - Solved

Post by mduell » Tue Jun 11, 2019 10:00 pm

MajorHeadrush wrote:
Tue Jun 11, 2019 8:16 pm
so handbrake knows the size and length of the source
You can stop right there, as you don't understand several dimensions of the problem. The assumption that you can estimate the length of the video to the tolerance required without completely decoding it is wrong and a contributor to why the feature was removed.
And tiny errors in file size from tiny errors in assumed estimated length were a problem users were complaining about. If your 28:52 is really 28:54, then your output is 701MB not 700MB, and won't fit on the user's intended media.
MajorHeadrush wrote:
Tue Jun 11, 2019 8:16 pm
ive found for really big files with short lengths for instance 750mb file only 23 minutes long the estimate falls short so the program i write to do this little estimate is going to times files 500mb and bigger at 1.3... in my tests that gives me a close estimate but as people use it they will find different formats and other variables are going to affect this very simple program so people will have to compensate by identifying the reason for the discrepancies and programming in code that compensates...
So you've solved exactly none of the actual problem. :roll:

User avatar
JohnAStebbins
HandBrake Team
Posts: 5406
Joined: Sat Feb 09, 2008 7:21 pm

Re: Estimating Handbrake Output File Length - Solved

Post by JohnAStebbins » Tue Jun 11, 2019 10:21 pm

when i get done programming it in qb64 ill append the code to this post and post it again as a new post to the thread
You should start your own github project where you can discuss your code and ideas with interested parties.

We've already had this discussion with you
here https://github.com/HandBrake/HandBrake/issues/1613
and here https://github.com/HandBrake/HandBrake/issues/385
and here https://github.com/HandBrake/HandBrake/issues/2131

And the subject has also been discussed to death on these forums already
search.php?keywords=%22target+file+size%22

Enough is enough

Locked