static int do_psnr = 0;
static int input_sync;
static int override_ffserver = 0;
+static int input_stream_potentially_available = 0;
static void uninit_options(OptionsContext *o)
{
timestamp = (o->start_time == AV_NOPTS_VALUE) ? 0 : o->start_time;
/* add the stream start time */
- if (ic->start_time != AV_NOPTS_VALUE)
+ if (!o->seek_timestamp && ic->start_time != AV_NOPTS_VALUE)
timestamp += ic->start_time;
/* if seeking requested, we execute it */
av_dict_free(&opts[i]);
av_freep(&opts);
+ input_stream_potentially_available = 1;
+
return 0;
}
ost->stream_copy = 0;
ost->attachment_filename = o->attachments[i];
ost->finished = 1;
- ost->enc_ctx->extradata = attachment;
- ost->enc_ctx->extradata_size = len;
+ ost->st->codec->extradata = attachment;
+ ost->st->codec->extradata_size = len;
p = strrchr(o->attachments[i], '/');
av_dict_set(&ost->st->metadata, "filename", (p && *p) ? p + 1 : o->attachments[i], AV_DICT_DONT_OVERWRITE);
}
}
+ if (!(oc->oformat->flags & AVFMT_NOSTREAMS) && !input_stream_potentially_available) {
+ av_log(NULL, AV_LOG_ERROR,
+ "No input streams but output needs an input stream\n");
+ exit_program(1);
+ }
+
if (!(oc->oformat->flags & AVFMT_NOFILE)) {
/* test if it already exists to avoid losing precious files */
assert_file_overwrite(filename);
filtergraphs[nb_filtergraphs - 1]->graph_desc = av_strdup(arg);
if (!filtergraphs[nb_filtergraphs - 1]->graph_desc)
return AVERROR(ENOMEM);
+
+ input_stream_potentially_available = 1;
+
return 0;
}
return AVERROR(ENOMEM);
filtergraphs[nb_filtergraphs - 1]->index = nb_filtergraphs - 1;
filtergraphs[nb_filtergraphs - 1]->graph_desc = graph_desc;
+
+ input_stream_potentially_available = 1;
+
return 0;
}
{ "ss", HAS_ARG | OPT_TIME | OPT_OFFSET |
OPT_INPUT | OPT_OUTPUT, { .off = OFFSET(start_time) },
"set the start time offset", "time_off" },
+ { "seek_timestamp", HAS_ARG | OPT_INT | OPT_OFFSET |
+ OPT_INPUT, { .off = OFFSET(seek_timestamp) },
+ "enable/disable seeking by timestamp with -ss" },
{ "accurate_seek", OPT_BOOL | OPT_OFFSET | OPT_EXPERT |
OPT_INPUT, { .off = OFFSET(accurate_seek) },
"enable/disable accurate seeking with -ss" },
OPT_INPUT | OPT_OUTPUT, { .off = OFFSET(top_field_first) },
"top=1/bottom=0/auto=-1 field first", "" },
{ "vtag", OPT_VIDEO | HAS_ARG | OPT_EXPERT | OPT_PERFILE |
- OPT_OUTPUT, { .func_arg = opt_old2new },
+ OPT_INPUT | OPT_OUTPUT, { .func_arg = opt_old2new },
"force video tag/fourcc", "fourcc/tag" },
{ "qphist", OPT_VIDEO | OPT_BOOL | OPT_EXPERT , { &qp_hist },
"show QP histogram" },