[FFmpeg-devel] Problem with input multicast streams

Stephane Junique Stephane.Junique
Mon Aug 18 18:01:58 CEST 2008


Hello,

I have found a problem with how ffmpeg requests multicast streams.
I thought I'd send an email to this list before filing a bug report, to see
if someone can suggest where I should dig a little more.

I am using ffmpeg from CVS (2008.08.18) on Linux (Mandriva 2008.0, x86_64).
Compiled with support for IPV6.

I am trying to start several processes, each taking a multicast stream as input.
These are IPTV channels: MPEG2 inside MPEG-TS.

The first process starts fine with the right channel. However, most of the time
the second process ends up receiving the 1st channel (instead of the one I requested).
This is reproducible with both ffmpeg and ffplay, using for example the following
command lines:

ffplay udp://@239.192.207.1:10000?reuse=1
ffplay udp://@239.192.207.2:10000?reuse=1

I had a look at libavformat/udp.c and the socket(), bind() and setsockopt() calls seem
to be correct, from what I can tell (but I' not very familiar with socket programming):
 - a reusable socket is created (it needs to to be reusable as all channels use the same
   network interface and the same port, which is what identifies a socket);
 - the process successfully binds to the socket;
 - the socket is configured by setsockopt to listen to the requested multicast channel.

This problem does not affect vlc or mplayer, which always get the requested channel, even when
several instances are running.
If ffplay is started while an instance of vlc is already running, ffplay will often display
the channel used by vlc instead of the requested one.

Comments? Suggestions?

With Best Regards,

Stephane






More information about the ffmpeg-devel mailing list