[libav-tools] libav UDP stream and packet loss in mixed 100/1000 network

Luca Barbato lu_zero at gentoo.org
Mon Jul 6 18:28:07 CEST 2015


On 04/07/15 17:52, Christian Robottom Reis wrote:
> Hello there,
> 
>     We've been working on a project to stream a screencast from an x86
> machine with a gigabit NIC to half a dozen Raspberry Pi devices (with
> fast ethernet NICs) connected to TV screens. Our plan is to send a
> multicast UDP to omxplayer on the client side. However, we've stumbled
> upon a problem: streaming using avconv from the gigabit host to the rpi
> is resulting in dramatic (30%+) packet loss on the rpi side.
> 
> The setup to reproduce the issue is fairly simple. On the x86 side,
> we stream something via UDP:
> 
>     avconv -re -i big_buck_bunny_1080p_h264.mov -f mpegts udp://pi:8765/
> 
> and on the rpi side we try and play that stream with omxplayer, which
> renders the video with artifacts (green and grey pixelated video,
> vertical stripes, etc) typically present when there is packet loss.
> 
> With tcpdump we can actually confirm that 30% of the packets being sent
> never hit omxplayer. The question we've been unable to answer is where
> are the packets being dropped -- neither ifconfig nor netstat -us can
> match the actual number of lost packets, which we can tell by capturing
> on both sender and receiver.


You need to tune your udp system buffers so packets do not end lost
because either buffer can't keep up with them.

-buffer_size 2M should be enough to fix it.

lu



More information about the libav-tools mailing list