GStreamer pipeline hangs after hours due to errors

Hi,
I confirm that the patch has resolved the issue with the nvv4l2h265enc encoder. Thank you for that.

Now since first issue has gone, can you give advice on the camera’s failure ?
I have tested both cameras simultaneously using gstreamer pipeline shown below on a regular laptop running Ubuntu 20.04 and no faulty detected so far, but cameras are guaranteed to fail on short period of time while using the same pipeline on Jetson Xavier NX.

gst-launch-1.0 -e \
    v4l2src device=/dev/video0 name=source_1 ! 'video/x-raw,format=YUY2,width=1920,height=1080,framerate=30/1' ! videoconvert ! xvimagesink sync=false name=sink_primary \
    v4l2src device=/dev/video1 name=source_2 ! 'video/x-raw,format=YUY2,width=1920,height=1080,framerate=30/1' ! videoconvert ! xvimagesink sync=false name=sink_secondary

I’ve tried tricks from the these topics, still couldnt resolve the issue