35 #include "libavfilter/avfilter.h"
36 #include "libavfilter/buffersink.h"
37 #include "libavfilter/buffersrc.h"
39 #include "libavutil/avassert.h"
40 #include "libavutil/avstring.h"
41 #include "libavutil/bprint.h"
42 #include "libavutil/channel_layout.h"
43 #include "libavutil/display.h"
44 #include "libavutil/opt.h"
45 #include "libavutil/pixdesc.h"
46 #include "libavutil/pixfmt.h"
47 #include "libavutil/imgutils.h"
48 #include "libavutil/samplefmt.h"
52 static const enum AVPixelFormat mjpeg_formats[] =
53 { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P,
54 AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P,
56 static const enum AVPixelFormat ljpeg_formats[] =
57 { AV_PIX_FMT_BGR24 , AV_PIX_FMT_BGRA , AV_PIX_FMT_BGR0,
58 AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P,
59 AV_PIX_FMT_YUV420P , AV_PIX_FMT_YUV444P , AV_PIX_FMT_YUV422P,
62 if (codec_id == AV_CODEC_ID_MJPEG) {
64 }
else if (codec_id == AV_CODEC_ID_LJPEG) {
67 return default_formats;
71 enum AVPixelFormat
choose_pixel_fmt(AVStream *st, AVCodecContext *enc_ctx,
const AVCodec *codec,
enum AVPixelFormat target)
73 if (codec && codec->pix_fmts) {
74 const enum AVPixelFormat *p = codec->pix_fmts;
75 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(target);
77 int has_alpha = desc ? desc->nb_components % 2 == 0 : 0;
78 enum AVPixelFormat best= AV_PIX_FMT_NONE;
80 if (enc_ctx->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL) {
83 for (; *p != AV_PIX_FMT_NONE; p++) {
84 best= avcodec_find_best_pix_fmt_of_2(best, *p, target, has_alpha, NULL);
88 if (*p == AV_PIX_FMT_NONE) {
89 if (target != AV_PIX_FMT_NONE)
90 av_log(NULL, AV_LOG_WARNING,
91 "Incompatible pixel format '%s' for codec '%s', auto-selecting format '%s'\n",
92 av_get_pix_fmt_name(target),
94 av_get_pix_fmt_name(best));
103 if (codec && codec->sample_fmts) {
104 const enum AVSampleFormat *p = codec->sample_fmts;
105 for (; *p != -1; p++) {
106 if (*p == st->codecpar->format)
110 const AVCodecDescriptor *desc = avcodec_descriptor_get(codec->id);
111 if(desc && (desc->props & AV_CODEC_PROP_LOSSLESS) && av_get_sample_fmt_name(st->codecpar->format) > av_get_sample_fmt_name(codec->sample_fmts[0]))
112 av_log(NULL, AV_LOG_ERROR,
"Conversion will not be lossless.\n");
113 if(av_get_sample_fmt_name(st->codecpar->format))
114 av_log(NULL, AV_LOG_WARNING,
115 "Incompatible sample format '%s' for codec '%s', auto-selecting format '%s'\n",
116 av_get_sample_fmt_name(st->codecpar->format),
118 av_get_sample_fmt_name(codec->sample_fmts[0]));
119 st->codecpar->format = codec->sample_fmts[0];
127 AVDictionaryEntry *strict_dict = av_dict_get(ost->
encoder_opts,
"strict", NULL, 0);
130 av_opt_set(ost->
enc_ctx,
"strict", strict_dict->value, 0);
133 avfilter_graph_set_auto_convert(ofilter->
graph->
graph,
134 AVFILTER_AUTO_CONVERT_NONE);
135 if (ost->
enc_ctx->pix_fmt == AV_PIX_FMT_NONE)
137 return av_strdup(av_get_pix_fmt_name(ost->
enc_ctx->pix_fmt));
139 if (ost->
enc_ctx->pix_fmt != AV_PIX_FMT_NONE) {
141 }
else if (ost->
enc && ost->
enc->pix_fmts) {
142 const enum AVPixelFormat *p;
143 AVIOContext *s = NULL;
147 if (avio_open_dyn_buf(&s) < 0)
150 p = ost->
enc->pix_fmts;
151 if (ost->
enc_ctx->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL) {
155 for (; *p != AV_PIX_FMT_NONE; p++) {
156 const char *name = av_get_pix_fmt_name(*p);
157 avio_printf(s,
"%s|", name);
159 len = avio_close_dyn_buf(s, &ret);
168 #define DEF_CHOOSE_FORMAT(suffix, type, var, supported_list, none, get_name) \
169 static char *choose_ ## suffix (OutputFilter *ofilter) \
171 if (ofilter->var != none) { \
172 get_name(ofilter->var); \
173 return av_strdup(name); \
174 } else if (ofilter->supported_list) { \
176 AVIOContext *s = NULL; \
180 if (avio_open_dyn_buf(&s) < 0) \
183 for (p = ofilter->supported_list; *p != none; p++) { \
185 avio_printf(s, "%s|", name); \
187 len = avio_close_dyn_buf(s, &ret); \
224 if (!(fg->
inputs[0] = av_mallocz(
sizeof(*fg->
inputs[0]))))
235 ist->filters[ist->nb_filters - 1] = fg->
inputs[0];
245 AVFilterContext *ctx = inout->filter_ctx;
246 AVFilterPad *pads = in ? ctx->input_pads : ctx->output_pads;
247 int nb_pads = in ? ctx->nb_inputs : ctx->nb_outputs;
251 if (avio_open_dyn_buf(&pb) < 0)
254 avio_printf(pb,
"%s", ctx->filter->name);
256 avio_printf(pb,
":%s", avfilter_pad_get_name(pads, inout->pad_idx));
258 avio_close_dyn_buf(pb, &res);
265 enum AVMediaType type = avfilter_pad_get_type(in->filter_ctx->input_pads, in->pad_idx);
269 if (type != AVMEDIA_TYPE_VIDEO && type != AVMEDIA_TYPE_AUDIO) {
270 av_log(NULL, AV_LOG_FATAL,
"Only video and audio filters supported "
279 int file_idx = strtol(in->name, &p, 0);
282 av_log(NULL, AV_LOG_FATAL,
"Invalid file index %d in filtergraph description %s.\n",
288 for (i = 0; i < s->nb_streams; i++) {
289 enum AVMediaType stream_type = s->streams[i]->codecpar->codec_type;
290 if (stream_type != type &&
291 !(stream_type == AVMEDIA_TYPE_SUBTITLE &&
292 type == AVMEDIA_TYPE_VIDEO ))
300 av_log(NULL, AV_LOG_FATAL,
"Stream specifier '%s' in filtergraph description %s "
306 av_log(NULL, AV_LOG_FATAL,
"Stream specifier '%s' in filtergraph description %s "
307 "matches a disabled input stream.\n", p, fg->
graph_desc);
320 av_log(NULL, AV_LOG_FATAL,
"Cannot find a matching stream for "
321 "unlabeled input pad %d on filter %s\n", in->pad_idx,
322 in->filter_ctx->name);
330 ist->
st->discard = AVDISCARD_NONE;
351 AVFilterInOut *inputs, *outputs, *cur;
352 AVFilterGraph *graph;
357 graph = avfilter_graph_alloc();
359 return AVERROR(ENOMEM);
360 graph->nb_threads = 1;
362 ret = avfilter_graph_parse2(graph, fg->
graph_desc, &inputs, &outputs);
366 for (cur = inputs; cur; cur = cur->next)
369 for (cur = outputs; cur;) {
385 avfilter_inout_free(&inputs);
386 avfilter_graph_free(&graph);
391 AVFilterContext **last_filter,
int *pad_idx,
392 const char *filter_name)
394 AVFilterGraph *graph = (*last_filter)->graph;
395 AVFilterContext *ctx;
396 const AVFilter *trim;
397 enum AVMediaType type = avfilter_pad_get_type((*last_filter)->output_pads, *pad_idx);
398 const char *name = (type == AVMEDIA_TYPE_VIDEO) ?
"trim" :
"atrim";
401 if (duration == INT64_MAX && start_time == AV_NOPTS_VALUE)
404 trim = avfilter_get_by_name(name);
406 av_log(NULL, AV_LOG_ERROR,
"%s filter not present, cannot limit "
407 "recording time.\n", name);
408 return AVERROR_FILTER_NOT_FOUND;
411 ctx = avfilter_graph_alloc_filter(graph, trim, filter_name);
413 return AVERROR(ENOMEM);
415 if (duration != INT64_MAX) {
416 ret = av_opt_set_int(ctx,
"durationi", duration,
417 AV_OPT_SEARCH_CHILDREN);
419 if (ret >= 0 && start_time != AV_NOPTS_VALUE) {
420 ret = av_opt_set_int(ctx,
"starti", start_time,
421 AV_OPT_SEARCH_CHILDREN);
424 av_log(ctx, AV_LOG_ERROR,
"Error configuring the %s filter", name);
428 ret = avfilter_init_str(ctx, NULL);
432 ret = avfilter_link(*last_filter, *pad_idx, ctx, 0);
442 const char *filter_name,
const char *args)
444 AVFilterGraph *graph = (*last_filter)->graph;
445 AVFilterContext *ctx;
448 ret = avfilter_graph_create_filter(&ctx,
449 avfilter_get_by_name(filter_name),
450 filter_name, args, NULL, graph);
454 ret = avfilter_link(*last_filter, *pad_idx, ctx, 0);
468 AVFilterContext *last_filter = out->filter_ctx;
469 int pad_idx = out->pad_idx;
473 snprintf(name,
sizeof(name),
"out_%d_%d", ost->
file_index, ost->
index);
474 ret = avfilter_graph_create_filter(&ofilter->
filter,
475 avfilter_get_by_name(
"buffersink"),
476 name, NULL, NULL, fg->
graph);
483 AVFilterContext *filter;
484 AVDictionaryEntry *e = NULL;
486 snprintf(args,
sizeof(args),
"%d:%d",
489 while ((e = av_dict_get(ost->
sws_dict,
"", e,
490 AV_DICT_IGNORE_SUFFIX))) {
491 av_strlcatf(args,
sizeof(args),
":%s=%s", e->key, e->value);
494 snprintf(name,
sizeof(name),
"scaler_out_%d_%d",
496 if ((ret = avfilter_graph_create_filter(&filter, avfilter_get_by_name(
"scale"),
497 name, args, NULL, fg->
graph)) < 0)
499 if ((ret = avfilter_link(last_filter, pad_idx, filter, 0)) < 0)
502 last_filter = filter;
507 AVFilterContext *filter;
508 snprintf(name,
sizeof(name),
"format_out_%d_%d",
510 ret = avfilter_graph_create_filter(&filter,
511 avfilter_get_by_name(
"format"),
512 "format", pix_fmts, NULL, fg->
graph);
516 if ((ret = avfilter_link(last_filter, pad_idx, filter, 0)) < 0)
519 last_filter = filter;
524 AVFilterContext *fps;
527 snprintf(args,
sizeof(args),
"fps=%d/%d", ost->
frame_rate.num,
529 snprintf(name,
sizeof(name),
"fps_out_%d_%d",
531 ret = avfilter_graph_create_filter(&fps, avfilter_get_by_name(
"fps"),
532 name, args, NULL, fg->
graph);
536 ret = avfilter_link(last_filter, pad_idx, fps, 0);
543 snprintf(name,
sizeof(name),
"trim_out_%d_%d",
546 &last_filter, &pad_idx, name);
551 if ((ret = avfilter_link(last_filter, pad_idx, ofilter->
filter, 0)) < 0)
561 AVCodecContext *codec = ost->
enc_ctx;
562 AVFilterContext *last_filter = out->filter_ctx;
563 int pad_idx = out->pad_idx;
568 snprintf(name,
sizeof(name),
"out_%d_%d", ost->
file_index, ost->
index);
569 ret = avfilter_graph_create_filter(&ofilter->
filter,
570 avfilter_get_by_name(
"abuffersink"),
571 name, NULL, NULL, fg->
graph);
574 if ((ret = av_opt_set_int(ofilter->
filter,
"all_channel_counts", 1, AV_OPT_SEARCH_CHILDREN)) < 0)
577 #define AUTO_INSERT_FILTER(opt_name, filter_name, arg) do { \
578 AVFilterContext *filt_ctx; \
580 av_log(NULL, AV_LOG_INFO, opt_name " is forwarded to lavfi " \
581 "similarly to -af " filter_name "=%s.\n", arg); \
583 ret = avfilter_graph_create_filter(&filt_ctx, \
584 avfilter_get_by_name(filter_name), \
585 filter_name, arg, NULL, fg->graph); \
589 ret = avfilter_link(last_filter, pad_idx, filt_ctx, 0); \
593 last_filter = filt_ctx; \
599 av_bprint_init(&pan_buf, 256, 8192);
600 av_bprintf(&pan_buf,
"0x%"PRIx64,
607 av_bprint_finalize(&pan_buf, NULL);
610 if (codec->channels && !codec->channel_layout)
611 codec->channel_layout = av_get_default_channel_layout(codec->channels);
613 sample_fmts = choose_sample_fmts(ofilter);
615 channel_layouts = choose_channel_layouts(ofilter);
617 AVFilterContext *format;
622 av_strlcatf(args,
sizeof(args),
"sample_fmts=%s:",
625 av_strlcatf(args,
sizeof(args),
"sample_rates=%s:",
628 av_strlcatf(args,
sizeof(args),
"channel_layouts=%s:",
631 av_freep(&sample_fmts);
633 av_freep(&channel_layouts);
635 snprintf(name,
sizeof(name),
"format_out_%d_%d",
637 ret = avfilter_graph_create_filter(&format,
638 avfilter_get_by_name(
"aformat"),
639 name, args, NULL, fg->
graph);
643 ret = avfilter_link(last_filter, pad_idx, format, 0);
647 last_filter = format;
655 for (i=0; i<of->
ctx->nb_streams; i++)
656 if (of->
ctx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)
659 if (i<of->ctx->nb_streams) {
660 snprintf(args,
sizeof(args),
"%s", ost->
apad);
665 snprintf(name,
sizeof(name),
"trim for output stream %d:%d",
668 &last_filter, &pad_idx, name);
672 if ((ret = avfilter_link(last_filter, pad_idx, ofilter->
filter, 0)) < 0)
681 av_log(NULL, AV_LOG_FATAL,
"Filter %s has an unconnected output\n", ofilter->
name);
685 switch (avfilter_pad_get_type(out->filter_ctx->output_pads, out->pad_idx)) {
688 default: av_assert0(0);
700 av_log(NULL, AV_LOG_FATAL,
"Filter %s has an unconnected output\n", output->
name);
718 for (i = 0; i < avf->nb_streams; i++) {
719 if (avf->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
720 w = FFMAX(w, avf->streams[i]->codecpar->width);
721 h = FFMAX(h, avf->streams[i]->codecpar->height);
728 av_log(avf, AV_LOG_INFO,
"sub2video: using %dx%d canvas\n", w, h);
738 ifilter->
format = AV_PIX_FMT_RGB32;
742 return AVERROR(ENOMEM);
757 AVFilterContext *last_filter;
758 const AVFilter *buffer_filt = avfilter_get_by_name(
"buffer");
767 int ret, pad_idx = 0;
768 int64_t tsoffset = 0;
769 AVBufferSrcParameters *par = av_buffersrc_parameters_alloc();
772 return AVERROR(ENOMEM);
773 memset(par, 0,
sizeof(*par));
774 par->format = AV_PIX_FMT_NONE;
776 if (ist->
dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) {
777 av_log(NULL, AV_LOG_ERROR,
"Cannot connect video filter to audio input\n");
778 ret = AVERROR(EINVAL);
785 if (ist->
dec_ctx->codec_type == AVMEDIA_TYPE_SUBTITLE) {
793 sar = (AVRational){0,1};
794 av_bprint_init(&args, 0, AV_BPRINT_SIZE_AUTOMATIC);
796 "video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:"
797 "pixel_aspect=%d/%d",
799 tb.num, tb.den, sar.num, sar.den);
800 if (fr.num && fr.den)
801 av_bprintf(&args,
":frame_rate=%d/%d", fr.num, fr.den);
802 snprintf(name,
sizeof(name),
"graph %d input from stream %d:%d", fg->
index,
806 if ((ret = avfilter_graph_create_filter(&ifilter->
filter, buffer_filt, name,
807 args.str, NULL, fg->
graph)) < 0)
810 ret = av_buffersrc_parameters_set(ifilter->
filter, par);
814 last_filter = ifilter->
filter;
819 if (fabs(theta - 90) < 1.0) {
820 ret =
insert_filter(&last_filter, &pad_idx,
"transpose",
"clock");
821 }
else if (fabs(theta - 180) < 1.0) {
826 }
else if (fabs(theta - 270) < 1.0) {
827 ret =
insert_filter(&last_filter, &pad_idx,
"transpose",
"cclock");
828 }
else if (fabs(theta) > 1.0) {
830 snprintf(rotate_buf,
sizeof(rotate_buf),
"%f*PI/180", theta);
831 ret =
insert_filter(&last_filter, &pad_idx,
"rotate", rotate_buf);
838 AVFilterContext *yadif;
840 snprintf(name,
sizeof(name),
"deinterlace_in_%d_%d",
842 if ((ret = avfilter_graph_create_filter(&yadif,
843 avfilter_get_by_name(
"yadif"),
848 if ((ret = avfilter_link(last_filter, 0, yadif, 0)) < 0)
854 snprintf(name,
sizeof(name),
"trim_in_%d_%d",
859 tsoffset += f->
ctx->start_time;
863 &last_filter, &pad_idx, name);
867 if ((ret = avfilter_link(last_filter, 0, in->filter_ctx, in->pad_idx)) < 0)
879 AVFilterContext *last_filter;
880 const AVFilter *abuffer_filt = avfilter_get_by_name(
"abuffer");
885 int ret, pad_idx = 0;
886 int64_t tsoffset = 0;
888 if (ist->
dec_ctx->codec_type != AVMEDIA_TYPE_AUDIO) {
889 av_log(NULL, AV_LOG_ERROR,
"Cannot connect audio filter to non audio input\n");
890 return AVERROR(EINVAL);
893 av_bprint_init(&args, 0, AV_BPRINT_SIZE_AUTOMATIC);
894 av_bprintf(&args,
"time_base=%d/%d:sample_rate=%d:sample_fmt=%s",
897 av_get_sample_fmt_name(ifilter->
format));
899 av_bprintf(&args,
":channel_layout=0x%"PRIx64,
902 av_bprintf(&args,
":channels=%d", ifilter->
channels);
903 snprintf(name,
sizeof(name),
"graph_%d_in_%d_%d", fg->
index,
906 if ((ret = avfilter_graph_create_filter(&ifilter->
filter, abuffer_filt,
907 name, args.str, NULL,
910 last_filter = ifilter->
filter;
912 #define AUTO_INSERT_FILTER_INPUT(opt_name, filter_name, arg) do { \
913 AVFilterContext *filt_ctx; \
915 av_log(NULL, AV_LOG_INFO, opt_name " is forwarded to lavfi " \
916 "similarly to -af " filter_name "=%s.\n", arg); \
918 snprintf(name, sizeof(name), "graph_%d_%s_in_%d_%d", \
919 fg->index, filter_name, ist->file_index, ist->st->index); \
920 ret = avfilter_graph_create_filter(&filt_ctx, \
921 avfilter_get_by_name(filter_name), \
922 name, arg, NULL, fg->graph); \
926 ret = avfilter_link(last_filter, 0, filt_ctx, 0); \
930 last_filter = filt_ctx; \
934 char args[256] = {0};
940 av_strlcatf(args,
sizeof(args),
":first_pts=0");
960 av_log(NULL, AV_LOG_WARNING,
"-vol has been deprecated. Use the volume "
961 "audio filter instead.\n");
963 snprintf(args,
sizeof(args),
"%f",
audio_volume / 256.);
967 snprintf(name,
sizeof(name),
"trim for input stream %d:%d",
972 tsoffset += f->
ctx->start_time;
976 &last_filter, &pad_idx, name);
980 if ((ret = avfilter_link(last_filter, 0, in->filter_ctx, in->pad_idx)) < 0)
990 av_log(NULL, AV_LOG_ERROR,
991 "No decoder for stream #%d:%d, filtering impossible\n",
993 return AVERROR_DECODER_NOT_FOUND;
995 switch (avfilter_pad_get_type(in->filter_ctx->input_pads, in->pad_idx)) {
998 default: av_assert0(0);
1009 avfilter_graph_free(&fg->
graph);
1014 AVFilterInOut *inputs, *outputs, *cur;
1020 if (!(fg->
graph = avfilter_graph_alloc()))
1021 return AVERROR(ENOMEM);
1026 AVDictionaryEntry *e = NULL;
1031 while ((e = av_dict_get(ost->
sws_dict,
"", e,
1032 AV_DICT_IGNORE_SUFFIX))) {
1033 av_strlcatf(args,
sizeof(args),
"%s=%s:", e->key, e->value);
1036 args[strlen(args)-1] = 0;
1037 fg->
graph->scale_sws_opts = av_strdup(args);
1040 while ((e = av_dict_get(ost->
swr_opts,
"", e,
1041 AV_DICT_IGNORE_SUFFIX))) {
1042 av_strlcatf(args,
sizeof(args),
"%s=%s:", e->key, e->value);
1045 args[strlen(args)-1] = 0;
1046 av_opt_set(fg->
graph,
"aresample_swr_opts", args, 0);
1050 AV_DICT_IGNORE_SUFFIX))) {
1051 av_strlcatf(args,
sizeof(args),
"%s=%s:", e->key, e->value);
1054 args[strlen(args) - 1] =
'\0';
1056 e = av_dict_get(ost->
encoder_opts,
"threads", NULL, 0);
1058 av_opt_set(fg->
graph,
"threads", e->value, 0);
1063 if ((ret = avfilter_graph_parse2(fg->
graph, graph_desc, &inputs, &outputs)) < 0)
1070 if (simple && (!inputs || inputs->next || !outputs || outputs->next)) {
1071 const char *num_inputs;
1072 const char *num_outputs;
1075 }
else if (outputs->next) {
1082 }
else if (inputs->next) {
1087 av_log(NULL, AV_LOG_ERROR,
"Simple filtergraph '%s' was expected "
1088 "to have exactly 1 input and 1 output."
1089 " However, it had %s input(s) and %s output(s)."
1090 " Please adjust, or use a complex filtergraph (-filter_complex) instead.\n",
1091 graph_desc, num_inputs, num_outputs);
1092 ret = AVERROR(EINVAL);
1096 for (cur = inputs, i = 0; cur; cur = cur->next, i++)
1098 avfilter_inout_free(&inputs);
1099 avfilter_inout_free(&outputs);
1102 avfilter_inout_free(&inputs);
1104 for (cur = outputs, i = 0; cur; cur = cur->next, i++)
1106 avfilter_inout_free(&outputs);
1109 avfilter_graph_set_auto_convert(fg->
graph, AVFILTER_AUTO_CONVERT_NONE);
1110 if ((ret = avfilter_graph_config(fg->
graph, NULL)) < 0)
1117 AVFilterContext *sink = ofilter->
filter;
1119 ofilter->
format = av_buffersink_get_format(sink);
1121 ofilter->
width = av_buffersink_get_w(sink);
1122 ofilter->
height = av_buffersink_get_h(sink);
1124 ofilter->
sample_rate = av_buffersink_get_sample_rate(sink);
1125 ofilter->
channel_layout = av_buffersink_get_channel_layout(sink);
1135 av_log(NULL, AV_LOG_ERROR,
"Encoder (codec %s) not found for output stream #%d:%d\n",
1137 ret = AVERROR(EINVAL);
1140 if (ost->
enc->type == AVMEDIA_TYPE_AUDIO &&
1141 !(ost->
enc->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE))
1150 ret = av_buffersrc_add_frame(fg->
inputs[i]->
filter, tmp);
1151 av_frame_free(&tmp);
1160 ret = av_buffersrc_add_frame(fg->
inputs[i]->
filter, NULL);
1174 avsubtitle_free(&tmp);
1190 ifilter->
format = frame->format;
1192 ifilter->
width = frame->width;
1193 ifilter->
height = frame->height;
1197 ifilter->
channels = frame->channels;
1200 if (frame->hw_frames_ctx) {
1201 ifilter->
hw_frames_ctx = av_buffer_ref(frame->hw_frames_ctx);
1203 return AVERROR(ENOMEM);
int64_t start_time
start time in microseconds == AV_TIME_BASE units
int64_t recording_time
desired length of the resulting file in microseconds == AV_TIME_BASE units
struct OutputStream * ost
struct FilterGraph * graph
int audio_channels_mapped
AVDictionary * resample_opts
AVDictionary * encoder_opts