among the options reported by the h264_nvenc encoder, I see no option responsible for producing video with closed GOPs - the equivalent of libx264 open_gop=0.
My testing shows that h264_nvenc generated videos may have many open GOPs.
Is there a way to force h264_nvenc to produce closed GOPs?
I just found this topic [H264/HEVC]Passing private pointers through enocders which says that close GOP is the default.
The way I recognize open GOP is to find a frame that has both pict_type=I and key_frame=0. My tests shows that there are multiple open GOPs in video produced by h264_nvenc.
For reference my ffmpeg command:
ffmpeg -hwaccel cuda -hwaccel_output_format cuda -y -i input.mp4 -pix_fmt yuv420p -vcodec h264_nvenc -vf "scale_npp=1920x1080:force_original_aspect_ratio=decrease,hwdownload,format=nv12,pad=1920:1080:-1:-1:color=black" -b:v 6000k -minrate 5400k -maxrate 6600k -bufsize 3000k -profile:v high -vsync 1 -no-scenecut=1 -force_key_frames "expr:gte(t,n_forced*2)" -f mp4 output.mp4