[FFmpeg-devel] [PATCH] Support broadcast destination for udp protocol

Olivier Langlois olivier at trillion01.com
Tue May 13 20:58:11 CEST 2014


On Tue, 2014-05-13 at 16:00 +0200, Michael Niedermayer wrote:
> On Tue, Apr 08, 2014 at 11:21:52PM -0400, Olivier Langlois wrote:
> > Use the required socket option SO_BROADCAST to be able to stream to a broadcast
> > address.
> > 
> > Prior to the patch, trying to stream to a broadcast address was resulting to the
> > following error:
> > 
> > av_interleaved_write_frame(): Permission denied
> > 
> > The patch has been tested with:
> > 
> > ffmpeg -f v4l2 -framerate 30 -input_format yuyv422 -video_size 640x480 -i /dev/video0 \
> >  -c:v libx264 -profile:v high -preset ultrafast -tune zerolatency -b:v 500k -pix_fmt yuv420p \
> >  -f mpegts udp://192.168.1.255:5004?broadcast=1
> > 
> > I have added an option to let the user explicitly request broadcast in order to avoid
> > ffmpeg to broadcast unintentionally.
> > 
> > Signed-off-by: Olivier Langlois <olivier at trillion01.com>
> 
> patch applied
> 
> please add entry to our udp documentation for this as well
> 
> thx
Thank you Michael. I will update and offer a patch for the udp
documentation soon.

As a sidenote and possibly worthwhile to include as a warning in the udp
documentation. It is that I have discovered a network HW "feature" that
I wasn't aware of. It is that some Ethernet switches have what they call
a "Broadcast storm protection". If a broadcasted stream go through such
a switch, a lot of packets will be missing on the receiving side.

Linksys sd216 was not impacted by this but the Netgear GS605 had such a
protection.

I finally ended up upgrading my switch to a Netgear ProSafe M4100-D12G
Managed Switch where you can turn on/off the broadcast storm protection.

I am sorry to sound like an infotainment for Ethernet switch products
but if raising the awareness on this feature to others can spare some
pain to them, this is hopefully worthwhile to share.

greetings,



More information about the ffmpeg-devel mailing list