Nvstreammux freezes pipeline, using (batch-size > 1)


I’m trying to run a pipline that uses “nvstreammux” with the following config:
g_object_set(G_OBJECT(data.nvstreammux), “live-source”, 1, “width”, 945, “height”, 540, “batch-size”, 1, “gpu-id”, 0, “nvbuf-memory-type”, 0, “num-surfaces-per-frame”, 1, NULL);
The pipeline works fine with (batch-size = 1). However when switching to (batch-size > 1), the pipeline freezes, immediately after switching to “playing” mode

The pipeline was implemented programmatically in C++ (and not by using gst-launch-1.0). These are the pipeline components and order:
rtsp_source → rtp_to_h264 → h264_parse → h264_decode → videoflip → videoconvert → videoscale → queue → nvvideoconvert → capsfilter → nvstreammux → nvvideoconvert → queue → yoloplugin → fakesink

I’ve tried removing all components after the nvstreammux (except for a final appsink block), but the pipeline still seem to freeze.

Any ideas how to solve this?