summaryrefslogtreecommitdiff
path: root/dir-to-movie.pl
blob: 8f0afa340937e28f6d96b54acad0b6b9700248e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/perl

my $i = 0;
my $ls  = `ls -1v *.png`;
my @lines = split('\n', $ls);

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');
}