72 #define OFFSET(x) offsetof(MovieContext, x)
73 #define F AV_OPT_FLAG_FILTERING_PARAM
82 {
"seek_point",
"set seekpoint (seconds)",
OFFSET(seek_point_d),
AV_OPT_TYPE_DOUBLE, {.dbl = 0}, 0, (INT64_MAX-1) / 1000000,
F },
93 int i, ret, already = 0, stream_id = -1;
94 char type_char[2],
dummy;
98 ret = sscanf(spec,
"d%1[av]%d%c", type_char, &stream_id, &dummy);
99 if (ret >= 1 && ret <= 2) {
113 "Invalid stream specifier \"%s\"\n", spec);
124 "Ambiguous stream specifier \"%s\", using #%d\n", spec, i);
131 already ?
"matched only already used streams" :
132 "did not match any stream");
138 "currently unsupported by libavfilter\n", spec,
172 "Channel layout is not set in stream %d, and could not "
173 "be guessed from the number of channels (%d)\n",
180 "Channel layout is not set in output stream %d, "
181 "guessed channel layout is '%s'\n",
192 int nb_streams, ret, i;
193 char default_streams[16], *stream_specs, *spec, *cursor;
197 movie->
class =
class;
217 snprintf(default_streams,
sizeof(default_streams),
"d%c%d",
218 !strcmp(ctx->
filter->
name,
"amovie") ?
'a' :
'v',
220 stream_specs = default_streams;
222 for (cursor = stream_specs, nb_streams = 1; *cursor; cursor++)
226 if (movie->
loop_count != 1 && nb_streams != 1) {
228 "Loop with several streams is currently unsupported\n");
240 "Failed to avformat_open_input '%s'\n", movie->
file_name);
253 "%s: seek value overflow with start_time:%"PRId64
" seek_point:%"PRId64
"\n",
273 for (i = 0; i < nb_streams; i++) {
274 spec =
av_strtok(stream_specs,
"+", &cursor);
282 movie->
st[i].
st = st;
294 for (i = 0; i < nb_streams; i++)
297 for (i = 0; i < nb_streams; i++) {
299 snprintf(name,
sizeof(name),
"out%d", i);
321 av_log(ctx,
AV_LOG_VERBOSE,
"seek_point:%"PRIi64
" format_name:%s file_name:%s stream_index:%d\n",
350 int list[] = { 0, -1 };
351 int64_t list64[] = { 0, -1 };
429 "video pts:%s time:%s pos:%"PRId64
" size:%dx%d aspect:%d/%d",
437 "audio pts:%s time:%s pos:%"PRId64
" samples:%d",
448 #define describe_bufref(buf, link) \
449 describe_bufref_to_str((char[1024]){0}, 1024, buf, link)
490 int ret, got_frame = 0, pkt_out_id;
496 if (movie->
st[out_id].
done) {
526 if (pkt_out_id < 0) {
532 st = &movie->
st[pkt_out_id];
533 outlink = ctx->
outputs[pkt_out_id];
555 if (pkt->
size <= 0) {
581 return pkt_out_id == out_id;
593 return FFMIN(ret, 0);
597 #if CONFIG_MOVIE_FILTER
616 .priv_class = &movie_class,
621 #if CONFIG_AMOVIE_FILTER
623 #define amovie_options movie_options
641 .priv_class = &amovie_class,