[MEncoder-users] display only status bar
Oded Shimon
ods15 at ods15.dyndns.org
Wed Feb 16 00:53:09 CET 2005
Just wanted to throw in my 2 cents, in my experience, Perl is a blazing fast
parser, you could use this:
mencoder | perl -015 -pe '$| = 1; s/(.+\n)//g;'
You'd be surprised at how little speed you'll be loosing to this. unless you
are encoding at 500fps or so, you've got nothing to worry.
perl 0.04s user 0.02s system 8% cpu 0.676 total
That was for 3000 frames, most encodes are 10 times bigger than that, so
you're loosing 6 maybe 10 seconds...
You might want to /dev/null stderr.
BTW, if your script knows before hand the total amount of frames of the encode
and the FPS, you could try out this monstrosity:
FRAMES=5000
FPS=25
mencoder | perl -015 -pe '$| = 1;next unless /^Pos:/;s/\s+//g;s#^Pos:\d*\.?
\d*s(\d+)f\(\d*%\)(\d+)fpsTrem:\d*min\d*mbA-V:-?\d*\.?\d*\[(\d+):
(\d+)\]$#$totsecs = '$FRAMES'/'$FPS ;$tmpsecs2= ('$FRAMES' - $1)/($2?$2:25);
$tmpp = ""; $tmpp .= "=" x ($1 / '$FRAMES' * 24 + 0);$tmpp .=
">";sprintf("ETA %d:%02d:%02d %.1fMB %2d%% %dfps [%-25s] %5d/%-5d %d/%d %c",
$tmpsecs2/3600,($tmpsecs2%3600)/60,$tmpsecs2%60,($3 + $4) * $totsecs / 8 /
1024,$1 / 5314 * 100 + 0,$2,$tmpp,$1,5314,1,1,,13)#e;'
(that script should all be one line)
It shows a handy ETA, estimated file size and progress bar.
(a bit of self-advertising here, reason I know all of this and actually wrote
that disgusting script is this - http://kmenc15.sf.net/ )
- ods15
More information about the MEncoder-users
mailing list