summaryrefslogtreecommitdiff
path: root/get.pl
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-06-16 18:22:19 +0200
committerJules Laplace <julescarbon@gmail.com>2018-06-16 18:22:19 +0200
commit63fb71641373e92077d19f62fb54a9d85d5fe362 (patch)
treed82fb63c78d2b7056b433162f092c49a4a4eadee /get.pl
parentdc456449df8bc1c4072269e020196831aa64fcb7 (diff)
get
Diffstat (limited to 'get.pl')
-rwxr-xr-xget.pl7
1 files changed, 6 insertions, 1 deletions
diff --git a/get.pl b/get.pl
index b51b07a..abfa2da 100755
--- a/get.pl
+++ b/get.pl
@@ -6,6 +6,7 @@ sub sanitize ($) {
my $s = lc shift;
$s =~ s/\.[^.]+$//g;
$s =~ s/\W/_/g;
+ $s =~ s/[\(\)]/_/g;
$s =~ s/\s+/_/g;
if (length($s) == 0) {
print "fn is empty";
@@ -85,9 +86,13 @@ else {
if ($video_fn) {
print "Video filename: $video_fn\n";
my $tag = sanitize($video_fn);
+ my @partz = split(".", $video_fn);
+ my $ext = $partz[$#partz];
+ my $fn = $tag . '.' . $ext;
+ system('mv', $video_fn, $fn)
print "creating dataset: $tag\n";
mkdir($tag);
- system('ffmpeg', '-i', $video_fn, "-filter:v", "scale=256x256", $tag . '/frame_%05d.png');
+ system('ffmpeg', '-i', $fn, "-filter:v", "scale=256x256", $tag . '/frame_%05d.png');
print "created dataset: $tag\n";
}