summaryrefslogtreecommitdiff
path: root/vpxenc.c
diff options
context:
space:
mode:
authorJohn Koleszar <jkoleszar@google.com>2010-10-22 14:48:21 -0400
committerJohn Koleszar <jkoleszar@google.com>2010-10-25 22:32:23 -0400
commit5329189a331c6bfc8e8350f4706a5ff9add63147 (patch)
tree097a72851bd9778c669c0ba9242eb0f77cc7386e /vpxenc.c
parent933d44b8180f8552fafcbc6563c009dae1ba1626 (diff)
downloadlibvpx-5329189a331c6bfc8e8350f4706a5ff9add63147.tar.gz
vpxenc: specify output file with -o
Requiring the output file to be specified with the -o option opens up the possibility of supporting multiple input files in the future. Change-Id: I14c9b75e9b21184b47081e1ccf30cf4c91315964
Diffstat (limited to 'vpxenc.c')
-rw-r--r--vpxenc.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/vpxenc.c b/vpxenc.c
index f36af14a0..4eecdcdf9 100644
--- a/vpxenc.c
+++ b/vpxenc.c
@@ -740,6 +740,8 @@ write_webm_file_footer(EbmlGlobal *glob)
#include "args.h"
+static const arg_def_t outputfile = ARG_DEF("o", "output", 1,
+ "Output filename");
static const arg_def_t use_yv12 = ARG_DEF(NULL, "yv12", 0,
"Input file is YV12 ");
static const arg_def_t use_i420 = ARG_DEF(NULL, "i420", 0,
@@ -772,7 +774,8 @@ static const arg_def_t use_ivf = ARG_DEF(NULL, "ivf", 0,
"Output IVF (default is WebM)");
static const arg_def_t *main_args[] =
{
- &codecarg, &passes, &pass_arg, &fpf_name, &limit, &deadline, &best_dl, &good_dl, &rt_dl,
+ &outputfile, &codecarg, &passes, &pass_arg, &fpf_name, &limit, &deadline,
+ &best_dl, &good_dl, &rt_dl,
&verbosearg, &psnrarg, &use_ivf, &framerate,
NULL
};
@@ -907,7 +910,8 @@ static void usage_exit()
{
int i;
- fprintf(stderr, "Usage: %s <options> src_filename dst_filename\n", exec_name);
+ fprintf(stderr, "Usage: %s <options> -o dst_filename src_filename \n",
+ exec_name);
fprintf(stderr, "\nOptions:\n");
arg_show_usage(stdout, main_args);
@@ -1046,6 +1050,8 @@ int main(int argc, const char **argv_)
}
else if (arg_match(&arg, &use_ivf, argi))
write_webm = 0;
+ else if (arg_match(&arg, &outputfile, argi))
+ out_fn = arg.val;
else
argj++;
}
@@ -1210,11 +1216,13 @@ int main(int argc, const char **argv_)
/* Handle non-option arguments */
in_fn = argv[0];
- out_fn = argv[1];
- if (!in_fn || !out_fn)
+ if (!in_fn)
usage_exit();
+ if(!out_fn)
+ die("Error: Output file is required (specify with -o)\n");
+
memset(&stats, 0, sizeof(stats));
for (pass = one_pass_only ? one_pass_only - 1 : 0; pass < arg_passes; pass++)