Opened 3 years ago

Closed 8 weeks ago

Last modified 8 weeks ago

#10539 closed defect (fixed)

SRT listen on IPv6 fails

Reported by: Sesse Owned by: Romain Beauxis <romain.beauxis@gmail.com>
Priority: normal Component: avformat
Version: git-master Keywords: libsrt
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

How to reproduce:

% ./ffmpeg -i 'srt://[::]:9710?mode=listener' foo.mp4
ffmpeg version N-111830-gc48ec95ba3 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 13 (Debian 13.2.0-1)
  configuration: --enable-libsrt
  libavutil      58. 17.100 / 58. 17.100
  libavcodec     60. 23.100 / 60. 23.100
  libavformat    60. 10.101 / 60. 10.101
  libavdevice    60.  2.101 / 60.  2.101
  libavfilter     9. 11.100 /  9. 11.100
  libswscale      7.  3.100 /  7.  3.100
  libswresample   4. 11.100 /  4. 11.100
[srt @ 0x557d57e23600] Operation not supported: Bad parameters
[in#0 @ 0x557d57e22cc0] Error opening input: Unknown error occurred
Error opening input file srt://[::]:9710?mode=listener.
Error opening input files: Unknown error occurred

It seems this broke with libsrt 1.5.0, cf.: https://github.com/Haivision/srt/issues/2764

Seemingly FFmpeg needs to add a setsockopt call to SRTO_IPV6ONLY (preferably to zero, so that one can listen on IPv4+IPv6), or listening is forever restricted to legacy IP.

Change History (3)

comment:1 by Erik Tews, 4 months ago

I can confirm the bug, but there is a workaround. When you specify a specific IP address, then it works.

./ffmpeg -i 'srt://[::1]:9710?mode=listener' foo.mp4

However in this example it will listen only on the loopback interface.

comment:2 by Romain Beauxis <romain.beauxis@gmail.com>, 8 weeks ago

Owner: set to Romain Beauxis <romain.beauxis@gmail.com>
Resolution: fixed
Status: newclosed

In bce8d61d/ffmpeg:

avformat/libsrt: fix ipv6 wildcard listener

For now it fails on srt://[::]:1234?mode=listener

This modification makes it accept a new option "ipv6only"

Reference:
https://github.com/Haivision/srt/pull/2608
https://github.com/Haivision/srt/blob/master/docs/API/API-socket-options.md#SRTO_IPV6ONLY

fix #10539

Note: See TracTickets for help on using tickets.