diff options
| author | jules@lens <julescarbon@gmail.com> | 2018-06-17 21:58:13 +0200 |
|---|---|---|
| committer | jules@lens <julescarbon@gmail.com> | 2018-06-17 21:58:13 +0200 |
| commit | 2b228ed309415418d54e284a8ac430e5161a6535 (patch) | |
| tree | fb699bdf92d4c35f3e97c851cf058ad740c59275 /dir-to-movie.pl | |
| parent | c42f642806087b44d0b656e356e858e1d5b73238 (diff) | |
| parent | 872dcf1d511b384b8cbc4076ee696b23055d70af (diff) | |
merge
Diffstat (limited to 'dir-to-movie.pl')
| -rwxr-xr-x | dir-to-movie.pl | 20 |
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'); } |
