[FFmpeg-devel] [RFC] unix socket protocol and our proto situation

aviad rozenhek aviadr1
Wed Dec 15 19:37:32 CET 2010


On Wed, Dec 15, 2010 at 19:28, Luca Barbato <lu_zero at gentoo.org> wrote:

> On 12/15/2010 04:03 PM, aviad rozenhek wrote:
> > On Wed, Dec 15, 2010 at 16:35, Ronald S. Bultje <rsbultje at gmail.com>
> wrote:
> >
> >> Hi,
> >>
> >> On Wed, Dec 15, 2010 at 6:31 AM, aviad rozenhek <aviadr1 at gmail.com>
> wrote:
> >>> The 64k socket buffer asked for by ffmpeg is too small, especially when
> >>> using higher bitrate streams like 10mbps and up.
> >>> using 250k is much more reasonable IMHO and works much better.
> >>> using a tight loop to read from the socket improves on the current
> >>> situation, but does not fix it.
> >>> increasing the buffer size solves it completely, and requires no code.
> >>
> >> I think this is fine, but if you change default, please document that
> >> properly in changelog and try making it settable, if possible, with a
> >> AVOption in the RTSPDemuxer. That way apps that want smaller buffers
> >> don't have to waste memory.
> >>
> >> Ronald
> >>
> >>
> > I don't have commit access,
> > I was hoping that someone with commit access would be able to change the
> > default buffer size in udp.c
>
> namely
>
> diff --git a/libavformat/udp.c b/libavformat/udp.c
> index b998086..eb7cf14 100644
> --- a/libavformat/udp.c
> +++ b/libavformat/udp.c
> @@ -54,7 +54,7 @@ typedef struct {
>  } UDPContext;
>
>  #define UDP_TX_BUF_SIZE 32768
> -#define UDP_MAX_PKT_SIZE 65536
> +#define UDP_MAX_PKT_SIZE 262144
>
>  static int udp_set_multicast_ttl(int sockfd, int mcastTTL,
>                                  struct sockaddr *addr)
>
>
Exactly.


>
> I'm still not convinced that this alone helps, but shouldn't hurt that
> much.
>
> lu
>
>
just try the following commandline using a 720p source and see if it helps
> ffmpeg -re -i *my720psource.mov* -f mpegts -b 20000k udp://localhost:1234

with small buffers [should show an occasional drop in ffplay looks for
errors in the video stream]
> ffplay udp://localhost?localport=1234&buffer_size=65536

with large buffers large buffers [ffplay should show no errors]
> ffplay udp://localhost?localport=1234&buffer_size=262144

-- 
Aviad Rozenhek



More information about the ffmpeg-devel mailing list