Support broadcast destination for udp protocol
authorOlivier Langlois <olivier@trillion01.com>
Wed, 9 Apr 2014 03:21:52 +0000 (23:21 -0400)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 13 May 2014 13:51:41 +0000 (15:51 +0200)
commitf1c167496e41cabc2bd1b890b149e4b34648cad6
treed2d6b39bb271dc7a0660582f8183f82cb78ec03a
parentbb9e5116fe5b6873d67854bf08ee5d71949764b2
Support broadcast destination for udp protocol

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@trillion01.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/udp.c