Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: ffmpeg console progress bar

by jwkrahn (Monsignor)
on Feb 20, 2013 at 02:28 UTC ( #1019686=note: print w/ replies, xml ) Need Help??

in reply to ffmpeg console progress bar

my $frametotal,$fwide,$fhigh;

You need to enclose the list of variables in parentheses or my will only work on $frametotal.

my ( $frametotal, $fwide, $fhigh );


That is usually written as:

push @vcmd, "-vf", "scale=min(1280\\,iw):-1";

if($a eq "progress") { my $pcent=$prog{"frame"}/$frametotal*100; my $hcent=int($pcent/2); my $bar="[".("#" x $hcent).(" " x (50-$hcent))." ] "; $bar .=sprintf("%.2f",$pcent)."% fps=".$prog{"fps"}; print "\r$bar"; }

I would probably write that as:

next if $x ne 'progress'; my $pcent = $prog{ frame } / $frametotal * 100; printf '%s[%-50s ] %.2f%% fps=%s', "\r", '#' x int( $pcent / 2 ), +$pcent, $prog{ fps };

Comment on Re: ffmpeg console progress bar
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1019686]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2015-11-28 20:52 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (744 votes), past polls