Videotestsrc loopback with h264 encode to decode fails

R32.3.1 TX2i

My goal is to exercise the video encode/decode functionality for an acceptance test procedure.

I have a successful end-to-end loopback

gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw, format=UYVY, width=1920, height=1080, framerate=60/1' ! nvvidconv ! 'video/x-raw(memory:NVMM), format=NV12' !   omxh264enc       ! 'video/x-h264, stream-format=(string)byte-stream' ! h264parse ! omxh264dec disable-dpb=true ! nvoverlaysink

The acceptance test needs to be automated, using videotestsrc and filesink.

Using omx fails

 gst-launch-1.0 videotestsrc num-buffers=100 ! 'video/x-raw, format=UYVY, width=1920, height=1080, framerate=60/1' ! nvvidconv ! 'video/x-raw(memory:NVMM), format=NV12' !   omxh264enc       ! 'video/x-h264, stream-format=(string)byte-stream' ! h264parse ! omxh264dec  ! filesink location=/tmp/h264.test

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Framerate set to : 60 at NvxVideoEncoderSetParameterNvMMLiteOpen : Block : BlockType = 4
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
H264: Profile = 66, Level = 40

(gst-launch-1.0:14217): GStreamer-CRITICAL **: 14:07:34.588: gst_caps_is_empty: assertion 'GST_IS_CAPS (caps)' failed

(gst-launch-1.0:14217): GStreamer-CRITICAL **: 14:07:34.588: gst_caps_truncate: assertion 'GST_IS_CAPS (caps)' failed

(gst-launch-1.0:14217): GStreamer-CRITICAL **: 14:07:34.589: gst_caps_fixate: assertion 'GST_IS_CAPS (caps)' failed

(gst-launch-1.0:14217): GStreamer-CRITICAL **: 14:07:34.589: gst_caps_get_structure: assertion 'GST_IS_CAPS (caps)' failed

(gst-launch-1.0:14217): GStreamer-CRITICAL **: 14:07:34.589: gst_structure_get_string: assertion 'structure != NULL' failed

(gst-launch-1.0:14217): GStreamer-CRITICAL **: 14:07:34.589: gst_mini_object_unref: assertion 'mini_object != NULL' failed
NvMMLiteOpen : Block : BlockType = 261
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 261
Allocating new output: 1920x1088 (x 11), ThumbnailMode = 0
OPENMAX: HandleNewStreamFormat: 3605: Send OMX_EventPortSettingsChanged: nFrameWidth = 1920, nFrameHeight = 1080
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Got EOS from element "pipeline0".
Execution ended after 0:00:02.586102721
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

Using nvv4l2
gst-launch-1.0 videotestsrc num-buffers=100 ! 'video/x-raw, format=UYVY, width=1920, height=1080, framerate=60/1' ! nvvidconv ! 'video/x-raw(memory:NVMM), format=NV12' ! nvv4l2h264enc ! 'video/x-h264, stream-format=(string)byte-stream' ! h264parse ! nvv4l2decoder ! filesink location=/tmp/h264.test

Setting pipeline to PAUSED ...
Opening in BLOCKING MODE
Opening in BLOCKING MODE
Pipeline is PREROLLING ...
NvMMLiteOpen : Block : BlockType = 261
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 261
Redistribute latency...
NvMMLiteOpen : Block : BlockType = 4
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
H264: Profile = 66, Level = 0

(gst-launch-1.0:14551): GStreamer-CRITICAL **: 14:11:20.387: gst_mini_object_unref: assertion 'mini_object != NULL' failed
NvMMLiteOpen : Block : BlockType = 261
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 261
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Got EOS from element "pipeline0".
Execution ended after 0:00:01.572443450
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

The omx pipeline actually generates a file and will display a sensible result if the filesink is replaced by nvoverlaysink.
The nvvl2 pipeline does not.

Hi,
Please try

gst-launch-1.0 videotestsrc num-buffers=100 ! 'video/x-raw, format=UYVY, width=1920, height=1080, framerate=60/1' ! nvvidconv ! 'video/x-raw(memory:NVMM), format=NV12' ! nvv4l2h264enc ! 'video/x-h264, stream-format=(string)byte-stream' ! nvv4l2decoder ! nvvidconv ! video/x-raw ! filesink location=/tmp/h264.test