diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-09-13 20:08:28 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-09-13 20:08:28 +0200 |
| commit | cf9887238e074c32ba028415979d8ab743194790 (patch) | |
| tree | a96628d321fe2a5535c4a8f8926ea97171d46b8a | |
| parent | 195d5a323e37d3dc873ee7baa10dd98343dba904 (diff) | |
print curl output
| -rwxr-xr-x | dir-to-movie.pl | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/dir-to-movie.pl b/dir-to-movie.pl index 240880a..c0cfb45 100755 --- a/dir-to-movie.pl +++ b/dir-to-movie.pl @@ -58,14 +58,14 @@ if ($i == 0) { } my $parent_dir = "../.."; - +my $dataset = $tag; if ($tag =~ /\//) { $parent_dir .= "/.."; $tag =~ s/\//_/g; +} else { + $dataset = $tag; } -mkdir("$parent_dir/renders"); - my $ffmpeg = `ffmpeg -i ./tmp/frame_%05d.png -y -c:v libx264 -vf fps=25 -pix_fmt yuv420p -s 1024x512 $parent_dir/renders/$tag.mp4`; my @lines = split("\n", $ffmpeg); @@ -75,16 +75,22 @@ for my $line (@lines) { if (defined $endpoint) { print("upload to $endpoint\n"); print("$module $tag $parent_dir/renders/$tag.mp4\n"); - system("curl", - "-X", "POST", - "-F", "module=$module", - "-F", "activity=live", - "-F", "generated=true", - "-F", "dataset=$tag", - "-F", "datatype=video", - "-F", "file=@$parent_dir/renders/$tag.mp4", - $endpoint - ); + my $curl = `curl -X POST -F module=$module -F activity=live -F generated=true -F dataset=$tag -F datatype=video -F file=@$parent_dir/renders/$tag.mp4 $endpoint` + my @lines = split("\n", $curl); + for my $line (@lines) { + print $line; + } + + # system("curl", + # "-X", "POST", + # "-F", "module=$module", + # "-F", "activity=live", + # "-F", "generated=true", + # "-F", "dataset=$tag", + # "-F", "datatype=video", + # "-F", "file=@$parent_dir/renders/$tag.mp4", + # $endpoint + # ); } print "rendered: $tag.mp4\n"; |
