Skip to content

[v1.16.3] RTSP source with extra Data (Generic) track rejected when alwaysAvailableTracks is set #5556

@ranggakd

Description

@ranggakd

Which version are you using?

v1.16.3

Which operating system are you using?

Linux amd64 standard

Describe the issue

Environment

  • MediaMTX: v1.16.3
  • OS: Ubuntu 20.04
  • Source camera RTSP includes: H265 + G711(alaw) + Data(Generic)

Actual behavior

MediaMTX logs:

ERR [path atm-proxy] [RTSP source] wants to publish [H265 G711 Generic], but stream expects [H265 G711]
(and same for other similar cameras)

Expected behavior

When alwaysAvailableTracks lists required media tracks (video/audio), source should still be accepted if it has an additional Generic/Data track, or there should be an option to ignore extra tracks.

Workaround

Removing alwaysAvailableTracks and alwaysAvailable avoids the rejection, but we need alwaysAvailable behavior with declared tracks.

Question

Is strict exact track equality intended here?
If yes, can we get an option like ignoreExtraTracks: true (or wildcard for Generic/Data) in a future version?

Miscellaneous

Path Probing

Probe the path

ffprobe rtsp://localhost:8554/atm-proxy

Giving this result

ffprobe version 4.2.7-0ubuntu0.1 Copyright (c) 2007-2022 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
  configuration: --prefix=/usr --extra-version=0ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
[rtsp @ 0x55bc4918e980] method SETUP failed: 461 Unsupported Transport
Input #0, rtsp, from 'rtsp://localhost:8554/atm-proxy':
  Metadata:
    title           :  
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: hevc (Main), yuv420p(tv), 1920x1080 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 90k tbn, 30 tbc
    Stream #0:1: Audio: pcm_alaw, 8000 Hz, 1 channels, s16, 64 kb/s

Original Source Probing

Probe the original source

ffprobe "rtsp://admin:***@192.168.1.108:554/profile2"

Giving this result

ffprobe version 4.2.7-0ubuntu0.1 Copyright (c) 2007-2022 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
  configuration: --prefix=/usr --extra-version=0ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, rtsp, from 'rtsp://admin:Admin123%23@192.168.1.108:554/profile2':
  Metadata:
    title           : profile2
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: hevc (Main), yuv420p(tv, GBR), 704x576, 10 fps, 25 tbr, 90k tbn, 15 tbc
    Stream #0:1: Audio: pcm_alaw, 8000 Hz, 1 channels, s16, 64 kb/s
    Stream #0:2: Data: none
Unsupported codec with id 0 for input stream 2

Describe how to replicate the issue

Steps to reproduce

  1. Run MediaMTX with config below.

  2. Confirm source stream tracks:

    ffprobe "rtsp://admin:***@192.168.1.108:554/profile2"

    Output shows:
    Stream #0:0 Video: hevc
    Stream #0:1 Audio: pcm_alaw
    Stream #0:2 Data: none (Generic track)

  3. Observe MediaMTX logs.

MediaMTX configuration

paths:
  atm-proxy:
    source: "rtsp://admin:***@192.168.1.108:554/profile2"
    rtspTransport: tcp
    alwaysAvailable: true
    alwaysAvailableTracks:
      - codec: H265
      - codec: G711
        sampleRate: 8000
        channelCount: 1
        muLaw: false

MediaMTX logs

2|media-server | 2026/03/09 13:39:09 ERR [path atm-proxy] [RTSP source] wants to publish [H265 G711 Generic], but stream expects [H265 G711]

Packet dump

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions