[FFmpeg-user] Request for Assistance: Recording Android Mobile Device Input and Output Audio with FFmpeg

Nagulan Bsc cs nagulanbsccs at gmail.com
Thu Apr 4 17:53:25 EEST 2024


Dear FFmpeg Team,

I hope this email finds you well. I am writing to seek your assistance with
a project involving audio recording using FFmpeg.

I am currently working on a project that requires capturing both the input
and output audio from mobile devices. After some research, I came across
FFmpeg as a potential solution for recording audio. However, I am facing
difficulties in achieving this functionality.

Specifically, I need to record the audio input (microphone) and output
(speaker) simultaneously on mobile devices. I have tried various
approaches, including using "alsa" input for microphone and "pulse" output
for the speaker, but haven't been successful in obtaining the desired
results.

Below is a simplified version of the script I've been using:

*import subprocess*













*def record_audio(output_audio):    try:        ffmpeg_command = [
  'ffmpeg', '-f', 'alsa', '-i', 'pulse', '-ac', '2', '-vn', output_audio
    ]        subprocess.run(ffmpeg_command, check=True)        print("Audio
recording completed successfully.")    except subprocess.CalledProcessError
as e:        print("Error:", e)if __name__ == "__main__":    output_audio =
"output_audio.mp3"    record_audio(output_audio)*


Could you please provide guidance on how I can achieve simultaneous
recording of mobile device input and output audio using FFmpeg? Any
insights, suggestions, or examples would be greatly appreciated.

Thank you very much for your time and assistance. I look forward to hearing
from you soon.



*Best regards,Nagulan M*


More information about the ffmpeg-user mailing list