

How to decode an input h264 stream via h264_cuvid decoder then convert the decoded video pixel format to yuvj420p and extract a frame via mjpeg codec? vf "hwupload_cuda,scale_npp=w=1024:h=70:format=nv12:interp_algo=lanczos,hwdownload,format=yuvj420p" -vframes 1 /tmp/frame.jpgĪccording the FFmpeg documentation format conversation isn't supported: " Note that automatic format negotiation and conversion is not yet supported for hardware frames" Let's try to change the output resolution and convert the pixel format via scale_npp to yuvj420p as mjpeg codes support it: NVIDIA decode video to NV12(by default) or NV21 pixel format and it's not appropriate format for the mjpeg codec. Impossible to convert between the formats supported by the filter 'Parsed_null_0' and the filter 'auto_scaler_0'įailed to inject frame into filter network: Function not In this case we will get the following error: I think we should be able to decode a video stream on the NVIDIA card then extract a frame via CPU codec, for example, mjpeg:įfmpeg -hwaccel cuvid -c:v h264_cuvid -i video_source -vcodec mjpeg Īs I understand currently we can't extract a video frame using only NVIDIA card in FFmpeg as this functional doesn't exist, like doesn't exist a codec like mjpeg_nvenc or something else. I want to extract a frame from the h264 video stream using NVIDIA card.įirst of all we need to decode this stream via h264_cuvid decoder:įfmpeg -hwaccel cuvid -c:v h264_cuvid -i.
