[FFmpeg-devel] [PATCH] ffmpeg: add progress speed to status line and report
barsnick at gmx.net
Fri Dec 11 16:49:13 CET 2015
ffmpeg.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
While this is still not a benchmark, the display of a factor "Nx" gives a
much better and easier to parse feeling for the processing speed than
looking at "fps", at the processed file time, or applying the Unix "time"
Its calculation is based on the processed file time, as already computed via
av_gettime_relative() and displayed. One floating point calculation is now
moved from conditional to unconditional code, but as this whole
status/report calculation is only done in quite large intervals, the impact
should be minimal.
I chose "%.3g" as the format string, because it covers precision and range
best for my needs (one digit less seems not informative enough), but I'm open
for any comments.
./tools/patcheck does complain:
x==0 / x!=0 can be simplified to !x / x
patcheck.stdout:40:+ speed = t != 0.0 ? (double)pts / AV_TIME_BASE / t : -1;
but I'm not sure an FP/double comparison to zero should be abbreviated "!x".
I have been using this patch for some months, and I already miss it dearly
on any platforms where I use unpatched builds. :-)
More information about the ffmpeg-devel