Commit 5329189a authored by John Koleszar's avatar John Koleszar
Browse files

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
parent 933d44b8
......@@ -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,
......@@ -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",
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;
......@@ -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)
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++)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment