Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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 );


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

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (9)
As of 2014-12-25 11:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (160 votes), past polls