Search code examples
linuxvideoffmpegwebcam

Record audio from two microphone and video from one webcam and mux using FFMPEG


Iam trying to mux audio from two different microphones and video from webcam using ffmpeg in linux.
I used the following code
ffmpeg -f video4linux2 -s 320x240 -i /dev/video0 -f alsa -ac 1 -i hw:1,0 -acodec libmp3lame -ab 96k camera.mp4
it works for muxing audio from one microphone and video from one webcam

I went through forums and googled for an hour without any positive result.



So, the question is i need to mux two audio from microphones and one video from webcam and produce a video output with two audio tracks.

Thanks


Solution

  • Use

    ffmpeg -f video4linux2 -s 320x240 -i /dev/video0 -f alsa -ac 1 -i hw:1,0 -f alsa -ac 1 -i hw:2,0 -map 0 -map 1 -map 2 -acodec libmp3lame -ab 96k camera.mp4