I am having trouble initializing scale_cuda or scale_npp filter while using CUDA hardware. I have created the decoder and encoder using the example code from ffmpeg's github, hw_decode.c. This includes creating the hardware context with av_hwdevice_ctx_create(), which is shared between decoder and encoder, and presumably filter using the av_buffer_ref() call. After this, following code is invoked to set hw_frames_ctx for decoder and encoder:
This code works fine, and everything seems to be set properly when I call avcodec_open2() for encoder and decoder. Problem comes when I try to initialize filter scale_cuda or scale_npp. scale_cuda simply gives segmentation fault when invoking avfilter_graph_config(), and scale_npp gives following message:
No hw context provided on input Failed to configure output pad on Parsed_scale_npp_0
Currently I am not sure how to set hardware context on input filter, or output filter or what exactly needs to be done to get this thing to work. Any help is greatly appreciated!