Skip to content

SRT publish with KLV does not have valid KLV on RTSP pulls #5612

@dbussert

Description

@dbussert

Which version are you using?

d5d1de0

Which operating system are you using?

Linux amd64 standard

Describe the issue

When MPEG-TS SRT with KLV is published, that KLV is available in SRT reads, but RTSP pulls do not have valid KLV. ffmpeg does not recognize the stream as KLV.

Input #0, rtsp, from 'rtsp://127.0.0.1:554/test':
  Metadata:
    title           :
  Duration: N/A, start: 0.025733, bitrate: N/A
  Stream #0:0: Video: hevc (Main), yuv420p(tv), 1920x1080, 29.97 tbr, 90k tbn, 90k tbc
  Stream #0:1: Data: none

Describe how to replicate the issue

  1. Use a source that has KLV
Input #0, mpegts, from '<mpegts source>':
  Duration: N/A, start: 6240.863889, bitrate: N/A
  Program 1
  Stream #0:0[0x41]: Video: hevc (Main) ([36][0][0][0] / 0x0024), yuv420p(tv), 1920x1080, 30 fps, 30 tbr, 90k tbn
  Stream #0:1[0x42]: Data: klv (KLVA / 0x41564C4B)
  1. Publish a SRT stream with KLV ffmpeg -i <mpegts source> -c copy -map 0 -f mpegts "srt://<ip>:8890?streamid=publish:test&pkt_size=1316"
  2. Confirm SRT stream from MediaMTX has KLV ffprobe "srt://<ip>:8890?streamid=read:test"
Input #0, mpegts, from 'srt://127.0.0.1:8890?streamid=read:test':
  Duration: N/A, start: 31.159833, bitrate: N/A
  Program 1
  Stream #0:0[0x100]: Video: hevc (Main) ([36][0][0][0] / 0x0024), yuv420p(tv), 1920x1080, 29.97 tbr, 90k tbn, 90k tbc
  Stream #0:1[0x101]: Data: klv (KLVA / 0x41564C4B)
Unsupported codec with id 100356 for input stream 1
  1. Observe RTSP does not have valid KLV
Input #0, rtsp, from 'rtsp://127.0.0.1:554/test':
  Metadata:
    title           :
  Duration: N/A, start: 0.025733, bitrate: N/A
  Stream #0:0: Video: hevc (Main), yuv420p(tv), 1920x1080, 29.97 tbr, 90k tbn, 90k tbc
  Stream #0:1: Data: none
Unsupported codec with id 0 for input stream 1

MediaMTX configuration

MediaMTX logs

Publish SRT

2026/03/25 15:07:48 INF [SRT] [conn 10.0.0.3:64092] opened
2026/03/25 15:07:48 INF [path test] stream is available and online, 2 tracks (H265, KLV)
2026/03/25 15:07:48 INF [SRT] [conn 10.0.0.3:64092] is publishing to path 'test'

Read SRT

2026/03/25 15:09:57 INF [SRT] [conn 127.0.0.1:52487] opened
2026/03/25 15:09:57 INF [SRT] [conn 127.0.0.1:52487] is reading from path 'test', 2 tracks (H265, KLV)
2026/03/25 15:10:02 INF [SRT] [conn 127.0.0.1:52487] closed: EOF

Read RTSP

2026/03/25 15:09:17 INF [RTSP] [session 01953d59] created by 127.0.0.1:41734
2026/03/25 15:09:17 INF [RTSP] [session 01953d59] is reading from path 'test', with TCP, 2 tracks (H265, KLV)
2026/03/25 15:09:18 INF [RTSP] [session 01953d59] destroyed: torn down by 127.0.0.1:41734

Packet dump

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions