diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-06-17 09:29:21 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-06-17 09:29:21 +0200 |
| commit | 953ce7fcc6cb5247ae92858c82239a52760f2b4f (patch) | |
| tree | 3640e2004eb11c70ce1e07e4d579c0636ae378b3 | |
| parent | cbee22bf6cfca8ecc45ceef62944b81e2c3e3903 (diff) | |
dir to movie
| -rw-r--r-- | dir-to-movie.pl | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/dir-to-movie.pl b/dir-to-movie.pl new file mode 100644 index 0000000..1d7f34b --- /dev/null +++ b/dir-to-movie.pl @@ -0,0 +1,19 @@ +#!/usr/bin/perl + +my $i = 0; +my $ls = `ls -1v *.png`; +my @lines = split('\n', $lines); + +system('mkdir', 'tmp'); + +for my $line (@lines) { + chomp $line; + system('ln', '-s', $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"); + +END { + system('rm', '-rf', 'tmp'); +} |
