util to tag and lower vol on vids

This commit is contained in:
Brian West 2015-06-19 21:48:23 -05:00
parent f19be2fdbc
commit 21afd1b8c7
1 changed files with 32 additions and 0 deletions

32
scripts/perl/tag.pl Executable file
View File

@ -0,0 +1,32 @@
#!/usr/bin/perl
use strict;
use warnings;
use Getopt::Long;
use Data::Dumper;
my ($title, $artist, $file, $volume);
GetOptions(
"title=s" => \$title,
"artist=s" => \$artist,
"file=s" => \$file,
"volume=s" => \$volume
) or die $@;
if (-f $file) {
my $tmp = $$;
if ($volume) {
system("avconv -i \"$file\" -vcodec copy -af \"volume=$volume\" /tmp/file$tmp.mp4");
system("mv /tmp/file$tmp.mp4 \"$file\"");
}
if ($title && $artist) {
system("avconv -i \"$file\" -metadata artist=\"$artist\" -metadata title=\"$title\" -codec copy -vcodec copy /tmp/file$tmp.mp4");
system("mv /tmp/file$tmp.mp4 \"$file\"");
}
} else {
print "$file not found.\n";
}