Skip to content

Commit 471ca59

Browse files
author
Yoichi Kawasaki
committed
Added an option to download output asset files
1 parent 56ae4e9 commit 471ca59

File tree

5 files changed

+29
-10
lines changed

5 files changed

+29
-10
lines changed

ChangeLog

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
Release 0.1.2 - 2016/08/11
2+
3+
* Added an option to download output asset files
4+
15
Release 0.1.1 - 2016/07/21
26

3-
* added processor: Azure Media OCR
4-
* added processor: Media Encoder Standard
7+
* Added processor: Azure Media OCR
8+
* Added processor: Media Encoder Standard
59

610
Release 0.1.0 - 2016/06/22
711

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@ Here is how to execute the application using mvn command:
3131
Here are args for the application that you specify in running the app:
3232

3333
usage: App -c <app.config> [-f <uploadfile>] -a <assetname> -p
34-
<amitaskparam.config> -o <outputdir>
34+
<amitaskparam.config> -o <outputdir> [-d <true/false>]
3535
-a,--assetname <arg> (Required) Asset Name to process media indexing
3636
-c,--config <arg> (Required) App config file. ex) app.config
37+
-d,--download <arg> (Optional) true/false (true by default) Set false
38+
if you don't want to download output files
3739
-f,--file <arg> (Optional) Uploading file. By specifing this, you
3840
start from uploading file
3941
-o,--output <arg> (Required) Output directory
40-
-p,--params <arg> (Optional) Azure Media Processor Configuration
42+
-p,--params <arg> (Required) Azure Media Processor Configuration
4143
XML/Json file. ex) default-indexer.config
4244
-t,--type <arg> (Required) Media Processor type (Integer):
4345
1 -> Media Encoder Standard

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.0
1+
0.1.2

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>azuremediaprocessor</groupId>
55
<artifactId>azure-media-processor-java</artifactId>
66
<packaging>jar</packaging>
7-
<version>0.1.0</version>
7+
<version>0.1.2</version>
88
<name>azure-media-processor-java</name>
99
<url>http://maven.apache.org</url>
1010

src/main/java/azuremediaprocessor/App.java

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public void start( String[] args )
2929
String assetname = null;
3030
String paramfile = null;
3131
String outputdir = null;
32+
Boolean downloadfiles = true;
3233

3334
Options opts = new Options();
3435
opts.addOption("c", "config", true, "(Required) App config file. ex) app.config");
@@ -45,8 +46,9 @@ public void start( String[] args )
4546
);
4647
opts.addOption("f", "file", true, "(Optional) Uploading file. By specifing this, you start from uploading file");
4748
opts.addOption("a", "assetname", true, "(Required) Asset Name to process media indexing");
48-
opts.addOption("p", "params", true, "(Optional) Azure Media Processor Configuration XML/Json file. ex) default-indexer.config");
49+
opts.addOption("p", "params", true, "(Required) Azure Media Processor Configuration XML/Json file. ex) default-indexer.config");
4950
opts.addOption("o", "output", true, "(Required) Output directory");
51+
opts.addOption("d", "download", true, "(Optional) true/false (true by default) Set false if you don't want to download output files");
5052
BasicParser parser = new BasicParser();
5153
CommandLine cl;
5254
HelpFormatter help = new HelpFormatter();
@@ -56,7 +58,7 @@ public void start( String[] args )
5658
cl = parser.parse(opts, args);
5759
// handle server option.
5860
if ( !cl.hasOption("-c") || !cl.hasOption("-a")
59-
|| !cl.hasOption("-t") || !cl.hasOption("-o")) {
61+
|| !cl.hasOption("-t") || !cl.hasOption("-o") || !cl.hasOption("-p")) {
6062
throw new ParseException("");
6163
}
6264
// handle interface option.
@@ -66,11 +68,20 @@ public void start( String[] args )
6668
assetname = cl.getOptionValue("a");
6769
paramfile = cl.getOptionValue("p");
6870
outputdir = cl.getOptionValue("o");
71+
String dlopt = cl.getOptionValue("d");
6972
if (conffile == null || assetname == null
7073
|| mptype == null || paramfile == null || outputdir == null
7174
|| !Constants.MediaProcessorType_MAP.containsKey(mptype) ) {
7275
throw new ParseException("");
7376
}
77+
// validate download files option
78+
if (dlopt != null ) {
79+
String dloptlc = dlopt.toLowerCase();
80+
if ( !"true".equals(dloptlc) && !"false".equals(dloptlc) ) {
81+
throw new ParseException("");
82+
}
83+
downloadfiles = Boolean.valueOf(dloptlc);
84+
}
7485

7586
// handlet destination option.
7687
System.out.println("Starting application...");
@@ -84,9 +95,10 @@ public void start( String[] args )
8495
System.out.println("Asset name : " + assetname);
8596
System.out.println("Task param file : " + paramfile);
8697
System.out.println("Output dir : " + outputdir);
98+
System.out.println("Download output files : " + Boolean.toString(downloadfiles));
8799

88100
} catch (IOException | ParseException e) {
89-
help.printHelp("App -c <app.config> [-f <uploadfile>] -a <assetname> -p <amitaskparam.config> -o <outputdir>", opts);
101+
help.printHelp("App -c <app.config> [-f <uploadfile>] -a <assetname> -p <taskparam.config> -o <outputdir> [-d <true/false>]", opts);
90102
System.exit(1);
91103
}
92104

@@ -119,7 +131,8 @@ public void start( String[] args )
119131
Constants.MediaProcessorType_MAP.get(mptype),
120132
assetname,
121133
paramfile,
122-
outputdir);
134+
outputdir,
135+
downloadfiles);
123136
} catch ( Exception e ){
124137
System.err.println("Video indexing failure:" + e);
125138
System.exit(1);

0 commit comments

Comments
 (0)