X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=ffmpeg_opt.c;h=a1c02fc29b2494d478513ea2581fccd8fce28d8d;hb=2b202900618d82030384d46c8d9c3dbf3fe1d7ed;hp=ddda3f2a14087e7c36b841a1f354957c99e47247;hpb=d7d6f9c78272949b8b13a52eaa850f0d63842fcf;p=ffmpeg diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c index ddda3f2a140..a1c02fc29b2 100644 --- a/ffmpeg_opt.c +++ b/ffmpeg_opt.c @@ -119,6 +119,8 @@ int qp_hist = 0; int stdin_interaction = 1; int frame_bits_per_raw_sample = 0; float max_error_rate = 2.0/3; +int filter_nbthreads = 0; +int filter_complex_nbthreads = 0; static int intra_only = 0; @@ -1229,7 +1231,7 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e OutputStream *ost; AVStream *st = avformat_new_stream(oc, NULL); int idx = oc->nb_streams - 1, ret = 0; - const char *bsfs = NULL; + const char *bsfs = NULL, *time_base = NULL; char *next, *codec_tag = NULL; double qscale = -1; int i; @@ -1306,6 +1308,17 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e ost->encoder_opts = filter_codec_opts(o->g->codec_opts, AV_CODEC_ID_NONE, oc, st, NULL); } + MATCH_PER_STREAM_OPT(time_bases, str, time_base, oc, st); + if (time_base) { + AVRational q; + if (av_parse_ratio(&q, time_base, INT_MAX, 0, NULL) < 0 || + q.num <= 0 || q.den <= 0) { + av_log(NULL, AV_LOG_FATAL, "Invalid time base: %s\n", time_base); + exit_program(1); + } + st->time_base = q; + } + ost->max_frames = INT64_MAX; MATCH_PER_STREAM_OPT(max_frames, i64, ost->max_frames, oc, st); for (i = 0; inb_max_frames; i++) { @@ -2044,7 +2057,7 @@ static int open_output_file(OptionsContext *o, const char *filename) InputStream *ist; AVDictionary *unused_opts = NULL; AVDictionaryEntry *e = NULL; - + int format_flags = 0; if (o->stop_time != INT64_MAX && o->recording_time != INT64_MAX) { o->stop_time = INT64_MAX; @@ -2090,6 +2103,12 @@ static int open_output_file(OptionsContext *o, const char *filename) file_oformat= oc->oformat; oc->interrupt_callback = int_cb; + e = av_dict_get(o->g->format_opts, "fflags", NULL, 0); + if (e) { + const AVOption *o = av_opt_find(oc, "fflags", NULL, 0, 0); + av_opt_eval_flags(oc, o, e->value, &format_flags); + } + /* create streams for all unlabeled output pads */ for (i = 0; i < nb_filtergraphs; i++) { FilterGraph *fg = filtergraphs[i]; @@ -2110,6 +2129,7 @@ static int open_output_file(OptionsContext *o, const char *filename) /* ffserver seeking with date=... needs a date reference */ if (!strcmp(file_oformat->name, "ffm") && + !(format_flags & AVFMT_FLAG_BITEXACT) && av_strstart(filename, "http:", NULL)) { int err = parse_option(o, "metadata", "creation_time=now", options); if (err < 0) { @@ -3186,8 +3206,8 @@ enum OptGroup { }; static const OptionGroupDef groups[] = { - [GROUP_OUTFILE] = { "output file", NULL, OPT_OUTPUT }, - [GROUP_INFILE] = { "input file", "i", OPT_INPUT }, + [GROUP_OUTFILE] = { "output url", NULL, OPT_OUTPUT }, + [GROUP_INFILE] = { "input url", "i", OPT_INPUT }, }; static int open_files(OptionGroupList *l, const char *inout, @@ -3640,6 +3660,9 @@ const OptionDef options[] = { { "sdp_file", HAS_ARG | OPT_EXPERT | OPT_OUTPUT, { .func_arg = opt_sdp_file }, "specify a file in which to print sdp information", "file" }, + { "time_base", HAS_ARG | OPT_STRING | OPT_EXPERT | OPT_SPEC | OPT_OUTPUT, { .off = OFFSET(time_bases) }, + "set the desired time base hint for output stream (1:24, 1:48000 or 0.04166, 2.0833e-5)", "ratio" }, + { "bsf", HAS_ARG | OPT_STRING | OPT_SPEC | OPT_EXPERT | OPT_OUTPUT, { .off = OFFSET(bitstream_filters) }, "A comma-separated list of bitstream filters", "bitstream_filters" }, { "absf", HAS_ARG | OPT_AUDIO | OPT_EXPERT| OPT_PERFILE | OPT_OUTPUT, { .func_arg = opt_old2new }, @@ -3670,5 +3693,10 @@ const OptionDef options[] = { "set VAAPI hardware device (DRM path or X11 display name)", "device" }, #endif +#if CONFIG_QSV + { "qsv_device", HAS_ARG | OPT_STRING | OPT_EXPERT, { &qsv_device }, + "set QSV hardware device (DirectX adapter index, DRM path or X11 display name)", "device"}, +#endif + { NULL, }, };