Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Get size and bitrate of video with perl and ffmpeg

by jwkrahn (Monsignor)
on Jul 31, 2012 at 04:06 UTC ( #984562=note: print w/ replies, xml ) Need Help??


in reply to Get size and bitrate of video with perl and ffmpeg

while (<FILE>) { my $line = $_;

That is usually written as:

while (my $line = <FILE>) {


my @vsize = split (' ', trim ($pieces[2])); my @vbits = split (' ', trim ($pieces[3])); my $video_size = trim (shift @vsize); my $video_bits = trim (shift @vbits);

split ' ' removes ALL whitespace so the use of the trim function is superfluous.

my ( $video_size ) = split ' ', $pieces[ 2 ]; my ( $video_bits ) = split ' ', $pieces[ 3 ]


Comment on Re: Get size and bitrate of video with perl and ffmpeg
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (15)
As of 2015-07-01 17:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (13 votes), past polls