<div dir="ltr">Hello everyone,<div><br></div><div>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:</div><div><br></div><div> codec_ctx->hw_frames_ctx = av_hwframe_ctx_alloc(hw_device_ctx);<br><br>    AVHWFramesContext* frames_ctx = (AVHWFramesContext*)(ctx->hw_frames_ctx->data);<br> frames_ctx->format = AV_PIX_FMT_CUDA;<br>      frames_ctx->sw_format = AV_PIX_FMT_NV12;<br>   frames_ctx->width = ctx->width;<br> frames_ctx->height = ctx->height;<br>       frames_ctx->initial_pool_size = 20;<br><br>      err = av_hwframe_ctx_init(codec_ctx->hw_frames_ctx);<br clear="all"><div><br></div><div>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:</div><div><br></div><div>No hw context provided on input<br>Failed to configure output pad on Parsed_scale_npp_0<br></div><div><br></div><div>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!</div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><br>Regards<br>Strahinja</div></div></div>