Call FFmpeg filter from source code (C API)
You can't just call a filter, You must instantiate a filter graph.

First you need to create a buffer and buffersink via:

AVFilterContext* source = 0;
AVFilterContext* sink = 0;
AVFilterGraph *graph = avfilter_graph_alloc()
avfilter_graph_create_filter(&amp;source, avfilter_get_by_name("buffer"), nullptr, args, nullptr, graph);


AVBufferSinkParams* buffersink_params = av_buffersink_params_alloc();
buffersink_params-&gt;pixel_fmts = /*Your pixel format HERE*/;

avfilter_graph_create_filter(&amp;sink, avfilter_get_by_name("buffersink"), nullptr, nullptr, buffersink_params, graph);



You can then create your filter via something like this

snprintf(args, sizeof(args), "n=-60dB:d=2");
avfilter_graph_create_filter(&amp;freezedetect, avfilter_get_by_name("freezedetect"), nullptr, args, nullptr, graph);


Then link it all together:

avfilter_link(source, 0, freezedetect, 0);
avfilter_link(freezedetect, 0, sink, 0);
avfilter_graph_config(graph, 0);


Finally you can send frames to the filter via

av_buffersrc_write_frame(source, frame);


And get the result with 

 av_buffersink_get_frame(sink, frame);


Don't forget to free it all at the end