can’t record screen using ffmpeg, including microphone and bluetooth headset audio, in sync
I’m trying to record my screen using ffmpeg, but including the audio from the computer microphone and the computer audio (the one I hear for my bluetooth headset). I can get the file with this command:
ffmpeg -video_size 1920x1080 -framerate 24 -f x11grab -i :1.0+0,0 -f pulse -ac 2 -i $(pactl list short sources | grep -i "alsa_input" | awk '{print $2}') -f pulse -i $(pactl list short sources | grep -i "blue" | awk '{print $2}') -filter_complex "[1:a][2:a]amerge=inputs=2[a]" -map 0:v -map "[a]" -ac 2 -c:v libx264 -crf 23 -preset fast -c:a aac -b:a 192k -strict experimental file.mp4
but the audio of both inputs is out of sync. Specifically, the computer audio in out of sync.
These are my attempts for fixing this:
#no bluetooth
ffmpeg -video_size 1920x1080 -framerate 24 -f x11grab -i :1.0+0,0 -f alsa -ac 2 -i pulse -acodec aac -strict experimental file.mp4
#no bluetooth
ffmpeg -video_size 1920x1080 -framerate 24 -f x11grab -i :1.0+0,0 -f pulse -i default -acodec aac -strict experimental file.mp4
#v5 only audio but out of sync
ffmpeg -f pulse -ac 2 -i $(pactl list short sources | grep -i "alsa_input" | awk '{print $2}') -f pulse -i $(pactl list short sources | grep -i "blue" | awk '{print $2}') -filter_complex "[0:a][1:a]amerge=inputs=2[a]" -map "[a]" -ac 2 -c:a aac -b:a 192k file.aac
any suggestions?
I’m in ubuntu 20.04.
Read more here: Source link
