Neither omxh264enc nor nvv4l2h264enc are available to gstreamer on Jetson TX2

Hi,

I am trying to make use of the built-in H.264 encoder in my Jetson TX2. I followed the Accelerated Gstreamer User Guide (Release 32.1), which however was unsuccessful. I also tried release 31.1 of that guide.

The guide suggests I should check my gstreamer version, which is

$ gst-inspect-1.0 --version
gst-inspect-1.0 version 1.14.5
GStreamer 1.14.5
https://launchpad.net/distros/ubuntu/+source/gstreamer1.0

The proposed encoding commands do not work. For example:

$ gst-launch-1.0 videotestsrc ! 'video/x-raw, format=(string)I420, width=(int)640, height=(int)480' ! omxh264enc ! 'video/x-h264, stream-format=(string)byte-stream' ! h264parse ! qtmux ! filesink location=test.mp4 -e
WARNING: erroneous pipeline: no element "omxh264enc"

Same with nvv4l2h264enc instead of omxh264enc.

Grepping for omx brought me another codec:

$ gst-inspect-1.0 | grep omx
libav:  avenc_h264_omx: libav OpenMAX IL H.264 video encoder encoder

But using avenc_h264_omx brought me another error:

$ gst-launch-1.0 videotestsrc ! 'video/x-raw, format=(string)I420, width=(int)640, height=(int)480' ! avenc_h264_omx ! 'video/x-h264, stream-format=(string)byte-stream' ! h264parse ! qtmux ! filesink location=test.mp4 -e
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

I am aware of a similar forum thread that proposes to install gst-omx, which however is not available for my Ubuntu 18.04 installation and also seems outdated. Nevertheless, I took the code from https://gitlab.freedesktop.org/gstreamer/gst-omx, checked out version 1.14, built an own DEB-packet from it and installed it. Still, this did not help.

To provide more information to you, here are the gstreamer packages that I have installed:

$ apt search gstreamer1.0 | grep nstalled

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

gstreamer1.0-alsa/bionic-updates,now 1.14.5-0ubuntu1~18.04.1 arm64 [installed]
gstreamer1.0-clutter-3.0/bionic,now 3.0.26-1 arm64 [installed,automatic]
gstreamer1.0-gl/bionic-updates,now 1.14.5-0ubuntu1~18.04.1 arm64 [installed,automatic]
gstreamer1.0-gtk3/bionic-updates,now 1.14.5-0ubuntu1~18.04.1 arm64 [installed,automatic]
gstreamer1.0-libav/bionic-updates,now 1.14.5-0ubuntu1~18.04.1 arm64 [installed]
gstreamer1.0-omx-bellagio-config/bionic,now 1.12.4-1 arm64 [installed]
gstreamer1.0-omx-generic/bionic,now 1.12.4-1 arm64 [installed]
gstreamer1.0-omx-generic-config/bionic,now 1.12.4-1 arm64 [installed]
gstreamer1.0-packagekit/bionic-updates,now 1.1.9-1ubuntu2.18.04.5 arm64 [installed]
gstreamer1.0-plugins-bad/bionic-updates,now 1.14.5-0ubuntu1~18.04.1 arm64 [installed]
gstreamer1.0-plugins-base/bionic-updates,now 1.14.5-0ubuntu1~18.04.1 arm64 [installed]
gstreamer1.0-plugins-base-apps/bionic-updates,now 1.14.5-0ubuntu1~18.04.1 arm64 [installed,automatic]
gstreamer1.0-plugins-good/bionic-updates,now 1.14.5-0ubuntu1~18.04.1 arm64 [installed]
gstreamer1.0-plugins-ugly/bionic-updates,now 1.14.5-0ubuntu1~18.04.1 arm64 [installed]
gstreamer1.0-pulseaudio/bionic-updates,now 1.14.5-0ubuntu1~18.04.1 arm64 [installed,automatic]
gstreamer1.0-tools/bionic-updates,now 1.14.5-0ubuntu1~18.04.1 arm64 [installed]
gstreamer1.0-x/bionic-updates,now 1.14.5-0ubuntu1~18.04.1 arm64 [installed,automatic]
libgstreamer1.0-0/bionic-updates,now 1.14.5-0ubuntu1~18.04.1 arm64 [installed,automatic]
libgstreamer1.0-dev/bionic-updates,now 1.14.5-0ubuntu1~18.04.1 arm64 [installed]

I also attached my nvidia-bug-report-tegra.log.

So what is the correct way of using Jetson TX2’s H.264 hardware encoder?
nvidia-bug-report-tegra.log (779 KB)

Is there really no-one who managed to make use of the H.264 hardware encoder on the Jetson TX2? It’s an advertised feature after all.