I have a problem with ffmpeg giving no audio when recording using alsa.
Does anyone know how to get a Raspberry Pi Zero W to record and stream audio with ffmpeg using alsa?
I have a project where I am using I2S digital microphones hooked up to an Raspberry Pi Zero W. The microphones are from Adafruit, and I set them up using this guide. I have two microphones set up in stereo mode. Now, when I use
arecord -D plughw:1 -c2 -r 48000 -f S32_LE -t wav -V stereo -v file_stereo.wav
everything works great. I can copy the file over to my main machine and it plays fine. Now, when I try something like this:
ffmpeg -f alsa -re -i hw:1,0 -acodec mp2 -ac 2 -f rtp rtp://[host]:[port]
and try playback via either VLC or ffplay, I only get silence and/or clicking sounds. ffplay indicates that a connection is being made, so it isn't a network issue. I have also verified that the input device is in fact the correct one. I have attempted just replicating arecord through ffmpeg with
ffmpeg -f alsa -i plughw:1,0 -t 10 out.wav
However, this does the same as piping it through RTP. I have tried different codecs: mp2, mp3, aac. I even tried different input and output sampling rates, channels, etc. Nothing works. I have used the ffmpeg available in the Stretch repositories and compiled it myself where I knew it had the alsa library enabled.
Any help would be appreciated!