Nvh264enc "Invalid Level" error when FPS exceeds 128 at 3840x2160 resolution - How to solve?

I’m encountering an issue with GStreamer 1.24. When I set the framerate to 128/1 for 3840x2160 (4K) resolution video, the pipeline works normally; however, when I increase the framerate to 129/1 or higher, I receive an “Invalid Level” error.

Here are two specific examples:

Successful case (4K resolution, FPS = 128):

gst-launch-1.0 ximagesrc num-buffers=20 ! video/x-raw,framerate=128/1,width=3840,height=2160 ! identity silent=false ! cudaupload ! cudaconvert ! "video/x-raw(memory:CUDAMemory),format=Y444" ! nvh264enc bitrate=4000 rc-mode=cbr ! video/x-h264,profile=high-4:4:4 ! rtph264pay ! application/x-rtp,media=video,encoding-name=H264,payload=96 ! fakesink

Output is normal, and the pipeline completes execution.

Failed case (4K resolution, FPS = 129):

gst-launch-1.0 ximagesrc num-buffers=20 ! video/x-raw,framerate=129/1,width=3840,height=2160 ! identity silent=false ! cudaupload ! cudaconvert ! "video/x-raw(memory:CUDAMemory),format=Y444" ! nvh264enc bitrate=4000 rc-mode=cbr ! video/x-h264,profile=high-4:4:4 ! rtph264pay ! application/x-rtp,media=video,encoding-name=H264,payload=96 ! fakesink

Error message:

ERROR: from element /GstPipeline:pipeline0/GstNvH264Enc:nvh264enc0: Could not configure supporting library.
Additional debug info:
../subprojects/gst-plugins-bad/sys/nvcodec/gstnvbaseenc.c(1841): gst_nv_base_enc_set_format (): /GstPipeline:pipeline0/GstNvH264Enc:nvh264enc0: Failed to init encoder: 8- Invalid Level.

My environment is running in a Docker container using NVIDIA GPU for hardware-accelerated encoding.

I would like to know:

  1. Why does the “Invalid Level” error occur when FPS exceeds 128 at 4K resolution?
  2. Is this related to the H.264 encoding standard and its level restrictions?
  3. Are there any solutions to support higher frame rates at this resolution?

Thanks to anyone who can provide help or guidance!