From: Jerome Jiang Date: Fri, 8 Feb 2019 23:44:46 +0000 (-0800) Subject: vp9 svc example encoder accept -o (--output) for output. X-Git-Tag: v1.8.1~250 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2221ec88d54c307d5f7496d1ff5cf6fd029e0b1f;p=libvpx vp9 svc example encoder accept -o (--output) for output. Make it same as vpxenc so easier to run on borg. Change-Id: Ie19db6e828ced773cba9aef715c8fbd0f4715b27 --- diff --git a/examples/vp9_spatial_svc_encoder.c b/examples/vp9_spatial_svc_encoder.c index 0dc5a94d0..82fec49fc 100644 --- a/examples/vp9_spatial_svc_encoder.c +++ b/examples/vp9_spatial_svc_encoder.c @@ -34,6 +34,8 @@ #define OUTPUT_RC_STATS 1 +static const arg_def_t outputfile = + ARG_DEF("o", "output", 1, "Output filename"); static const arg_def_t skip_frames_arg = ARG_DEF("s", "skip-frames", 1, "input frames to skip"); static const arg_def_t frames_arg = @@ -112,6 +114,7 @@ static const arg_def_t bitdepth_arg = ARG_DEF_ENUM( #endif // CONFIG_VP9_HIGHBITDEPTH static const arg_def_t *svc_args[] = { &frames_arg, + &outputfile, &width_arg, &height_arg, &timebase_arg, @@ -177,7 +180,7 @@ typedef struct { static const char *exec_name; void usage_exit(void) { - fprintf(stderr, "Usage: %s input_filename output_filename\n", + fprintf(stderr, "Usage: %s input_filename -o output_filename\n", exec_name); fprintf(stderr, "Options:\n"); arg_show_usage(stderr, svc_args); @@ -236,6 +239,8 @@ static void parse_command_line(int argc, const char **argv_, if (arg_match(&arg, &frames_arg, argi)) { app_input->frames_to_code = arg_parse_uint(&arg); + } else if (arg_match(&arg, &outputfile, argi)) { + app_input->output_filename = arg.val; } else if (arg_match(&arg, &width_arg, argi)) { enc_cfg->g_w = arg_parse_uint(&arg); } else if (arg_match(&arg, &height_arg, argi)) { @@ -391,11 +396,10 @@ static void parse_command_line(int argc, const char **argv_, if (argi[0][0] == '-' && strlen(argi[0]) > 1) die("Error: Unrecognized option %s\n", *argi); - if (argv[0] == NULL || argv[1] == 0) { + if (argv[0] == NULL) { usage_exit(); } app_input->input_ctx.filename = argv[0]; - app_input->output_filename = argv[1]; free(argv); open_input_file(&app_input->input_ctx);