H264parse: never receives valid picture headers

Hello. Trying to use a pipeline below:

gst-launch-1.0 \
videotestsrc \
! video/x-raw,framerate=60/1 \
! videoconvert \
! cudaupload \
! cudaconvert qos=true \
! video/x-raw\(memory:CUDAMemory\),format=NV12 \
! nvcudah264enc name=nvenc bitrate=10000 rate-control=cbr gop-size=-1 strict-gop=true aud=false b-adapt=false rc-lookahead=0 b-frames=0 zero-reorder-delay=true cabac=true repeat-sequence-header=true preset=p4 tune=ultra-low-latency multi-pass=two-pass-quarter \
! video/x-h264,stream-format=byte-stream,profile=main \
! queue \
! wrs. \
audiotestsrc \
! queue \
! wrs. \
webrtcsink name=wrs

But it produces:

0:00:00.259354225  1056 0x7fa120001170 WARN               h264parse gsth264parse.c:1529:gst_h264_parse_handle_frame:<h264parse0> broken/invalid nal Type: 1 Slice, Size: 204 will be dropped
0:00:00.266703464  1056 0x7fa120001170 WARN               h264parse gsth264parse.c:1529:gst_h264_parse_handle_frame:<h264parse0> broken/invalid nal Type: 1 Slice, Size: 60 will be dropped
0:00:00.283376938  1056 0x7fa120001170 WARN               h264parse gsth264parse.c:1529:gst_h264_parse_handle_frame:<h264parse0> broken/invalid nal Type: 1 Slice, Size: 54 will be dropped
0:00:00.300057065  1056 0x7fa120001170 WARN               h264parse gsth264parse.c:1529:gst_h264_parse_handle_frame:<h264parse0> broken/invalid nal Type: 1 Slice, Size: 54 will be dropped
(last message repeats infinitely)

As per source code from link, h264parse expects sps-pps picture headers to come before any “slices”. Why could this happen and how to solve this issue?

Same happens when using nvh264enc instead of nvcudah264enc in the pipeline.

Removing stream-format=byte-stream from caps solved the problem.