[FFmpeg-devel] [PATCH] avformat/file: increase max packet size to 256k for written files

Tobias Rapp t.rapp at noa-archive.com
Fri Jun 16 18:13:40 EEST 2017


On 05.06.2017 19:16, Marton Balint wrote:
> Another huge performance improvement when using SMB/CIFS as output.
>
> Signed-off-by: Marton Balint <cus at passwd.hu>
> ---
>  libavformat/file.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/libavformat/file.c b/libavformat/file.c
> index 264542a36a..ae7231a484 100644
> --- a/libavformat/file.c
> +++ b/libavformat/file.c
> @@ -227,6 +227,11 @@ static int file_open(URLContext *h, const char *filename, int flags)
>
>      h->is_streamed = !fstat(fd, &st) && S_ISFIFO(st.st_mode);
>
> +    /* Buffer writes more than the default 32k to improve throughput especially
> +     * with networked file systems */
> +    if (!h->is_streamed && flags & AVIO_FLAG_WRITE)
> +        h->max_packet_size = 262144;
> +
>      return 0;
>  }
>

My tests show ~50% improved throughput rates. LGTM, but I'm not the 
maintainer of this file.

Thanks,
Tobias



More information about the ffmpeg-devel mailing list