summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdir-to-movie.pl17
1 files changed, 13 insertions, 4 deletions
diff --git a/dir-to-movie.pl b/dir-to-movie.pl
index 8f0afa3..8d386df 100755
--- a/dir-to-movie.pl
+++ b/dir-to-movie.pl
@@ -4,16 +4,25 @@ my $i = 0;
my $ls = `ls -1v *.png`;
my @lines = split('\n', $ls);
-system('mkdir', 'tmp');
+mkdir('./tmp');
+
+my $pwd = `pwd`;
+chomp $pwd;
+$pwd .= '/';
+print $pwd . "\n";
for my $line (@lines) {
chomp $line;
- system('ln', '-s', $line, sprintf('./tmp/frame_%05d.png', $i));
+ system('ln', '-s', $pwd . $line, sprintf('./tmp/frame_%05d.png', $i));
$i += 1;
}
-system("ffmpeg", "-i", "./tmp/frame_%05d.png", "-y", "-c:v", "libx264", "-vf", "fps=25", "-pix_fmt", "yuv420p", "-s", "456x256", $tag . ".mp4");
+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");
END {
- system('rm', '-rf', 'tmp');
+# system('rm', '-rf', 'tmp');
}