Opened 3 months ago

Closed 2 months ago

#7459 closed defect (fixed)

Source Specific Multicast not working on OSX

Reported by: jlsantiago0 Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: udp osx
Cc: cus Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

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 10.66.133.33 and 10.66.133.34 they are both streaming to 239.36.34.100:4900. I can tune into the desired stream by selecting the sources as follows:

ffplay 'udp://@239.36.34.100:4900?sources=10.66.133.34'

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://@239.36.34.100:4900?sources=10.66.133.34: Input/output error

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

/Applications/VLC.app/Contents/MacOS/VLC 'udp://10.66.133.34@239.36.34.100:4900'

Change History (7)

comment:1 Changed 3 months ago by cehoyos

  • 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 Changed 3 months ago by cus

  • Cc cus added

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

http://mplayerhq.hu/pipermail/ffmpeg-devel/2018-September/234493.html

comment:3 Changed 2 months ago by jlsantiago0

@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://@239.36.34.100:4900?sources=10.66.133.34' -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://@239.36.34.100:4900?sources=10.66.133.34: Input/output error
bash-3.2$

Last edited 2 months ago by jlsantiago0 (previous) (diff)

comment:4 Changed 2 months ago by jlsantiago0

@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://@239.36.34.100:4900?sources=10.66.133.34' -codec copy -f crc crc.txt
ffmpeg -i 'udp://@239.36.34.100:4900' -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 2 months ago by jlsantiago0 (previous) (diff)

comment:5 Changed 2 months ago by cus

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

http://mplayerhq.hu/pipermail/ffmpeg-devel/2018-October/234799.html

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 Changed 2 months ago by jlsantiago0

@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 2 months ago by jlsantiago0 (previous) (diff)

comment:7 Changed 2 months ago by cus

  • Resolution set to fixed
  • Status changed from new to closed

Pushed the series to git master as 93443225739606cf277e44b71c758c93ada8aa66.

Note: See TracTickets for help on using tickets.