Last active
August 29, 2015 13:56
-
-
Save squm/8861586 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use File::Find; | |
use Cwd; | |
my $filetype = '.m4a$'; | |
find(\&wanted, getcwd); | |
sub wanted { | |
return if -d; | |
return unless (/$filetype/); | |
my @info = `ffprobe -i $_ 2>&1`; | |
my @filter = grep /Duration:/, @info; | |
$_ = pop @filter; | |
chomp; | |
s/,.*//; | |
print "$_ $File::Find::name\n"; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use File::Find; | |
use Cwd; | |
my $filetype = '.m4a$'; | |
my @len_name; | |
find(\&wanted, getcwd); | |
print sort @len_name; | |
sub wanted { | |
return if -d; | |
return unless (/$filetype/); | |
my @info = `ffmpeg -i $_ 2>&1`; | |
my @filter = grep /Duration:/, @info; | |
$_ = pop @filter; | |
chomp; | |
s/,.*//; | |
# print "$_ $File::Find::name\n"; | |
# push @len_name, [$_, $File::Find::name]; | |
push @len_name, "$_ $File::Find::name\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment