Recording audio using ffmpeg 2.7

I recently compiled ffmpeg 2.7 for Arduino Yun to record audio since it provides creation of segments. I had compiled ffmpeg with libmp3lame support to record in mp3 format.

I am able to record in mp2 format without any buffer overrun. If I try to record in mp3 format using the libmp3lame encoder, it results in a lot of buffer overruns.

I read through the ffmpeg documentation and tried changing the buffer size, bitrate etc but no luck in avoiding buffer overrun.

I also attempted to re-encode the mp2 file to mp3 file after the completion of recording. It takes forever to finish re-encoding. The Yun records for 10 hours every day. Is there anyway to record in mp3 format without buffer overrun? I also tried vorbis encoder but no luck.

You should check CPU usage during MP3 encoding. It sounds like CPU speed problem, MP3 encode is very high cpu intensive. Move to faster hardware platform say raspberry pi?

sonnyyu: FYI;-

The heart of Yún is CPU - AR9331, here is the market position of it.

AR9331 (MIPS 24k@400MHz, 1x1:1, 150Mbs/2.4GHz, PHY/100Mbs)

AR9341 (MIPS 74Kc@500Mhz, 2x2:2, 300Mbs/2.4GHz, PHY/100Mbs)

AR9344 (MIPS 74Kc@600MHz, 2x2:2, 300Mbs/2.4GHz, 450Mbs/5GHz, PHY/1Gbs)

QCA9558 (MIPS 74Kc@720MHz, 3x3, 450Mbs/2.4GHz, 1300Mbs/5GHz, PHY/1Gbs)

It is already on bottom of the food chain.

Thanks. This is exactly what I thought while posting the question. I asked this question because in ffmpeg 0.8, you could encode in mp3 format using the native mp2 codec. This is no longer possible. I was curious if a work around is possible

Save audio stream to SD card

Thanks. Yeah this definitely worked for me with ffmpeg 0.8. I wish it did for ffmpeg 2.7. I guess it is the processor limitations.