summaryrefslogtreecommitdiff
path: root/dir-to-movie.pl
diff options
context:
space:
mode:
Diffstat (limited to 'dir-to-movie.pl')
-rwxr-xr-xdir-to-movie.pl20
1 files changed, 11 insertions, 9 deletions
diff --git a/dir-to-movie.pl b/dir-to-movie.pl
index 8d386df..8648be2 100755
--- a/dir-to-movie.pl
+++ b/dir-to-movie.pl
@@ -1,28 +1,30 @@
#!/usr/bin/perl
+my $tag = $ARGV[0] or "pix2pixhd_" . time;
+
my $i = 0;
my $ls = `ls -1v *.png`;
my @lines = split('\n', $ls);
-
-mkdir('./tmp');
-
my $pwd = `pwd`;
chomp $pwd;
$pwd .= '/';
print $pwd . "\n";
+mkdir('./tmp');
+
for my $line (@lines) {
chomp $line;
system('ln', '-s', $pwd . $line, sprintf('./tmp/frame_%05d.png', $i));
$i += 1;
}
-my $tag = $ARGV[0];
-if (!$tag) {
- $tag = 'movie';
-}
-system("ffmpeg", "-i", "./tmp/frame_%05d.png", "-y", "-c:v", "libx264", "-vf", "fps=25", "-pix_fmt", "yuv420p", "-s", "1024x512", $tag . ".mp4");
+system("ffmpeg",
+ "-i", "./tmp/frame_%05d.png",
+ "-y", "-c:v", "libx264", "-vf", "fps=25", "-pix_fmt", "yuv420p",
+ "-s", "1024x512",
+ $tag . ".mp4"
+);
END {
-# system('rm', '-rf', 'tmp');
+ system('rm', '-rf', 'tmp');
}