Q:

Use bluetooth headset device as audio source in ffmpeg

I want use a bluetooth headset as audio source for recording a video. 
I can use arecord -D bluetooth -f s16_le -c1 -r8000 command and pipe audio to ffmpeg. But this cause sync problems in audio and video. so i want to capture audio without arecord. How can i define bluetooth device as audio source in ffmpeg command?
My asoundrc file:
pcm.bluetooth {
            type bluetooth
            profile "auto"
        }

 ctl.bluetooth {
   type bluetooth
 }

A:

After some digging in the ffmpeg docs, i managed to record sound via bluetooth headset with ffmpeg.
Firstly here is my /etc/asound.cnf:
pcm.btheadset {
   type plug
   slave {
       pcm {
           type bluetooth
           profile "auto"
       }
   }
   hint {
       show on
       description "BT Headset"
   }
}
ctl.btheadset {
  type bluetooth
}

Then with the following command you can record sound:
ffmpeg -y -f alsa -ac 1 -ar 8000 -i btheadset alsaout.wav

