[FFmpeg-devel] [PATCH] avfilter/setparams: add FF_FILTER_FLAG_HWFRAME_AWARE

Pavel Koshevoy pkoshevoy at gmail.com
Sun Mar 14 22:26:12 EET 2021


On Sun, Mar 14, 2021 at 1:59 PM Pavel Koshevoy <pkoshevoy at gmail.com> wrote:

>
> I guess I no longer know how to use avfilter api:
>
> I've been doing this:
> ```
>     graph_ = avfilter_graph_alloc();
>
>     if (nb_threads_ > 0)
>     {
>       graph_->nb_threads = nb_threads_;
>     }
>
>     int err = avfilter_graph_parse2(graph_, filters_.c_str(), &in_, &out_);
> ```
>
> where filters_ is something like this: "buffer=width=1920:height=800:pix_fmt=cuda:frame_rate=60/1:time_base=1/90000:sar=1/1,hwdownload,format=pix_fmts=yuv420p,scale=w=128:h=47,setsar=sar=0.888889,buffersink"
> I don't see where to pass in the hwframes context. AVFilterGraph makes no
> mention of it, and avfilter_graph_parse2 has no parameter for it.
>

nvm, after looking through fftools/ffmpeg_hw.c and ffmpeg_filter.c I think
I see it now -- I need to call  av_buffersrc_parameters_set and pass
hw_frames_ctx through AVBufferSrcParameters

Pavel.


More information about the ffmpeg-devel mailing list