Skip to content

Instantly share code, notes, and snippets.

@squm
Last active August 29, 2015 13:56
Show Gist options
  • Save squm/8861586 to your computer and use it in GitHub Desktop.
Save squm/8861586 to your computer and use it in GitHub Desktop.
#!/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";
}
#!/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