You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

610 lines
20KB

  1. /*
  2. * Copyright (c) 2010 Stefano Sabatini
  3. * Copyright (c) 2008 Victor Paesa
  4. *
  5. * This file is part of FFmpeg.
  6. *
  7. * FFmpeg is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * FFmpeg is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with FFmpeg; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. /**
  22. * @file
  23. * movie video source
  24. *
  25. * @todo use direct rendering (no allocation of a new frame)
  26. * @todo support a PTS correction mechanism
  27. */
  28. #include <float.h>
  29. #include <stdint.h>
  30. #include "libavutil/attributes.h"
  31. #include "libavutil/avstring.h"
  32. #include "libavutil/avassert.h"
  33. #include "libavutil/opt.h"
  34. #include "libavutil/imgutils.h"
  35. #include "libavutil/timestamp.h"
  36. #include "libavformat/avformat.h"
  37. #include "audio.h"
  38. #include "avcodec.h"
  39. #include "avfilter.h"
  40. #include "formats.h"
  41. #include "internal.h"
  42. #include "video.h"
  43. typedef struct MovieStream {
  44. AVStream *st;
  45. int done;
  46. } MovieStream;
  47. typedef struct MovieContext {
  48. /* common A/V fields */
  49. const AVClass *class;
  50. int64_t seek_point; ///< seekpoint in microseconds
  51. double seek_point_d;
  52. char *format_name;
  53. char *file_name;
  54. char *stream_specs; /**< user-provided list of streams, separated by + */
  55. int stream_index; /**< for compatibility */
  56. int loop_count;
  57. AVFormatContext *format_ctx;
  58. int eof;
  59. AVPacket pkt, pkt0;
  60. int max_stream_index; /**< max stream # actually used for output */
  61. MovieStream *st; /**< array of all streams, one per output */
  62. int *out_index; /**< stream number -> output number map, or -1 */
  63. } MovieContext;
  64. #define OFFSET(x) offsetof(MovieContext, x)
  65. #define FLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_VIDEO_PARAM
  66. static const AVOption movie_options[]= {
  67. { "filename", NULL, OFFSET(file_name), AV_OPT_TYPE_STRING, .flags = FLAGS },
  68. { "format_name", "set format name", OFFSET(format_name), AV_OPT_TYPE_STRING, .flags = FLAGS },
  69. { "f", "set format name", OFFSET(format_name), AV_OPT_TYPE_STRING, .flags = FLAGS },
  70. { "stream_index", "set stream index", OFFSET(stream_index), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS },
  71. { "si", "set stream index", OFFSET(stream_index), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS },
  72. { "seek_point", "set seekpoint (seconds)", OFFSET(seek_point_d), AV_OPT_TYPE_DOUBLE, { .dbl = 0 }, 0, (INT64_MAX-1) / 1000000, FLAGS },
  73. { "sp", "set seekpoint (seconds)", OFFSET(seek_point_d), AV_OPT_TYPE_DOUBLE, { .dbl = 0 }, 0, (INT64_MAX-1) / 1000000, FLAGS },
  74. { "streams", "set streams", OFFSET(stream_specs), AV_OPT_TYPE_STRING, {.str = 0}, CHAR_MAX, CHAR_MAX, FLAGS },
  75. { "s", "set streams", OFFSET(stream_specs), AV_OPT_TYPE_STRING, {.str = 0}, CHAR_MAX, CHAR_MAX, FLAGS },
  76. { "loop", "set loop count", OFFSET(loop_count), AV_OPT_TYPE_INT, {.i64 = 1}, 0, INT_MAX, FLAGS },
  77. { NULL },
  78. };
  79. static int movie_config_output_props(AVFilterLink *outlink);
  80. static int movie_request_frame(AVFilterLink *outlink);
  81. static AVStream *find_stream(void *log, AVFormatContext *avf, const char *spec)
  82. {
  83. int i, ret, already = 0, stream_id = -1;
  84. char type_char[2], dummy;
  85. AVStream *found = NULL;
  86. enum AVMediaType type;
  87. ret = sscanf(spec, "d%1[av]%d%c", type_char, &stream_id, &dummy);
  88. if (ret >= 1 && ret <= 2) {
  89. type = type_char[0] == 'v' ? AVMEDIA_TYPE_VIDEO : AVMEDIA_TYPE_AUDIO;
  90. ret = av_find_best_stream(avf, type, stream_id, -1, NULL, 0);
  91. if (ret < 0) {
  92. av_log(log, AV_LOG_ERROR, "No %s stream with index '%d' found\n",
  93. av_get_media_type_string(type), stream_id);
  94. return NULL;
  95. }
  96. return avf->streams[ret];
  97. }
  98. for (i = 0; i < avf->nb_streams; i++) {
  99. ret = avformat_match_stream_specifier(avf, avf->streams[i], spec);
  100. if (ret < 0) {
  101. av_log(log, AV_LOG_ERROR,
  102. "Invalid stream specifier \"%s\"\n", spec);
  103. return NULL;
  104. }
  105. if (!ret)
  106. continue;
  107. if (avf->streams[i]->discard != AVDISCARD_ALL) {
  108. already++;
  109. continue;
  110. }
  111. if (found) {
  112. av_log(log, AV_LOG_WARNING,
  113. "Ambiguous stream specifier \"%s\", using #%d\n", spec, i);
  114. break;
  115. }
  116. found = avf->streams[i];
  117. }
  118. if (!found) {
  119. av_log(log, AV_LOG_WARNING, "Stream specifier \"%s\" %s\n", spec,
  120. already ? "matched only already used streams" :
  121. "did not match any stream");
  122. return NULL;
  123. }
  124. if (found->codec->codec_type != AVMEDIA_TYPE_VIDEO &&
  125. found->codec->codec_type != AVMEDIA_TYPE_AUDIO) {
  126. av_log(log, AV_LOG_ERROR, "Stream specifier \"%s\" matched a %s stream,"
  127. "currently unsupported by libavfilter\n", spec,
  128. av_get_media_type_string(found->codec->codec_type));
  129. return NULL;
  130. }
  131. return found;
  132. }
  133. static int open_stream(void *log, MovieStream *st)
  134. {
  135. AVCodec *codec;
  136. int ret;
  137. codec = avcodec_find_decoder(st->st->codec->codec_id);
  138. if (!codec) {
  139. av_log(log, AV_LOG_ERROR, "Failed to find any codec\n");
  140. return AVERROR(EINVAL);
  141. }
  142. st->st->codec->refcounted_frames = 1;
  143. if ((ret = avcodec_open2(st->st->codec, codec, NULL)) < 0) {
  144. av_log(log, AV_LOG_ERROR, "Failed to open codec\n");
  145. return ret;
  146. }
  147. return 0;
  148. }
  149. static int guess_channel_layout(MovieStream *st, int st_index, void *log_ctx)
  150. {
  151. AVCodecContext *dec_ctx = st->st->codec;
  152. char buf[256];
  153. int64_t chl = av_get_default_channel_layout(dec_ctx->channels);
  154. if (!chl) {
  155. av_log(log_ctx, AV_LOG_ERROR,
  156. "Channel layout is not set in stream %d, and could not "
  157. "be guessed from the number of channels (%d)\n",
  158. st_index, dec_ctx->channels);
  159. return AVERROR(EINVAL);
  160. }
  161. av_get_channel_layout_string(buf, sizeof(buf), dec_ctx->channels, chl);
  162. av_log(log_ctx, AV_LOG_WARNING,
  163. "Channel layout is not set in output stream %d, "
  164. "guessed channel layout is '%s'\n",
  165. st_index, buf);
  166. dec_ctx->channel_layout = chl;
  167. return 0;
  168. }
  169. static av_cold int movie_common_init(AVFilterContext *ctx)
  170. {
  171. MovieContext *movie = ctx->priv;
  172. AVInputFormat *iformat = NULL;
  173. int64_t timestamp;
  174. int nb_streams = 1, ret, i;
  175. char default_streams[16], *stream_specs, *spec, *cursor;
  176. char name[16];
  177. AVStream *st;
  178. if (!movie->file_name) {
  179. av_log(ctx, AV_LOG_ERROR, "No filename provided!\n");
  180. return AVERROR(EINVAL);
  181. }
  182. movie->seek_point = movie->seek_point_d * 1000000 + 0.5;
  183. stream_specs = movie->stream_specs;
  184. if (!stream_specs) {
  185. snprintf(default_streams, sizeof(default_streams), "d%c%d",
  186. !strcmp(ctx->filter->name, "amovie") ? 'a' : 'v',
  187. movie->stream_index);
  188. stream_specs = default_streams;
  189. }
  190. for (cursor = stream_specs; *cursor; cursor++)
  191. if (*cursor == '+')
  192. nb_streams++;
  193. if (movie->loop_count != 1 && nb_streams != 1) {
  194. av_log(ctx, AV_LOG_ERROR,
  195. "Loop with several streams is currently unsupported\n");
  196. return AVERROR_PATCHWELCOME;
  197. }
  198. av_register_all();
  199. // Try to find the movie format (container)
  200. iformat = movie->format_name ? av_find_input_format(movie->format_name) : NULL;
  201. movie->format_ctx = NULL;
  202. if ((ret = avformat_open_input(&movie->format_ctx, movie->file_name, iformat, NULL)) < 0) {
  203. av_log(ctx, AV_LOG_ERROR,
  204. "Failed to avformat_open_input '%s'\n", movie->file_name);
  205. return ret;
  206. }
  207. if ((ret = avformat_find_stream_info(movie->format_ctx, NULL)) < 0)
  208. av_log(ctx, AV_LOG_WARNING, "Failed to find stream info\n");
  209. // if seeking requested, we execute it
  210. if (movie->seek_point > 0) {
  211. timestamp = movie->seek_point;
  212. // add the stream start time, should it exist
  213. if (movie->format_ctx->start_time != AV_NOPTS_VALUE) {
  214. if (timestamp > INT64_MAX - movie->format_ctx->start_time) {
  215. av_log(ctx, AV_LOG_ERROR,
  216. "%s: seek value overflow with start_time:%"PRId64" seek_point:%"PRId64"\n",
  217. movie->file_name, movie->format_ctx->start_time, movie->seek_point);
  218. return AVERROR(EINVAL);
  219. }
  220. timestamp += movie->format_ctx->start_time;
  221. }
  222. if ((ret = av_seek_frame(movie->format_ctx, -1, timestamp, AVSEEK_FLAG_BACKWARD)) < 0) {
  223. av_log(ctx, AV_LOG_ERROR, "%s: could not seek to position %"PRId64"\n",
  224. movie->file_name, timestamp);
  225. return ret;
  226. }
  227. }
  228. for (i = 0; i < movie->format_ctx->nb_streams; i++)
  229. movie->format_ctx->streams[i]->discard = AVDISCARD_ALL;
  230. movie->st = av_calloc(nb_streams, sizeof(*movie->st));
  231. if (!movie->st)
  232. return AVERROR(ENOMEM);
  233. for (i = 0; i < nb_streams; i++) {
  234. spec = av_strtok(stream_specs, "+", &cursor);
  235. if (!spec)
  236. return AVERROR_BUG;
  237. stream_specs = NULL; /* for next strtok */
  238. st = find_stream(ctx, movie->format_ctx, spec);
  239. if (!st)
  240. return AVERROR(EINVAL);
  241. st->discard = AVDISCARD_DEFAULT;
  242. movie->st[i].st = st;
  243. movie->max_stream_index = FFMAX(movie->max_stream_index, st->index);
  244. }
  245. if (av_strtok(NULL, "+", &cursor))
  246. return AVERROR_BUG;
  247. movie->out_index = av_calloc(movie->max_stream_index + 1,
  248. sizeof(*movie->out_index));
  249. if (!movie->out_index)
  250. return AVERROR(ENOMEM);
  251. for (i = 0; i <= movie->max_stream_index; i++)
  252. movie->out_index[i] = -1;
  253. for (i = 0; i < nb_streams; i++) {
  254. AVFilterPad pad = { 0 };
  255. movie->out_index[movie->st[i].st->index] = i;
  256. snprintf(name, sizeof(name), "out%d", i);
  257. pad.type = movie->st[i].st->codec->codec_type;
  258. pad.name = av_strdup(name);
  259. pad.config_props = movie_config_output_props;
  260. pad.request_frame = movie_request_frame;
  261. ff_insert_outpad(ctx, i, &pad);
  262. ret = open_stream(ctx, &movie->st[i]);
  263. if (ret < 0)
  264. return ret;
  265. if ( movie->st[i].st->codec->codec->type == AVMEDIA_TYPE_AUDIO &&
  266. !movie->st[i].st->codec->channel_layout) {
  267. ret = guess_channel_layout(&movie->st[i], i, ctx);
  268. if (ret < 0)
  269. return ret;
  270. }
  271. }
  272. av_log(ctx, AV_LOG_VERBOSE, "seek_point:%"PRIi64" format_name:%s file_name:%s stream_index:%d\n",
  273. movie->seek_point, movie->format_name, movie->file_name,
  274. movie->stream_index);
  275. return 0;
  276. }
  277. static av_cold void movie_uninit(AVFilterContext *ctx)
  278. {
  279. MovieContext *movie = ctx->priv;
  280. int i;
  281. for (i = 0; i < ctx->nb_outputs; i++) {
  282. av_freep(&ctx->output_pads[i].name);
  283. if (movie->st[i].st)
  284. avcodec_close(movie->st[i].st->codec);
  285. }
  286. av_freep(&movie->st);
  287. av_freep(&movie->out_index);
  288. if (movie->format_ctx)
  289. avformat_close_input(&movie->format_ctx);
  290. }
  291. static int movie_query_formats(AVFilterContext *ctx)
  292. {
  293. MovieContext *movie = ctx->priv;
  294. int list[] = { 0, -1 };
  295. int64_t list64[] = { 0, -1 };
  296. int i;
  297. for (i = 0; i < ctx->nb_outputs; i++) {
  298. MovieStream *st = &movie->st[i];
  299. AVCodecContext *c = st->st->codec;
  300. AVFilterLink *outlink = ctx->outputs[i];
  301. switch (c->codec_type) {
  302. case AVMEDIA_TYPE_VIDEO:
  303. list[0] = c->pix_fmt;
  304. ff_formats_ref(ff_make_format_list(list), &outlink->in_formats);
  305. break;
  306. case AVMEDIA_TYPE_AUDIO:
  307. list[0] = c->sample_fmt;
  308. ff_formats_ref(ff_make_format_list(list), &outlink->in_formats);
  309. list[0] = c->sample_rate;
  310. ff_formats_ref(ff_make_format_list(list), &outlink->in_samplerates);
  311. list64[0] = c->channel_layout;
  312. ff_channel_layouts_ref(avfilter_make_format64_list(list64),
  313. &outlink->in_channel_layouts);
  314. break;
  315. }
  316. }
  317. return 0;
  318. }
  319. static int movie_config_output_props(AVFilterLink *outlink)
  320. {
  321. AVFilterContext *ctx = outlink->src;
  322. MovieContext *movie = ctx->priv;
  323. unsigned out_id = FF_OUTLINK_IDX(outlink);
  324. MovieStream *st = &movie->st[out_id];
  325. AVCodecContext *c = st->st->codec;
  326. outlink->time_base = st->st->time_base;
  327. switch (c->codec_type) {
  328. case AVMEDIA_TYPE_VIDEO:
  329. outlink->w = c->width;
  330. outlink->h = c->height;
  331. outlink->frame_rate = st->st->r_frame_rate;
  332. break;
  333. case AVMEDIA_TYPE_AUDIO:
  334. break;
  335. }
  336. return 0;
  337. }
  338. static char *describe_frame_to_str(char *dst, size_t dst_size,
  339. AVFrame *frame, enum AVMediaType frame_type,
  340. AVFilterLink *link)
  341. {
  342. switch (frame_type) {
  343. case AVMEDIA_TYPE_VIDEO:
  344. snprintf(dst, dst_size,
  345. "video pts:%s time:%s size:%dx%d aspect:%d/%d",
  346. av_ts2str(frame->pts), av_ts2timestr(frame->pts, &link->time_base),
  347. frame->width, frame->height,
  348. frame->sample_aspect_ratio.num,
  349. frame->sample_aspect_ratio.den);
  350. break;
  351. case AVMEDIA_TYPE_AUDIO:
  352. snprintf(dst, dst_size,
  353. "audio pts:%s time:%s samples:%d",
  354. av_ts2str(frame->pts), av_ts2timestr(frame->pts, &link->time_base),
  355. frame->nb_samples);
  356. break;
  357. default:
  358. snprintf(dst, dst_size, "%s BUG", av_get_media_type_string(frame_type));
  359. break;
  360. }
  361. return dst;
  362. }
  363. static int rewind_file(AVFilterContext *ctx)
  364. {
  365. MovieContext *movie = ctx->priv;
  366. int64_t timestamp = movie->seek_point;
  367. int ret, i;
  368. if (movie->format_ctx->start_time != AV_NOPTS_VALUE)
  369. timestamp += movie->format_ctx->start_time;
  370. ret = av_seek_frame(movie->format_ctx, -1, timestamp, AVSEEK_FLAG_BACKWARD);
  371. if (ret < 0) {
  372. av_log(ctx, AV_LOG_ERROR, "Unable to loop: %s\n", av_err2str(ret));
  373. movie->loop_count = 1; /* do not try again */
  374. return ret;
  375. }
  376. for (i = 0; i < ctx->nb_outputs; i++) {
  377. avcodec_flush_buffers(movie->st[i].st->codec);
  378. movie->st[i].done = 0;
  379. }
  380. movie->eof = 0;
  381. return 0;
  382. }
  383. /**
  384. * Try to push a frame to the requested output.
  385. *
  386. * @param ctx filter context
  387. * @param out_id number of output where a frame is wanted;
  388. * if the frame is read from file, used to set the return value;
  389. * if the codec is being flushed, flush the corresponding stream
  390. * @return 1 if a frame was pushed on the requested output,
  391. * 0 if another attempt is possible,
  392. * <0 AVERROR code
  393. */
  394. static int movie_push_frame(AVFilterContext *ctx, unsigned out_id)
  395. {
  396. MovieContext *movie = ctx->priv;
  397. AVPacket *pkt = &movie->pkt;
  398. enum AVMediaType frame_type;
  399. MovieStream *st;
  400. int ret, got_frame = 0, pkt_out_id;
  401. AVFilterLink *outlink;
  402. AVFrame *frame;
  403. if (!pkt->size) {
  404. if (movie->eof) {
  405. if (movie->st[out_id].done) {
  406. if (movie->loop_count != 1) {
  407. ret = rewind_file(ctx);
  408. if (ret < 0)
  409. return ret;
  410. movie->loop_count -= movie->loop_count > 1;
  411. av_log(ctx, AV_LOG_VERBOSE, "Stream finished, looping.\n");
  412. return 0; /* retry */
  413. }
  414. return AVERROR_EOF;
  415. }
  416. pkt->stream_index = movie->st[out_id].st->index;
  417. /* packet is already ready for flushing */
  418. } else {
  419. ret = av_read_frame(movie->format_ctx, &movie->pkt0);
  420. if (ret < 0) {
  421. av_init_packet(&movie->pkt0); /* ready for flushing */
  422. *pkt = movie->pkt0;
  423. if (ret == AVERROR_EOF) {
  424. movie->eof = 1;
  425. return 0; /* start flushing */
  426. }
  427. return ret;
  428. }
  429. *pkt = movie->pkt0;
  430. }
  431. }
  432. pkt_out_id = pkt->stream_index > movie->max_stream_index ? -1 :
  433. movie->out_index[pkt->stream_index];
  434. if (pkt_out_id < 0) {
  435. av_free_packet(&movie->pkt0);
  436. pkt->size = 0; /* ready for next run */
  437. pkt->data = NULL;
  438. return 0;
  439. }
  440. st = &movie->st[pkt_out_id];
  441. outlink = ctx->outputs[pkt_out_id];
  442. frame = av_frame_alloc();
  443. if (!frame)
  444. return AVERROR(ENOMEM);
  445. frame_type = st->st->codec->codec_type;
  446. switch (frame_type) {
  447. case AVMEDIA_TYPE_VIDEO:
  448. ret = avcodec_decode_video2(st->st->codec, frame, &got_frame, pkt);
  449. break;
  450. case AVMEDIA_TYPE_AUDIO:
  451. ret = avcodec_decode_audio4(st->st->codec, frame, &got_frame, pkt);
  452. break;
  453. default:
  454. ret = AVERROR(ENOSYS);
  455. break;
  456. }
  457. if (ret < 0) {
  458. av_log(ctx, AV_LOG_WARNING, "Decode error: %s\n", av_err2str(ret));
  459. av_frame_free(&frame);
  460. av_free_packet(&movie->pkt0);
  461. movie->pkt.size = 0;
  462. movie->pkt.data = NULL;
  463. return 0;
  464. }
  465. if (!ret || st->st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
  466. ret = pkt->size;
  467. pkt->data += ret;
  468. pkt->size -= ret;
  469. if (pkt->size <= 0) {
  470. av_free_packet(&movie->pkt0);
  471. pkt->size = 0; /* ready for next run */
  472. pkt->data = NULL;
  473. }
  474. if (!got_frame) {
  475. if (!ret)
  476. st->done = 1;
  477. av_frame_free(&frame);
  478. return 0;
  479. }
  480. frame->pts = av_frame_get_best_effort_timestamp(frame);
  481. av_dlog(ctx, "movie_push_frame(): file:'%s' %s\n", movie->file_name,
  482. describe_frame_to_str((char[1024]){0}, 1024, frame, frame_type, outlink));
  483. if (st->st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
  484. if (frame->format != outlink->format) {
  485. av_log(ctx, AV_LOG_ERROR, "Format changed %s -> %s, discarding frame\n",
  486. av_get_pix_fmt_name(outlink->format),
  487. av_get_pix_fmt_name(frame->format)
  488. );
  489. av_frame_free(&frame);
  490. return 0;
  491. }
  492. }
  493. ret = ff_filter_frame(outlink, frame);
  494. if (ret < 0)
  495. return ret;
  496. return pkt_out_id == out_id;
  497. }
  498. static int movie_request_frame(AVFilterLink *outlink)
  499. {
  500. AVFilterContext *ctx = outlink->src;
  501. unsigned out_id = FF_OUTLINK_IDX(outlink);
  502. int ret;
  503. while (1) {
  504. ret = movie_push_frame(ctx, out_id);
  505. if (ret)
  506. return FFMIN(ret, 0);
  507. }
  508. }
  509. #if CONFIG_MOVIE_FILTER
  510. AVFILTER_DEFINE_CLASS(movie);
  511. AVFilter ff_avsrc_movie = {
  512. .name = "movie",
  513. .description = NULL_IF_CONFIG_SMALL("Read from a movie source."),
  514. .priv_size = sizeof(MovieContext),
  515. .priv_class = &movie_class,
  516. .init = movie_common_init,
  517. .uninit = movie_uninit,
  518. .query_formats = movie_query_formats,
  519. .inputs = NULL,
  520. .outputs = NULL,
  521. .flags = AVFILTER_FLAG_DYNAMIC_OUTPUTS,
  522. };
  523. #endif /* CONFIG_MOVIE_FILTER */
  524. #if CONFIG_AMOVIE_FILTER
  525. #define amovie_options movie_options
  526. AVFILTER_DEFINE_CLASS(amovie);
  527. AVFilter ff_avsrc_amovie = {
  528. .name = "amovie",
  529. .description = NULL_IF_CONFIG_SMALL("Read audio from a movie source."),
  530. .priv_size = sizeof(MovieContext),
  531. .init = movie_common_init,
  532. .uninit = movie_uninit,
  533. .query_formats = movie_query_formats,
  534. .inputs = NULL,
  535. .outputs = NULL,
  536. .priv_class = &amovie_class,
  537. .flags = AVFILTER_FLAG_DYNAMIC_OUTPUTS,
  538. };
  539. #endif /* CONFIG_AMOVIE_FILTER */