[FFmpeg-user] Error: Impossible to convert between the formats...(Nvidia codecs)

Ben Parham behfarteam at gmail.com
Sat Jul 9 14:25:12 EEST 2022


Thanks, Dennis. I added it in -preset p4 and the same error appeared:

hevc @ 000001ac32f034c0] hardware accelerator failed to decode picture
Error while decoding stream #0:0: Generic error in an external library
[hevc @ 000001ac41cd1180] Could not find ref with POC 5
[hevc @ 000001ac41d82640] No decoder surfaces left38 bitrate=N/A speed=2.09x
[hevc @ 000001ac41d82640]
decoder->cvdl->cuvidDecodePicture(decoder->decoder, &ctx->pic_params)
failed -> CUDA_ERROR_INVALID_VALUE: invalid argument

On Sat, Jul 9, 2022 at 7:11 PM Dennis Mungai <dmngaie at gmail.com> wrote:

> On Sat, 9 Jul 2022 at 14:01, Ben Parham <behfarteam at gmail.com> wrote:
>
> > Thank you, Dennis. By removing _pix_fmt the issue was solved.
> > But when I change the preset from p2 to p3 or p4, I face this error:
> >
> > [hevc @ 000001ebb41bdc40] hardware accelerator failed to decode picture
> > [hevc @ 000001ebb41bb440] Could not find ref with POC 24
> > [rtsp @ 000001ebb42500c0] Invalid DTS: 126000 PTS: 118800 in output
> stream
> > 0:0, replacing by guess
> > Error while decoding stream #0:0: Generic error in an external library
> > [hevc @ 000001ebb41bbc40] No decoder surfaces left
> > [hevc @ 000001ebb41bbc40]
> > decoder->cvdl->cuvidDecodePicture(decoder->decoder, &ctx->pic_params)
> > failed -> CUDA_ERROR_INVALID_VALUE: invalid argument
> >
> > Could you help me to fix this error please?
> >
>
> Sure, I can.
>
> By design, ffmpeg's NVDEC implementation is required to allocate surfaces
> to handle bitstreams with advanced features such as B-frames, interlaced
> content, etc.
> However, the pre-allocated surfaces may not be enough in some cases, and
> that can be fixed by setting the -extra_hw_frames {n} option, with n > 2.
> See this ticket for more details: https://trac.ffmpeg.org/ticket/7562
>
> Try this out:
>
> ffmpeg -y -vsync 0 -hwaccel cuda -hwaccel_output_format cuda
> -extra_hw_frames 3
> rtsp_transport tcp -i "rtsp://admin:Pass1@192.168.1.1" -flags
> +low_delay -vcodec hevc_nvenc -vf scale_cuda=1920:1080 -preset p2
> -pix_fmt yuv420p -tune hq -rc vbr -vb 700k -maxrate  800k -minrate
> 200k -bufsize 800k -g 25 -acodec copy -strict -2 -flags +global_header
> -f rtsp "rtsp://localhost:8000/stream"
>
> And report back.
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
>


More information about the ffmpeg-user mailing list