[Libav-user] setting raw alsa pkt size

Carl Eugen Hoyos cehoyos at ag.or.at
Wed May 13 10:46:48 CEST 2015


daggs <daggs at ...> writes:

> as a design decision I've decided to split the grab 
> and encode to two different threads. each input 
> (e.g. video and audio) has it's own set of threads.

Which means that A/V sync is impossible to keep, or 
do I miss something? (Note that it isn't easy with 
alsa and xcb in any case.)

> but for audio I get a whopping 939834256 which 
> translates into 939 mb which is unacceptable for me.

939MB per hour? Or per day?
This is the maximum alsa buffer size on your system.

FFmpeg uses the maximum possible alsa buffer size to 
make sure no audio gets lost. There is a TODO in 
libavdevice/alsa.c on implementing custom buffer 
size, consider sending a patch.

> looking at the code I see that the default codec 
> format is AV_CODEC_ID_PCM_S16LE.

Which is the codec with the second smallest bandwidth 
amount. (But changing the codec probably wouldn't 
change the buffer size, or does it?)

> I was wondering if here is a way to reduce raw 
> capture audio frame size to more reasonable amount?

If you reduce the buffer too much, you will probably 
miss audio from time to time.

Carl Eugen



More information about the Libav-user mailing list