From 953ce7fcc6cb5247ae92858c82239a52760f2b4f Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 17 Jun 2018 09:29:21 +0200 Subject: dir to movie --- dir-to-movie.pl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 dir-to-movie.pl 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'); +} -- cgit v1.2.3-70-g09d2