Use 4-channel cameras and open 4 camera programs. Each camera receiving program uses nvjpg to compress YUV data into jpg. Only two channels are working and the other two are suspended. You will not encounter problems using opencv.
Do you use gstreamer nvjpeg plugin or jetson_multimedia_api NvJpegEncoder class? And please use latest Jetpack version 4.6.4 or 5.1.2.