Mobile-ffmpeg: How to enable 'ALSA' to capture audio

Created on 14 Jun 2019  路  9Comments  路  Source: tanersener/mobile-ffmpeg

i want to use "ffmpeg -f alsa -i hw:0 alsaout.wav"
how can i change config

please help, Thanks

question

All 9 comments

Unfortunately alsa input device is not available on both platforms.

Is it technically possible to add support for it?

Well, alsa needs libasound, so libasound library should be built first. Technically it should be possible but I haven't tried it before.

The biggest question for me is, do we need to support alsa? We already have android_camera device on Android and AVFoundation device on iOS to record audio/video. What will we gain by supporting alsa? Do you have a specific use case?

I was looking into a way to record audio from a USB microphone/input card on Android (not a phone but a development board), and since the device is listed as an ALSA device I thought about ffmpeg. I then found the AudioRecord Android class which allows to select a device for the recording, so that seems to be a solution. Thanks for the reply!

Thanks for your explanation. I think you have a valid case here.

I expect you to be able to record audio using android_camera device but a test is needed for that. Can you try to record audio using mobile-ffmpeg and android_camera device?

Ah I see what you meant. Unfortunately the device is on Android 6 so if I understand correctly camera access it not available there

You are right, it's not available below API Level 24. Let me try and see if I can build alsa on Android.

Unfortunately, it is not possible to build alsa on Android. alsa library (libasound) depends on several semaphore (sem.h) and shared memory (shm.h) functions which were introduced in API Level 26. So compilation fails under API Levels below 26.

Since increasing API Level to 26 is not an option, android_camera will remain as the only option to record audio/video on Android.

I see, thank you very much for investigating!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

usmanrana07 picture usmanrana07  路  5Comments

andyrenkehe picture andyrenkehe  路  8Comments

longkeng picture longkeng  路  4Comments

khacchungory picture khacchungory  路  7Comments

shaheercs picture shaheercs  路  6Comments