Hardware accelerated encoding on Xavier NX

Hello there!
What am I supposed to use for hardware acceleration of h264/h265 encoding under Jetson Xavier NX ?

An official FFmpeg build seems to have lack of hardware acceleration support. It’s h264_v4l2m2m implementation seems to not working properly either. And “h264_nvmpi” isn’t available there.

Can somebody guide me where to find a proper solution for the case, please?

Hello @pavel.tuchkov,

Hardware acceleration can be done with GStreamer plugins such as:

  • H264 : nvv4l2h264enc, omxh264enc
  • H265 : nvv4l2h265enc, omxh265enc

Notice the omx plugins are legacy, therefore it is recommended to use the nvv4l2 plugins.

Regards,

Fabian
www.ridgerun.com

Thank you for the feedback, Fabian.
I’ve managed to launch it with both nvv4l2h264enc and omxh264enc.
My current concern is in hardware accelerated decoding, as it seems that only omxh264dec is working.

I’ve managed to launch it like in the example below
gst-launch-1.0 -v souphttpsrc location=“http://hostname/streamname/mpegts” is-live=true ! tsdemux name=demux ! queue ! h264parse ! omxh264dec ! nvv4l2h264enc bitrate=4000000 ! h264parse ! flvmux name=mux ! rtmpsink location=‘rtmp://hostname:1935/static/streamname live=1’

Hi Pavel,

For hardware accelerated decoding, you can refer to the following sample pipelines:

  1. H264 decoding OMX :

    FILE=filename.mp4
    gst-launch-1.0 filesrc location=$FILE ! qtdemux ! queue ! h264parse ! omxh264dec ! nvoverlaysink

  2. H264 decoding V4L2 :

    FILE=filename.mp4
    gst-launch-1.0 filesrc location=$FILE ! qtdemux ! queue ! h264parse ! nvv4l2decoder ! nvoverlaysink

  3. H265 decoding OMX:

    FILE=filename.mp4
    gst-launch-1.0 filesrc location=$FILE ! qtdemux ! queue ! h265parse ! omxh265dec ! nvoverlaysink

  4. H265 decoding V4L2:

    FILE=filename.mp4
    gst-launch-1.0 filesrc location=$FILE ! qtdemux ! queue ! h265parse ! nvv4l2decoder ! nvoverlaysink

For more detailed information visit the following links:

I hope this information is useful to you.

Best regards,
-Daniel