[FFmpeg-user] A question of FFmpeg's UDP protocol usage
Dennis Mungai
dmngaie at gmail.com
Sun Jun 28 10:15:39 EEST 2020
Hello there,
I encountered a somewhat unique problem today with ffmpeg, where, on
receiving UPD multicast input, the ffmpeg process would also bind to a
random unicast port, say 5112:
ss -tulpn | grep :5112
udp UNCONN 1213696 0 0.0.0.0:5112 0.0.0.0:*
users:(("ffmpeg",pid=958238,fd=54))
All inputs in use are *multicast*, so why is ffmpeg binding to a local port
in udp unicast mode?
Going through the documentation, there are some options that may somewhat
alleviate this condition, though I've not tested them yet:
https://ffmpeg.org/ffmpeg-protocols.html#udp
1. connect=1/0: As documented, in my case (receiving), it stated "For
receiving, this gives the benefit of only receiving packets from the
specified peer address/port. "
2. sources=address[,address]: As documented: "Only receive packets sent
from the specified addresses. In case of multicast, also subscribe to
multicast traffic coming from these addresses only."
I'm tempted to use option 1 first, then 2, as the first option does not
require me to pass a hard coded IP as an argument.
Now, to the question: Is ffmpeg binding to a random UDP unicast port when
receiving UDP multicast normal/expected behavior? And if so, how can this
behavior be overridden so that such binding does not occur?
More information about the ffmpeg-user
mailing list