ffmpeg/x265: fixed-GOP, IDR only keyframes, repeating headers
Minimal command line, for a GOP size of 2 seconds:

ffmpeg -i input -force_key_frames expr:gte(t,n_forced*2) -c:v libx265 -x265-params open-gop=0:scenecut=0:repeat-headers=1 output.hevc

Verification:

ffmpeg -i output.hevc -c copy -bsf:v trace_headers -f null -


After each line containing key frame e.g.,

Packet: 18115 bytes, key frame, no pts, dts 2319977, duration 40000.


You should see the VPS/SPS/PPS. The first Slice Segment Header that follows should have a NAL unit type of 20 which is IDR_N_LP.

ffprobe can't invoke bitstream filters.