Opened 4 years ago

Closed 4 years ago

#7459 closed defect (fixed)

Source Specific Multicast not working on OSX

Reported by: Jose Santiago Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: udp osx
Cc: Marton Balint Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


Summary of the bug:

Source specific multicast input works on Linux and Windows, but not on OSX.

I have two hosts streaming an MPEG2 transport stream to the same multicast IP address and port. In my test setup the IP address of the sources are and they are both streaming to I can tune into the desired stream by selecting the sources as follows:

ffplay 'udp://@'

This works on Linux and Windows but does not work on OSX with the following error:

setsockopt(MCAST_JOIN_SOURCE_GROUP): Can't assign requested address udp://@ Input/output error

NOTE: SSM does work correctly on VLC on OSX. The VLC syntax is slightly different:

/Applications/ 'udp://'

Change History (7)

comment:1 by Carl Eugen Hoyos, 4 years ago

Keywords: udp osx added; ssm source specific multicast removed

Please test ffmpeg and provide the command line including the complete, uncut console output to make this a valid ticket, don't forget to test current FFmpeg git head.

comment:2 by Marton Balint, 4 years ago

Cc: Marton Balint added

Also try my patchset which changes the way multicast IPv4 source groups are subscribed to:

comment:3 by Jose Santiago, 4 years ago

@cehoyos FFMPEG terminates quickly with an error. Output from FFMPEG is as follows:

bash-3.2$ uname -a
Darwin Joses-Mac-mini.local 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64

bash-3.2$ /mnt/jlsws4/dev/ort/master/build/mj64-osxcross-m64/stage/ffmpeg/bin/ffmpeg -i 'udp://@' -codec copy -f null /dev/null 2>&1 | tee /mnt/share/open/osxtt.log
ffmpeg version N-92078-g179ed2d2e0 Copyright (c) 2000-2018 the FFmpeg developers
  built with clang version 5.0.1 (tags/RELEASE_501/final)
  configuration: --extra-version=VF --prefix=/mnt/jlsws4/dev/ort/master/build/mj64-osxcross-m64/stage/ffmpeg --enable-cross-compile --cross-prefix=x86_64-apple-darwin- --cc=/mnt/jlsws4/dev/ort/master/build/mj64-osxcross-m64/cross/osxcross-toolchain/cmake/common/../../wrappers/x86_64-apple-darwin-clang --objcc=/mnt/jlsws4/dev/ort/master/build/mj64-osxcross-m64/cross/osxcross-toolchain/cmake/common/../../wrappers/x86_64-apple-darwin-clang --cxx=/mnt/jlsws4/dev/ort/master/build/mj64-osxcross-m64/cross/osxcross-toolchain/cmake/common/../../wrappers/x86_64-apple-darwin-clang++-libc++ --ar=/mnt/jlsws4/dev/ort/master/build/mj64-osxcross-m64/cross/osxcross-toolchain/cmake/common/../../wrappers/x86_64-apple-darwin-ar --nm=/mnt/jlsws4/dev/ort/master/build/mj64-osxcross-m64/cross/osxcross-toolchain/cmake/common/../../wrappers/x86_64-apple-darwin-nm --target-os=darwin --arch=x86_64 --cpu=x86_64 --enable-pic --enable-static --enable-shared --enable-avfilter --enable-zlib --enable-bzlib --enable-runtime-cpudetect --enable-hardcoded-tables --disable-doc --disable-audiotoolbox --disable-videotoolbox --disable-amf --disable-cuda --disable-cuvid --disable-d3d11va --disable-dxva2 --disable-nvdec --disable-nvenc --disable-vdpau --x86asmexe=/mnt/jlsws4/dev/ort/master/build/mj64-osxcross-m64/tools/nasm/bin/nasm --sdl2-config=/mnt/jlsws4/dev/ort/master/build/mj64-osxcross-m64/stage/sdl2/lib/../bin/sdl2-config --disable-vaapi --extra-cflags='-I/mnt/jlsws4/dev/ort/master/build/mj64-osxcross-m64/stage/zlib/include -I/mnt/jlsws4/dev/ort/master/build/mj64-osxcross-m64/stage/bzip2/include -I/mnt/jlsws4/dev/ort/master/build/mj64-osxcross-m64/stage/lzma/include -I/mnt/jlsws4/dev/ort/master/build/mj64-osxcross-m64/stage/sdl2/include' --extra-ldflags='-L/mnt/jlsws4/dev/ort/master/build/mj64-osxcross-m64/stage/zlib/lib -L/mnt/jlsws4/dev/ort/master/build/mj64-osxcross-m64/stage/bzip2/lib -L/mnt/jlsws4/dev/ort/master/build/mj64-osxcross-m64/stage/lzma/lib -L/mnt/jlsws4/dev/ort/master/build/mj64-osxcross-m64/stage/sdl2/lib' --disable-stripping --enable-optimizations
  libavutil      56. 19.101 / 56. 19.101
  libavcodec     58. 31.101 / 58. 31.101
  libavformat    58. 18.103 / 58. 18.103
  libavdevice    58.  4.104 / 58.  4.104
  libavfilter     7. 33.100 /  7. 33.100
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
setsockopt(MCAST_JOIN_SOURCE_GROUP): Can't assign requested address
udp://@ Input/output error

Last edited 4 years ago by Jose Santiago (previous) (diff)

comment:4 by Jose Santiago, 4 years ago

@cus I tested your patches. Applied the patches 1-7. I found some regression on windows builds and OSX still does not work with SSM.

I tested as follows with and without SSM:

ffmpeg -i 'udp://@' -codec copy -f crc crc.txt
ffmpeg -i 'udp://@' -codec copy -f crc crc.txt

I applied your patches and rebuilt for WIN64, OSX, and Linux:
1) Linux is working fine.
2) Windows builds used to work fine in SSM and non SSM modes. With your patches it fails on both SSM and non-SSM streams multicast stream reception.
3) OSX works on non-SSM multicast input, but receives nothing when sources is specified.

Please note that windows builds are no longer able to receive multicast streams at all.

Let me know if there are any other tests I can run.

Last edited 4 years ago by Jose Santiago (previous) (diff)

comment:5 by Marton Balint, 4 years ago

Thanks for testing. I have updated patch 4 which should fix the Windows regression:

If after replacing the patch you still cannot receive source specific multicast, then try specifying the receiver interface with localaddr. (Does your OSX box have multiple network interfaces? Are you receiving the multicast on the interface with the default gateway?)

comment:6 by Jose Santiago, 4 years ago

@cus Tested with the v2 of patch 4/7 and multicast reception is working now on all 3 platforms in both SSM and non-SSM modes. We should get these patches merged into mainline.

Last edited 4 years ago by Jose Santiago (previous) (diff)

comment:7 by Marton Balint, 4 years ago

Resolution: fixed
Status: newclosed

Pushed the series to git master as 93443225739606cf277e44b71c758c93ada8aa66.

Note: See TracTickets for help on using tickets.