diff options
| -rwxr-xr-x | get.pl | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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"; } |
