bluenviron / mediamtx

Ready-to-use SRT / WebRTC / RTSP / RTMP / LL-HLS media server and media proxy that allows to read, publish, proxy, record and playback video and audio streams.
MIT License
10.71k stars 1.4k forks source link

Error publishing H265 file: `invalid SPS: ScalingListDataPresentFlag not supported yet` #3290

Closed siddhantwahal closed 1 month ago

siddhantwahal commented 2 months ago

Which version are you using?

v1.8.0

Which operating system are you using?

Describe the issue

Trying to publish an H265 file to the server using ffmpeg produces the following error:

2024/04/25 06:15:56 INF [RTSP] [conn 172.20.0.1:52284] closed: invalid SDP: media 1 is invalid: invalid SPS: ScalingListDataPresentFlag not supported yet

Describe how to replicate the issue

  1. Start the server with default configuration except MTX_PROTCOLS=tcp
  2. Publish the file using ffmpeg:
    ffmpeg -re -stream_loop -1 -i video.mp4 -c:v copy -f rtsp -rtsp_transport tcp rtsp://localhost:8554/stream

We cannot share the video as it contains sensitive data. Here is the video metadata:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42hvc1
    creation_time   : 2023-08-09T12:49:47.000000Z
  Duration: 01:00:07.00, start: 0.000000, bitrate: 3914 kb/s
  Stream #0:0(eng): Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv), 2048x1536, 3868 kb/s, 30 fps, 30 tbr, 90k tbn, 30 tbc (default)
    Metadata:
      creation_time   : 2023-08-09T12:49:47.000000Z
      vendor_id       : [0][0][0][0]

Did you attach the server logs?

Yes, click below:

``` 2024/04/25 06:12:28 INF MediaMTX v1.8.0 2024/04/25 06:12:28 INF configuration loaded from /mediamtx.yml 2024/04/25 06:12:28 DEB path manager created 2024/04/25 06:12:28 INF [RTSP] listener opened on :8554 (TCP), :8000 (UDP/RTP), :8001 (UDP/RTCP) 2024/04/25 06:12:28 INF [RTMP] listener opened on :1935 2024/04/25 06:12:28 INF [HLS] listener opened on :8888 2024/04/25 06:12:28 INF [WebRTC] listener opened on :8889 (HTTP), :8189 (ICE/UDP) 2024/04/25 06:12:28 INF [SRT] listener opened on :8890 (UDP) 2024/04/25 06:12:41 INF [RTSP] [conn 172.20.0.1:59302] opened 2024/04/25 06:12:41 DEB [RTSP] [conn 172.20.0.1:59302] [c->s] OPTIONS rtsp://localhost:8554/stream_1 RTSP/1.0 CSeq: 1 User-Agent: Lavf58.76.100 2024/04/25 06:12:41 DEB [RTSP] [conn 172.20.0.1:59302] [s->c] RTSP/1.0 200 OK CSeq: 1 Public: DESCRIBE, ANNOUNCE, SETUP, PLAY, RECORD, PAUSE, GET_PARAMETER, TEARDOWN Server: gortsplib 2024/04/25 06:12:41 DEB [RTSP] [conn 172.20.0.1:59302] [c->s] ANNOUNCE rtsp://localhost:8554/stream_1 RTSP/1.0 CSeq: 2 Content-Length: 315 Content-Type: application/sdp User-Agent: Lavf58.76.100 v=0 o=- 0 0 IN IP6 ::1 s=No Name c=IN IP6 ::1 t=0 0 a=tool:libavformat 58.76.100 m=video 0 RTP/AVP 96 b=AS:762 a=rtpmap:96 H265/90000 a=fmtp:96 sprop-vps=QAEMAf//AWAAAAMAkAAAAwAAAwCWlZgJ; sprop-sps=QgEBAWAAAAMAkAAAAwAAAwCWoAEAIAYBZZWaSTK5pwgAAAMACAAAAwDwQA==; sprop-pps=RAHBcrRiQA== a=control:streamid=0 2024/04/25 06:12:41 INF [RTSP] [session 00778672] created by 172.20.0.1:59302 2024/04/25 06:12:41 DEB [path stream_1] created 2024/04/25 06:12:41 DEB [RTSP] [conn 172.20.0.1:59302] [s->c] RTSP/1.0 200 OK CSeq: 2 Server: gortsplib 2024/04/25 06:12:41 DEB [RTSP] [conn 172.20.0.1:59302] [c->s] SETUP rtsp://localhost:8554/stream_1/streamid=0 RTSP/1.0 CSeq: 3 Transport: RTP/AVP/TCP;unicast;interleaved=0-1;mode=record User-Agent: Lavf58.76.100 2024/04/25 06:12:41 DEB [RTSP] [conn 172.20.0.1:59302] [s->c] RTSP/1.0 200 OK CSeq: 3 Server: gortsplib Session: be625318cce0462dae214e0c33b674e8 Transport: RTP/AVP/TCP;unicast;interleaved=0-1 2024/04/25 06:12:41 DEB [RTSP] [conn 172.20.0.1:59302] [c->s] RECORD rtsp://localhost:8554/stream_1 RTSP/1.0 CSeq: 4 Range: npt=0.000- Session: be625318cce0462dae214e0c33b674e8 User-Agent: Lavf58.76.100 2024/04/25 06:12:41 INF [RTSP] [session 00778672] is publishing to path 'stream_1', 1 track (H265) 2024/04/25 06:12:41 DEB [RTSP] [conn 172.20.0.1:59302] [s->c] RTSP/1.0 200 OK CSeq: 4 Server: gortsplib Session: be625318cce0462dae214e0c33b674e8 2024/04/25 06:12:46 DEB [RTSP] [conn 172.20.0.1:59302] [c->s] TEARDOWN rtsp://localhost:8554/stream_1 RTSP/1.0 CSeq: 5 Session: be625318cce0462dae214e0c33b674e8 User-Agent: Lavf58.76.100 2024/04/25 06:12:46 INF [RTSP] [session 00778672] destroyed: torn down by 172.20.0.1:59302 2024/04/25 06:12:46 DEB [RTSP] [conn 172.20.0.1:59302] [s->c] RTSP/1.0 200 OK CSeq: 5 Server: gortsplib 2024/04/25 06:12:46 DEB [path stream_1] destroyed: not in use 2024/04/25 06:12:46 INF [RTSP] [conn 172.20.0.1:59302] closed: EOF 2024/04/25 06:12:52 INF [RTSP] [conn 172.20.0.1:33382] opened 2024/04/25 06:12:52 DEB [RTSP] [conn 172.20.0.1:33382] [c->s] OPTIONS rtsp://localhost:8554/stream_1 RTSP/1.0 CSeq: 1 User-Agent: Lavf58.76.100 2024/04/25 06:12:52 DEB [RTSP] [conn 172.20.0.1:33382] [s->c] RTSP/1.0 200 OK CSeq: 1 Public: DESCRIBE, ANNOUNCE, SETUP, PLAY, RECORD, PAUSE, GET_PARAMETER, TEARDOWN Server: gortsplib 2024/04/25 06:12:52 DEB [RTSP] [conn 172.20.0.1:33382] [c->s] ANNOUNCE rtsp://localhost:8554/stream_1 RTSP/1.0 CSeq: 2 Content-Length: 744 Content-Type: application/sdp User-Agent: Lavf58.76.100 v=0 o=- 0 0 IN IP6 ::1 s=No Name c=IN IP6 ::1 t=0 0 a=tool:libavformat 58.76.100 m=video 0 RTP/AVP 96 b=AS:3868 a=rtpmap:96 H265/90000 a=fmtp:96 sprop-vps=QAEMAf//AWAAAAMAkAAAAwAAAwCWLAk=; sprop-sps=QgEBAWAAAAMAkAAAAwAAAwCWoAEAIAYBY0u5CE5RERiOCTAkQN0oUhzBJwYYG7KhkViuFsDxB9CAIIKMFnA1fKUkmTqvS6S7SS8ggREyDBgwaNGAsAgQIMCAD4H8H3yjIjCHGeM+O/CX8MfhD4MPB9/yoRI0Tk8lXJW5KVuaIxMQCAEEEIIQIAEDAggfv/CAQhDCHDHhD4Q/CH8KfhT4Pv/8pSZMnVel0l2kl5BAiJkGDBg0aMBYBAgQYEAHwP4PvlEEiMIcZ4z478Jfwx+EPgw8H3/KiEkaJyeSrkrclK3NEYmIBACCCEEIEACBgQQP3/hCEIQwhwx4Q+EPwh/Cn4U+D7//KUmTJ1XpdJdpJeQQIiZBgwYNGjAWAQIEGBAB8D+D76ISRonJ5KuStyUrc0RiYgEAIIIQQgQAIGBBA/f9PLiagQEBAgAAAwDIAAAXcOALvK4AA+gAAAMB9AAAAwB9AAADAD6ABXCAQQ==; sprop-pps=RAHAcoSJAck= a=control:streamid=0 2024/04/25 06:12:52 INF [RTSP] [session 6d21529b] created by 172.20.0.1:33382 2024/04/25 06:12:52 DEB [RTSP] [conn 172.20.0.1:33382] [s->c] RTSP/1.0 400 Bad Request CSeq: 2 Server: gortsplib 2024/04/25 06:12:52 INF [RTSP] [conn 172.20.0.1:33382] closed: invalid SDP: media 1 is invalid: invalid SPS: ScalingListDataPresentFlag not supported yet 2024/04/25 06:12:52 INF [RTSP] [session 6d21529b] destroyed: not in use 2024/04/25 06:15:51 INF MediaMTX v1.8.0 2024/04/25 06:15:51 INF configuration loaded from /mediamtx.yml 2024/04/25 06:15:51 DEB path manager created 2024/04/25 06:15:51 INF [RTSP] listener opened on :8554 (TCP), :8000 (UDP/RTP), :8001 (UDP/RTCP) 2024/04/25 06:15:51 INF [RTMP] listener opened on :1935 2024/04/25 06:15:51 INF [HLS] listener opened on :8888 2024/04/25 06:15:51 INF [WebRTC] listener opened on :8889 (HTTP), :8189 (ICE/UDP) 2024/04/25 06:15:51 INF [SRT] listener opened on :8890 (UDP) 2024/04/25 06:15:56 INF [RTSP] [conn 172.20.0.1:52284] opened 2024/04/25 06:15:56 DEB [RTSP] [conn 172.20.0.1:52284] [c->s] OPTIONS rtsp://localhost:8554/stream_1 RTSP/1.0 CSeq: 1 User-Agent: Lavf58.76.100 2024/04/25 06:15:56 DEB [RTSP] [conn 172.20.0.1:52284] [s->c] RTSP/1.0 200 OK CSeq: 1 Public: DESCRIBE, ANNOUNCE, SETUP, PLAY, RECORD, PAUSE, GET_PARAMETER, TEARDOWN Server: gortsplib 2024/04/25 06:15:56 DEB [RTSP] [conn 172.20.0.1:52284] [c->s] ANNOUNCE rtsp://localhost:8554/stream_1 RTSP/1.0 CSeq: 2 Content-Length: 744 Content-Type: application/sdp User-Agent: Lavf58.76.100 v=0 o=- 0 0 IN IP6 ::1 s=No Name c=IN IP6 ::1 t=0 0 a=tool:libavformat 58.76.100 m=video 0 RTP/AVP 96 b=AS:3868 a=rtpmap:96 H265/90000 a=fmtp:96 sprop-vps=QAEMAf//AWAAAAMAkAAAAwAAAwCWLAk=; sprop-sps=QgEBAWAAAAMAkAAAAwAAAwCWoAEAIAYBY0u5CE5RERiOCTAkQN0oUhzBJwYYG7KhkViuFsDxB9CAIIKMFnA1fKUkmTqvS6S7SS8ggREyDBgwaNGAsAgQIMCAD4H8H3yjIjCHGeM+O/CX8MfhD4MPB9/yoRI0Tk8lXJW5KVuaIxMQCAEEEIIQIAEDAggfv/CAQhDCHDHhD4Q/CH8KfhT4Pv/8pSZMnVel0l2kl5BAiJkGDBg0aMBYBAgQYEAHwP4PvlEEiMIcZ4z478Jfwx+EPgw8H3/KiEkaJyeSrkrclK3NEYmIBACCCEEIEACBgQQP3/hCEIQwhwx4Q+EPwh/Cn4U+D7//KUmTJ1XpdJdpJeQQIiZBgwYNGjAWAQIEGBAB8D+D76ISRonJ5KuStyUrc0RiYgEAIIIQQgQAIGBBA/f9PLiagQEBAgAAAwDIAAAXcOALvK4AA+gAAAMB9AAAAwB9AAADAD6ABXCAQQ==; sprop-pps=RAHAcoSJAck= a=control:streamid=0 2024/04/25 06:15:56 INF [RTSP] [session 97dd3c34] created by 172.20.0.1:52284 2024/04/25 06:15:56 DEB [RTSP] [conn 172.20.0.1:52284] [s->c] RTSP/1.0 400 Bad Request CSeq: 2 Server: gortsplib 2024/04/25 06:15:56 INF [RTSP] [session 97dd3c34] destroyed: not in use 2024/04/25 06:15:56 INF [RTSP] [conn 172.20.0.1:52284] closed: invalid SDP: media 1 is invalid: invalid SPS: ScalingListDataPresentFlag not supported yet ```

Did you attach a network dump?

no

Please let us know if the server logs are sufficient for you to debug this issue. If not, we could try to manufacture an artificial video.

nbubis commented 1 month ago

Did you resolve this issue? Please share the solution or workaround if you have found one.

aler9 commented 1 month ago

Thanks for reporting the issue and attaching the server log as instructed, this is fixed by https://github.com/bluenviron/mediacommon/pull/135