diff options
| -rwxr-xr-x | dir-to-movie.pl | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/dir-to-movie.pl b/dir-to-movie.pl index a7b2321..653eae3 100755 --- a/dir-to-movie.pl +++ b/dir-to-movie.pl @@ -1,6 +1,21 @@ #!/usr/bin/perl -my $tag = $ARGV[0] or "pix2pixhd_" . time; +use Getopt::Long; +use IO::Handle; + +STDERR->autoflush(1); +STDOUT->autoflush(1); + +my $tag = "pix2pixhd_" . time; +my $module = "pix2pixhd"; +my $endpoint = undef; +GetOptions ( + "tag" => \$tag, + "module" => \$module, + "endpoint" => \$endpoint, +) +or die("Error in command line arguments\n"); + $tag =~ s/\....$//; if (! -e "results/$tag") { @@ -33,6 +48,19 @@ system("ffmpeg", "../../renders/" . $tag . ".mp4" ); +if (defined $endpoint) { + print("upload to $endpoint\n"); + system("curl", + "-X", "POST", + "-F", "module=$module", + "-F", "activity=train", + "-F", "generated=true", + "-F", "dataset=$dataset" + "-F", "file=@./renders/$tag.mp3", + $endpoint + +} + print "rendered: $tag.mp4"; END { |
