diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-06-22 17:23:37 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-06-22 17:23:37 +0200 |
| commit | 1d6c3cee5d6062c94852551037dc36c770bb69d8 (patch) | |
| tree | 059dd3529b4faf9dfc6d611def2cb200b2d6851b | |
| parent | ec1b8d950bb489f1e04c43aefe6fa5e51a7d89fa (diff) | |
dir to movie ignore single frames
| -rwxr-xr-x | dir-to-movie.pl | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/dir-to-movie.pl b/dir-to-movie.pl index 0698241..4efeb7e 100755 --- a/dir-to-movie.pl +++ b/dir-to-movie.pl @@ -9,10 +9,12 @@ STDOUT->autoflush(1); my $tag = "pix2pixhd_" . time; my $module = "pix2pixhd"; my $endpoint = undef; +my $prefix = "ren"; GetOptions ( "tag=s" => \$tag, "module=s" => \$module, - "endpoint=s" => \$endpoint + "endpoint=s" => \$endpoint, + "prefix=s" => \$prefix, ) or die("Error in command line arguments\n"); @@ -41,11 +43,19 @@ print $pwd . "\n"; mkdir('./tmp'); for my $line (@lines) { + if ($line !~ /$prefix/) { + next; + } chomp $line; system('ln', '-s', $pwd . $line, sprintf('./tmp/frame_%05d.png', $i)); $i += 1; } +if ($i == 0) { + print "No frames found.\n"; + exit(1); +} + my $ffmpeg = `ffmpeg -i ./tmp/frame_%05d.png -y -c:v libx264 -vf fps=25 -pix_fmt yuv420p -s 1024x512 ../../renders/$tag.mp4`; my @lines = split("\n", $ffmpeg); |
