avfilter_graph_create_filter,错误值 -12

God*_*ped 2 c++ ffmpeg

我在创建图形过滤器时遇到了一些问题,我在 ret val 上不断收到错误 -12,我不知道为什么,我确保分配了 buffersrc_ctx 和 filter_graph。

我可以去哪里寻找错误 -12 是什么,如果有人能告诉我他们是否看到任何东西,将不胜感激!

提前致谢

_snprintf( args, sizeof(args), 
           "time_base=%d/%d:sample_rate=%d:sample_fmt=%s:channel_layout=0x%u", 
        pFormatCtx->streams[audioStream]->time_base.num, 
            pFormatCtx->streams[audioStream]->time_base.den,
        dec_ctx->sample_rate,
        av_get_sample_fmt_name(dec_ctx->sample_fmt),
        dec_ctx->channel_layout );

ret = avfilter_graph_create_filter(&buffersrc_ctx, 
                                   buffersrc, 
                                   NULL, args, NULL, filter_graph);
Run Code Online (Sandbox Code Playgroud)

小智 5

我相信现在回答这个问题有点晚了,但如果有人偶然发现和我一样的问题,这可能会有所帮助。

如果buffersrcNULL,可能是因为您忘记使用以下命令注册过滤器:avfilter_register_all();