[Libav-user] Does AVFilterGraph support insertion on the fly
zaijunhao at outlook.com
Wed Jun 22 07:19:23 EEST 2022
Is there a way to insert a filter into a running filter graph? I’ve tried this:
avfilter_graph_create_filter(&ctx, filter, "transpose", "dir=1", nullptr, graph);
auto *target = avfilter_graph_get_filter(graph, "out”); // out is buffersink filter
avfilter_insert_filter(target->inputs, ctx, 0, 0);
The insertion succeeded but getting a frame from the graph later failed with error code -12. Sometimes getting a frame can succeed with a weird result frame that seems like the pixel layout is wrong, it depends on the insertion target position.
As I know, negotiating formats between filters is an essential step before a graph starts to work, so insertion on the fly may not be permitted, but I cannot find any related document explaining it.
And what can we do with the "avfilter_insert_filter" API if insertion on the fly is a bad case? It's a public function.
I think another way around that is inserting all filters at the beginning with some proper “enable commands” queued.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libav-user