我一直在尝试使用FFmpeg.Autogen
. 使用先前提出的问题,我制作了一个修改后的示例,展示了我当前如何尝试应用transpose
过滤器。
private void SetupTransposeFilter()
{
AVFilterGraph* filter_graph = ffmpeg.avfilter_graph_alloc();
AVFilter* transposeFilter = ffmpeg.avfilter_get_by_name("transpose");
AVFilter* buffersink = ffmpeg.avfilter_get_by_name("buffersink");
AVFilterContext* buffersrc_ctx;
AVFilterContext* buffersrc_transpose;
ffmpeg.avfilter_graph_create_filter(&buffersrc_ctx, buffersink, "buffersink", null, null, filter_graph).ThrowExceptionIfError();
ffmpeg.avfilter_graph_create_filter(&buffersrc_transpose, transposeFilter, "transpose", "cclock", null, filter_graph).ThrowExceptionIfError();
AVFilterInOut* outputs = ffmpeg.avfilter_inout_alloc();
AVFilterInOut* inputs = ffmpeg.avfilter_inout_alloc();
outputs->name = ffmpeg.av_strdup("buffersink");
outputs->filter_ctx = buffersrc_ctx;
outputs->pad_idx = 0;
outputs->next = null;
inputs->name = ffmpeg.av_strdup("transpose");
inputs->filter_ctx = buffersrc_transpose;
inputs->pad_idx = 0;
inputs->next = null;
ffmpeg.avfilter_graph_parse_ptr(filter_graph, "transpose=cclock", &inputs, &outputs, null).ThrowExceptionIfError();
ffmpeg.avfilter_graph_config(filter_graph, null).ThrowExceptionIfError();
ffmpeg.avfilter_inout_free(&inputs);
ffmpeg.avfilter_inout_free(&outputs);
}
它到达第 25 行,其中avfilter_graph_config
给了我一个错误代码 -22,在FFmpeg
显示这个 a "Invalid argument"
。我尝试更改中的参数,avfilter_graph_parse_ptr
但它给出了相同的错误消息。
任何有关如何克服这一挑战的提示或技巧都将受到极大的欢迎。