R32.3.1 tx2-4g gst_element_change_state hangs

It helps that you provide the pipeline.
I’m unable to fully try because there are custom plugins such as stalkertakepicture that I don’t have, but I see at least 2 problems with it:

  1. The crop parameters and output are not correct (reread this). So change the crop parameters so that
    [EDIT: needs to be corrected by -1 wrt to output resolution
    right = left + 480 -1 and bottom = top + 380 -1]:
nvvidconv name=stalkerLoc flip-method=2 top=520 bottom899 left=1212 right=1691 \
     ! 'video/x-raw(memory:NVMM),width=480,height=380'

or, if your ROI is 1440x1140 and just want to rescale for display:

nvvidconv name=stalkerLoc flip-method=2 top=520 bottom=1659 left=1212 right=2651 \
     ! 'video/x-raw(memory:NVMM),width=1440,height=1140' \
     ! nvvidconv \
     ! 'video/x-raw(memory:NVMM),width=480,height=380,pixel-aspect-ratio=1/1'
  1. For using nvjpegenc, you need to have I420 format in NVMM memory:
nvvidconv \
      ! 'video/x-raw(memory:NVMM),format=I420' \
      ! nvjpegenc