diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-06-18 14:48:06 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-06-18 14:48:06 +0200 |
| commit | f57fe3b40b933da9b103f61863ac0a1549d3d289 (patch) | |
| tree | 11e4c4d46ca040cccba1c95a57853b35c4a708c7 /dir-to-movie.pl | |
| parent | 464ac9e26fb874ff4d1fea54bcc45ad33dc53b5b (diff) | |
butchering live mogrify...
Diffstat (limited to 'dir-to-movie.pl')
| -rw-r--r-- | dir-to-movie.pl | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/dir-to-movie.pl b/dir-to-movie.pl new file mode 100644 index 0000000..ac51aef --- /dev/null +++ b/dir-to-movie.pl @@ -0,0 +1,27 @@ +#!/usr/bin/perl + +my $i = 0; +my $ls = `ls -1v *.png`; +my @lines = split('\n', $ls); +my $pwd = `pwd`; +chomp $pwd; +$pwd .= '/'; + +system('mkdir', 'tmp'); + +for my $line (@lines) { + chomp $line; + 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" +); + +END { + system('rm', '-rf', 'tmp'); +} |
