Reputation: 99
(Excuse for My english it's freak i´m from LA) I'm trying to finish a trascoding process in VB6.0 , i'm working with ffmpeg , its a very good transcoder , to finish the project i want a progress bar for the trascoding process but it's so very hard , first i need to understand , how a program can calculate the time remaining to the process if i have the inputs
I'm trying with : File size (KB) / Average Bitrate Kb/s.
In theory this must to work , but the calculated time it`s very small than the real time processed. Somebody have any idea about this , what is the formula (snipped) to calculate the time remaining in a trascoding process. in this wonderfull web i find many answer to mys projects..
Upvotes: 0
Views: 911
Reputation: 107959
The general solution for "time remaining," given:
is:
seconds_elapsed = current time - start time
seconds_per_unit = seconds_elapsed / units_processed
units_left = total_units - units_processed
seconds_remaining = unit_left / seconds_per_unit
This algorithm does best when the times to process each unit are nearly the same, or at least when the time/unit has little correlation with elapsed time. It stinks on ice if time/unit varies with elapsed time.
Upvotes: 0
Reputation: 14031
The bitrate won't help you in calculating progress.
If you have the file length in seconds, and the frame rate, and ffmpeg outputs what frame its processing right now, you can calculate the approximate time.
Upvotes: 1