Jetson AGX Thor: `nvv4l2h264enc` outputs incorrect PTS/DTS with B-frames

Disclosure: This report was drafted with AI assistance (ChatGPT). The reproduction commands and reported behavior were tested and verified on actual hardware.

Environment

  • Jetson AGX Thor Developer Kit

  • Jetson Linux R38.2.0

  • GStreamer 1.24.2

  • NVIDIA nvvideo4linux2 plugin 1.14.0

Issue

With num-B-Frames=2, nvv4l2h264enc produces actual B-coded H.264 pictures but assigns identical, monotonically increasing PTS and DTS to every output buffer, despite picture reordering.

This results in incorrect MP4 presentation timestamps and breaks frame-accurate seeking.

Reproduction

gst-launch-1.0 -e -q \
  videotestsrc num-buffers=18 pattern=ball ! \
  'video/x-raw,format=I420,width=320,height=180,framerate=25/1' ! \
  nvvidconv ! 'video/x-raw(memory:NVMM),format=NV12' ! \
  nvv4l2h264enc profile=2 num-B-Frames=2 \
    num-Ref-Frames=2 iframeinterval=8 idrinterval=8 ! \
  h264parse ! qtmux ! filesink location=/tmp/test.mp4

ffprobe -v error -select_streams v:0 \
  -show_entries packet=pts_time,dts_time \
  -of csv=p=0 /tmp/test.mp4

ffprobe -v error -select_streams v:0 \
  -show_entries frame=pict_type \
  -of csv=p=0 /tmp/test.mp4

Actual result: Every packet has PTS=DTS (0.000/0.000, 0.040/0.040, etc.), although the stream contains 8 B-coded pictures out of 18.

Expected result: Presentation timestamps reflect the correct picture display order, while DTS reflects decoding order.

Additional findings

  • Incorrect timestamps are observable directly after nvv4l2h264enc, before h264parse.

  • Main/High profiles avoid the default Baseline+B-frame EOS hang but do not correct the timestamps.

  • nvh264enc on the same Thor device produces correctly reordered timestamps and passes independent MP4 decoding and seeking tests.

Question: Is this a known V4L2 encoder issue on Thor R38.2.0? Is a driver or plugin fix available?

Hi,
There is a known issue on r38.2:
Copy timestamps broken jetson thor encoder - #3 by DaneLLL

Please upgrade to Jetpack 7.2.1 r39.2.1 and try.