0

I've even tried the av_hwframe_transfer_data, transferring the hardware-decoded frame to RAM and got another frame format AV_PIX_FMT_NV12 but still the sws_scale can't resize it, saying the hardware pixel format is not supported.

the funny part is, the sws_getContext makes SwsContext from those frames without any error!

I've seen suggestions about scale_npp, vf_scale_npp and etc. but couldn't find any run-able snippet about how to use those.

ffmpeg build config included these flags too:

--enable-cuda --enable-nvenc --enable-nvdec --enable-cuvid --enable-ffnvcodec --enable-nonfree --enable-cuda-nvcc --enable-libnpp --enable-gpl

Any peace of code is appreciated. Thanks in advance.

  • I suppose that resizing a frame in NV12 pixel format is not supported (since NV12 is semi-planar format with U and V elements interleaved). Try to convert the pixel format to planar format like YUV420p before resizing. In case you want an answer (instead of a comment), please post a code sample that reproduces the issue. – Rotem Feb 18 '22 at 09:47
  • Hi dear @Rotem thanks for reply. if i got it correctly, I must transfer CUDA pixel from GPU to RAM to get NV12 then convert it to YUV420p (don't know if sw_scale can do it!) then scale it using sw_scale again? while it takes too expensive process to gain a scalable frame with FFMPEG, do you think i should give up on FFMPEG and go to the NVIDIA SDK? if you say no, I will bring the code, hoping an answer. thanks again. – hameed abbasi Feb 19 '22 at 11:11
  • I don't know, I never tried NV12 to planar YUV, GPU conversion. I don't have experience with NVIDIA SDK. – Rotem Feb 19 '22 at 12:03

0 Answers0