Issues with raspberry pi camera on jetson nano in headless mode

Hi,
In the sample, it calls the function for creating a window for video display:

cv2.namedWindow(window_title, cv2.WINDOW_AUTOSIZE)
cv2.imshow(window_title, camera_images)

For headless mode, you would need to customize the sample to remove the function calls. May refer to this transcoding sample and try to save to a video file:
Displaying to the screen with OpenCV and GStreamer - #9 by DaneLLL