[FFmpeg-user] Play Audio from PC Microphone Input with ffplay

Leo Izen leo.izen at gmail.com
Sun Jan 19 22:29:51 CET 2014

On 01/19/2014 10:44 AM, James Board wrote:
> Is it possible to use ffplay to play audio from the microphone input?
> If so, how (I'm on a Linux PC running CentOS)?
> Context: I connected the audio output of my DVR to the PC's microphone
> input jack and I'm trying to play that audio through the PC's speakers.  Does that
> make sense?
> If this isn't possible with ffplay, what would be the correct tool to use to
> do this?  Seems like it should be a common thing.
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user

If your microphone is configured as a PulseAudio or ALSA input, then you 
should be able to. If you have one microphone, then the default input 
should be that microphone. You can run

ffmpeg -f alsa -i default

to read from the default alsa input, or optionally
ffmpeg -f pulse -i default
if you configured with --enable-libpulse.

But what about ffplay? Easy. Just leave out -i (and remember to use 
canonical options with ffplay)

ffplay -f alsa default

should echo the alsa default input to your default ffplay audio output 
(which AFAIK is SDL). If you want to play it to alsa, use
ffmpeg -f alsa -i default -f alsa default

If your mic isn't your default alsa input, then there should be a 
package in the package manager that allows you to configure your alsa 
inputs. (Although, I don't know what that package is called in CentOS.)

More information about the ffmpeg-user mailing list