Error encoding with omxh264enc or nvv4l2h264enc in gstreamer

we use the following url to push stream in gst rstp.

v4l2src device=/dev/video0 ! tee name=raw raw. ! queue ! nvvidconv ! omxh264enc ! video/x-h264,stream-format=byte-stream,alignment=au ! fpsdisplaysink video-sink=fakesink signal-fps-measurements=true text-overlay=false --gst-debug=fpsdisplaysink:6 raw. ! queue ! nvvidconv ! omxh264enc ! rtph264pay mtu=1400 name=pay0 pt=96

The program reports an error and crashes. The message is as follows:
Stream ready at rtsp://0.0.0.0:8554/video
Framerate set to : 30 at NvxVideoEncoderSetParameterNvMMLiteOpen : Block : BlockType = 8
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 8
NVMEDIA: H265 : Profile : 1
NvMMLiteVideoEncDoWork: Surface resolution (0 x 0) smaller than encode resolution (1920 x 1080)
VENC: NvMMLiteVideoEncDoWork: 4231: BlockSide error 0x4
Event_BlockError from 0BlockHevcEnc : Error code - 4
Sending error event from 0BlockHevcEncSegmentation fault (core dumped)

We still have this problem when we use another url.
v4l2src device=’/dev/video%d’ ! ‘video/x-raw, format=(string)YUYV, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)10/1’ ! nvvidconv ! nvv4l2h264enc ! rtph264pay mtu=1400 name=pay0 pt=96

Please help to answer.
The hardware platform used is Xavier, and the system version is 32.3.1.The previous TX2 did not encounter this problem

Hi,
You may try with test-launch. Please refer to

The test command is as follows:
./test-launch ‘videotestsrc ! nvvidconv ! nvv4l2h264enc ! h264parse ! queue ! rtph264pay name=pay0 pt=96 audiotestsrc ! voaacenc ! queue ! rtpmp4apay pt=97 name=pay1’

The error message is as follows

stream ready at rtsp://127.0.0.1:8554/test
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 4
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
H264: Profile = 66, Level = 0
NvMMLiteVideoEncDoWork: Surface resolution (1036 x 0) smaller than encode resolution (320 x 240)
VENC: NvMMLiteVideoEncDoWork: 4231: BlockSide error 0x4
NvVideoEnc: BlockError
NvVideoEncTransferOutputBufferToBlock: DoWork failed line# 667
NvVideoEnc: NvVideoEncTransferOutputBufferToBlock TransferBufferToBlock failed Line=678
NvVideoEncTransferCaptureBufferToBlock: DoWork failed line# 631
NvVideoEncTransferOutputBufferToBlock: DoWork failed line# 667
NvVideoEnc: NvVideoEncTransferOutputBufferToBlock TransferBufferToBlock failed Line=678
NvVideoEncTransferCaptureBufferToBlock: DoWork failed line# 631
NvVideoEncTransferOutputBufferToBlock: DoWork failed line# 667
NvVideoEnc: NvVideoEncTransferOutputBufferToBlock TransferBufferToBlock failed Line=678

Continuing the discussion from Error encoding with omxh264enc or nvv4l2h264enc in gstreamer:

./test-launch ‘videotestsrc ! nvvidconv ! nvv4l2h264enc ! h264parse ! queue ! rtph264pay name=pay0 pt=96 audiotestsrc ! voaacenc ! queue ! rtpmp4apay pt=97 name=pay1’

please see the print below:
stream ready at rtsp://127.0.0.1:8554/test
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 4
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
H264: Profile = 66, Level = 0
NvMMLiteVideoEncDoWork: Surface resolution (1036 x 0) smaller than encode resolution (320 x 240)
VENC: NvMMLiteVideoEncDoWork: 4231: BlockSide error 0x4
NvVideoEnc: BlockError
NvVideoEncTransferOutputBufferToBlock: DoWork failed line# 667
NvVideoEnc: NvVideoEncTransferOutputBufferToBlock TransferBufferToBlock failed Line=678
NvVideoEncTransferCaptureBufferToBlock: DoWork failed line# 631
NvVideoEncTransferOutputBufferToBlock: DoWork failed line# 667
NvVideoEnc: NvVideoEncTransferOutputBufferToBlock TransferBufferToBlock failed Line=678
NvVideoEncTransferCaptureBufferToBlock: DoWork failed line# 631
NvVideoEncTransferOutputBufferToBlock: DoWork failed line# 667
NvVideoEnc: NvVideoEncTransferOutputBufferToBlock TransferBufferToBlock failed Line=678

Hi,
Please clean the cache and tray agin.

nvidia@nvidia-desktop:~$ rm .cache/gstreamer-1.0/registry.aarch64.bin

If cleaning cache does not help, suggest you re-flash through SDKManager.
We have verified it on r32.3.1 and r32.4.2. Don’t observe this issue.