#6257·mediamtx

H.265 RTSP stream fails on standalone PREFIX_SEI access units (Tapo C260)

Author: schimschewskiCreated Sep 22, 2026Updated Oct 1, 2026
Labelsbugrtsp

Which version are you using?

v1.21.1

Which operating system are you using?

Windows amd64 standard

Describe the issue

MediaMTX v1.21.1 on Windows amd64 repeatedly fails to record the H.265 RTSP main stream (/stream1) from a TP-Link Tapo C260:

access unit doesn't contain an IDR or non-IDR NALU

The packet capture contains 264 separate PREFIX_SEI-only units (H.265 NAL type 39). Each SEI packet has its RTP marker bit set and uses the same timestamp as the preceding completed unit.

For example, in PCAP frame 36:

RTP seq 8513: timestamp 0, M=1, final fragment of an IDR picture
RTP seq 8514: timestamp 0, M=1, PREFIX_SEI only
RTP seq 8515: timestamp 0, M=1, PREFIX_SEI only

Video RTP sequence numbers are continuous throughout the complete captured portion. The log contains 13 recorder errors, each in the same second as the first SEI-only unit following an IDR picture.

This suggests that marker-delimited units containing only SEI metadata reach picture/DTS processing. I would expect the recorder to handle this camera metadata without repeatedly failing.

Describe how to replicate the issue

  1. Use a TP-Link Tapo C260 with H.265 enabled for its main stream.
  2. Configure rtsp://USER:PASSWORD@CAMERA_IP:554/stream1 as a MediaMTX source using RTSP over TCP.
  3. Enable recording.
  4. Enable logLevel: debug and dumpPackets: true.
  5. Start MediaMTX and let it run for approximately 30 seconds.

The recorder repeatedly reports:

access unit doesn't contain an IDR or non-IDR NALU

MediaMTX configuration

yaml
paths:
  cam-portable:
    source: rtsp://***:***@CAMERA_IP:554/stream1
    sourceOnDemand: no
    rtspTransport: tcp
    record: yes
    recordPath: D:/temp/%path/%Y-%m-%d/%Y-%m-%d_%H-%M-%S-%f
    recordFormat: fmp4
    recordPartDuration: 1s
    recordSegmentDuration: 60m
    recordDeleteAfter: 7d

MediaMTX logs

see below

Packet dump

Attached: debug_mediamtx_tapo_c260.zip

Contains:

  • mediamtx.pcapng — approximately 26 seconds of RTSP/TCP traffic from the failing H.265 session.
  • mediamtx.log — MediaMTX debug log.
  • tapo-c260-sample.h265 — a separate raw H.265 sample.
  • tapo-c260-trace_headers.txt — a separate FFmpeg 6.0 trace.

RTSP Authorization values in the capture were redacted without changing packet lengths, and the affected TCP checksums were updated. RTP/RTCP data is unchanged.

debug_mediamtx_tapo_c260.zip