NVIDIA Jetson AGX Thor - H.265 (HEVC) GStreamer Pipelines

From RidgeRun Developer Wiki

Follow Us On Twitter LinkedIn Email Share this page





Previous: GStreamer_Pipelines/H264 Index Next: Holoscan









GStreamer Pipelines using H.265 (HEVC)

This section presents GStreamer pipelines to demonstrate H.265 encoding and decoding on Jetson AGX Thor. The examples progress from raw video playback and software encoding to full camera capture pipelines with hardware acceleration. Performance metrics are provided for each case, tested under multiple power modes.


Note
Tested System: All pipelines were validated on the Jetson AGX Thor Developer Kit using JetPack 7.0 (Jetson Linux 38.2 / Ubuntu 24.04).


For benchmarking methodology, see GStreamer Pipelines Overview.

H.265 Encoding

H.265/HEVC provides significantly better compression than H.264 at similar quality, which is useful for higher resolutions and constrained bandwidth. Jetson AGX Thor supports HEVC encoding via NVIDIA hardware encoders as well as a CPU-based encoder.

Available Encoders

Table 1: H.265 Encoders Comparison
Feature nvv4l2h265enc nvautogpuh265enc nvcudah265enc nvh265enc x265enc (CPU)
Backend V4L2 (NVIDIA) NVCODEC auto GPU NVCODEC CUDA NVENC API x265
GPU Support yes yes yes yes no
Input Memory NVMM CUDA, GLMemory CUDA CUDA System
Input Formats NV12, I420, Y444, P010_10LE, NV24 NV12, Y444 NV12, Y444 NV12, YV12, RGBA I420, YUV420
Output Format HEVC byte-stream (AU/NAL) HEVC (avc/byte-stream) HEVC (avc/byte-stream) HEVC byte-stream HEVC byte-stream
B-frames 0-2 0-4 0-4 0-4 full support
Notes Lowest-latency NVMM path Auto GPU selection Manual GPU selection Often bound to GPU0 Higher CPU load

Raw Video Encoding

This section demonstrates encoding synthetic video (no camera). Useful for validating encoder behavior and measuring baseline CPU/GPU load.

FILE=/tmp/test_hevc.mp4
WIDTH=1920
HEIGHT=1080
FRAMERATE=30/1

With x265enc (CPU)

gst-launch-1.0 videotestsrc is-live=true ! \
  video/x-raw,width=$WIDTH,height=$HEIGHT,framerate=$FRAMERATE ! \
  x265enc tune=zerolatency ! h265parse ! qtmux ! filesink location=$FILE -e

With nvv4l2h265enc

gst-launch-1.0 videotestsrc is-live=true ! \
  video/x-raw,width=$WIDTH,height=$HEIGHT,framerate=$FRAMERATE ! \
  nvvidconv ! "video/x-raw(memory:NVMM)" ! \
  nvv4l2h265enc ! h265parse ! qtmux ! filesink location=$FILE -e

With nvautogpuh265enc

gst-launch-1.0 videotestsrc is-live=true ! \
  video/x-raw,width=$WIDTH,height=$HEIGHT,framerate=$FRAMERATE ! \
  nvautogpuh265enc ! h265parse ! qtmux ! filesink location=$FILE -e

With nvh265enc

gst-launch-1.0 videotestsrc is-live=true ! \
  video/x-raw,width=$WIDTH,height=$HEIGHT,framerate=$FRAMERATE ! \
  nvh265enc ! h265parse ! qtmux ! filesink location=$FILE -e

Camera Encoding Pipelines

MIPI CSI Camera (IMX676)

WIDTH=3552
HEIGHT=3556
FRAMERATE=64/1
FORMAT=NV12
FILE=/tmp/csi_hevc.mp4

With x265enc (CPU)

gst-launch-1.0 nvarguscamerasrc ! \
  video/x-raw,width=$WIDTH,height=$HEIGHT,framerate=$FRAMERATE ! \
  x265enc tune=zerolatency ! h265parse ! qtmux ! filesink location=$FILE -e

With nvv4l2h265enc (HW, NVMM path)

gst-launch-1.0 nvarguscamerasrc ! \
  video/x-raw(memory:NVMM),width=$WIDTH,height=$HEIGHT,framerate=$FRAMERATE ! \
  nvv4l2h265enc ! h265parse ! qtmux ! filesink location=$FILE -e

With nvautogpuh265enc (HW, NVCODEC auto-GPU)

gst-launch-1.0 nvarguscamerasrc ! \
  video/x-raw,width=$WIDTH,height=$HEIGHT,framerate=$FRAMERATE ! \
  nvautogpuh265enc ! h265parse ! qtmux ! filesink location=$FILE -e

With nvh265enc (HW, NVENC)

gst-launch-1.0 nvarguscamerasrc ! \
  video/x-raw,width=$WIDTH,height=$HEIGHT,framerate=$FRAMERATE ! \
  nvh265enc ! h265parse ! qtmux ! filesink location=$FILE -e

USB Camera

WIDTH=3840
HEIGHT=2160
FRAMERATE=30/1
FILE=/tmp/usb_hevc.mp4

With x265enc (CPU)

gst-launch-1.0 v4l2src device=/dev/video2 ! \
  video/x-raw,width=$WIDTH,height=$HEIGHT,framerate=$FRAMERATE ! \
  x265enc tune=zerolatency ! h265parse ! qtmux ! filesink location=$FILE -e

With nvv4l2h265enc (HW, NVMM path)

gst-launch-1.0 v4l2src device=/dev/video2 ! \
  video/x-raw,width=$WIDTH,height=$HEIGHT,framerate=$FRAMERATE ! \
  nvvidconv ! "video/x-raw(memory:NVMM)" ! \
  nvv4l2h265enc ! h265parse ! qtmux ! filesink location=$FILE -e

With nvautogpuh265enc (HW, NVCODEC auto-GPU)

gst-launch-1.0 v4l2src device=/dev/video2 ! \
  video/x-raw,width=$WIDTH,height=$HEIGHT,framerate=$FRAMERATE ! \
  nvautogpuh265enc ! h265parse ! qtmux ! filesink location=$FILE -e

With nvh265enc (HW, NVENC)

gst-launch-1.0 v4l2src device=/dev/video2 ! \
  video/x-raw,width=$WIDTH,height=$HEIGHT,framerate=$FRAMERATE ! \
  nvh265enc ! h265parse ! qtmux ! filesink location=$FILE -e

Camera over Ethernet (CoE)

Coming soon...

Encoding Performance

Table 2: HEVC Encoding Benchmark (1920x1080@30) — with encoder hardware utilization
Encoder Backend Hardware Block Mode CPU (%) GPU 3D (%) NVENC0 (%) NVENC1 (%) FPS Latency (ms)
x265enc x265 CPU Default 22.43 3.56 264.52
x265enc x265 CPU Max Perf 22.87 7.23 131.31
nvv4l2h265enc V4L2 (NVIDIA) NVENC (HW) Default 4.51 0.66 TBD TBD 30.25 6.02
nvv4l2h265enc V4L2 (NVIDIA) NVENC (HW) Max Perf 2.11 0.67 TBD TBD 30.24 4.08
nvautogpuh265enc NVCodec (auto) NVENC (HW) Default 4.52 2.75 TBD TBD 30.24 5.84
nvautogpuh265enc NVCodec (auto) NVENC (HW) Max Perf 2.12 0.67 TBD TBD 30.24 4.04
nvh265enc NVENC API NVENC (HW) Default 4.48 0.88 TBD TBD 30.06 4.32
nvh265enc NVENC API NVENC (HW) Max Perf 1.91 0.31 TBD TBD 30.05 3.24


Note
Tip: Use tegrastats to observe NVENC/NVDEC utilization on Jetson. GPU 3D (%) is typically low for pure encode/decode unless CUDA-based processing is in the pipeline.


H.265 Decoding

Decoders Available

Table 3: H.265 Decoders Comparison
Decoder Backend Hardware Accel
nvv4l2decoder V4L2 (NVIDIA) Yes
nvh265dec NVCodec Yes
avdec_h265 libav No (CPU-based)

Playback Pipelines

You may use these pipelines to decode the videos recorded with any of the encoding methods above.

Hardware Decode with nv3dsink

gst-launch-1.0 filesrc location=/tmp/filename.mp4 ! qtdemux ! h265parse ! nvv4l2decoder ! nv3dsink

NVCodec Hardware Decode

gst-launch-1.0 filesrc location=/tmp/filename.mp4 ! qtdemux ! h265parse ! nvh265dec ! videoconvert ! autovideosink

Software Decode with xvimagesink (CPU)

gst-launch-1.0 filesrc location=/tmp/filename.mp4 ! qtdemux ! h265parse ! avdec_h265 ! videoconvert ! xvimagesink

Decoding Performance

Table 4: HEVC Decoding Benchmark (1920x1080@30) — with decoder hardware utilization
Decoder Backend Hardware Block Mode CPU (%) GPU 3D (%) NVDEC0 (%) NVDEC1 (%) FPS Latency (ms)
avdec_h265 libav CPU Default
avdec_h265 libav CPU Max Perf
nvv4l2decoder V4L2 (NVIDIA) NVDEC (HW) Default TBD TBD
nvv4l2decoder V4L2 (NVIDIA) NVDEC (HW) Max Perf TBD TBD
nvh265dec NVCodec NVDEC (HW) Default TBD TBD
nvh265dec NVCodec NVDEC (HW) Max Perf TBD TBD

H.265 Transcoding

Transcoding (decode → process → re-encode) is common when changing bitrate, codec profile, GOP structure, or when inserting analytics/watermarking. Below are representative decode+encode pipelines for Jetson AGX Thor.

Pipelines

The following pipelines demonstrate decoding and encoding using various decoder and encoder elements available on Jetson AGX Thor. All pipelines assume the source is a H.265-encoded MP4 file.

Set up common variables:

FILE=/tmp/filename.mp4
OUTFILE=/tmp/reencoded_hevc.mp4

nvv4l2decoder + nvv4l2h265enc

gst-launch-1.0 filesrc location=$FILE ! qtdemux ! h265parse ! nvv4l2decoder ! \
  nvvidconv ! "video/x-raw(memory:NVMM)" ! nvv4l2h265enc ! h265parse ! qtmux ! \
  filesink location=$OUTFILE -e

nvv4l2decoder + nvh265enc

gst-launch-1.0 filesrc location=$FILE ! qtdemux ! h265parse ! nvv4l2decoder ! \
  nvvidconv ! video/x-raw ! nvh265enc ! h265parse ! qtmux ! filesink location=$OUTFILE -e

nvh265dec + nvh265enc

gst-launch-1.0 filesrc location=$FILE ! qtdemux ! h265parse ! nvh265dec ! \
  nvh265enc ! h265parse ! qtmux ! filesink location=$OUTFILE -e

avdec_h265 + x265enc (CPU-only)

gst-launch-1.0 filesrc location=$FILE ! qtdemux ! h265parse ! avdec_h265 ! \
  videoconvert ! x265enc ! h265parse ! qtmux ! filesink location=$OUTFILE -e

Plugin Reference Links



Previous: GStreamer_Pipelines/H264 Index Next: Holoscan