[FFmpeg-devel] [PATCH 4/4] avformat/wavdec: dynamically set max_size by default
Marton Balint
cus at passwd.hu
Sat Mar 2 00:30:59 EET 2024
On Thu, 29 Feb 2024, Marton Balint wrote:
>
>
> On Thu, 29 Feb 2024, Andreas Rheinhardt wrote:
>
>> Marton Balint:
>>> The wav demuxer by default tried to demux 4096-byte packets which caused
>>> packets with very few number of samples for files with high channel
>>> count.
>>> This caused a significant overhead especially since the latest ffmpeg.c
>>> threading changes.
>>>
>>> So let's use a similar approach for selecting audio frame size which is
>>> already
>>> used in the PCM demuxer, which is to read 25 times per second but at most
>>> 1024
>>> samples.
>>
>> 1024 samples seems to be quite small, in particular for files with few
>> channels (like stereo).
>
> 1024 is kind of a historical default. Also having multiples of 1024 is
> beneficial for some codecs which encode this many samples per frame.
>
> In any case, I am not against somewhat increasing this, but it should be done
> for both PCM and WAV, it can be a separate patch and discussion.
I will apply this set soon unless there are other comments. Will send a
patch after that to increase the default sample amount for wav and pcm.
Regards,
Marton
More information about the ffmpeg-devel
mailing list