From 6c48c57b579556bf3f7dc253bee5c098184cc66f Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 20 Jun 2018 15:14:19 +0200 Subject: options --- dir-to-movie.pl | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) 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 { -- cgit v1.2.3-70-g09d2