diff options
| author | jules@lens <julescarbon@gmail.com> | 2018-06-17 21:57:17 +0200 |
|---|---|---|
| committer | jules@lens <julescarbon@gmail.com> | 2018-06-17 21:57:17 +0200 |
| commit | c42f642806087b44d0b656e356e858e1d5b73238 (patch) | |
| tree | 4c38d2d7218470a81db402523272d7cda943242b | |
| parent | 5a9506c9cf077c13bd52d4d75f52ce843d287823 (diff) | |
dtomov
| -rwxr-xr-x | dir-to-movie.pl | 17 |
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'); } |
