I have tried ffmpeg too ..... but also got problems with the muxing. Thanks for posting your command.
I am beginning to wonder if I have a problem with buffer size for Alsa and or the Video ......
Your command above won't work here as it is ...... it seems to want stereo/2 channel audio and errors out
[alsa @ 0x8229d60] cannot set channel count to 2 (Invalid argument)
Adding the -ac 1 option allows it to record.
I get good quality video and good quality audio.
Unfortunately the audio starts well before the video, so is out of sync.
Other than this sync problem all is well.
There appears to be a delay before correct video frames are grabbed ..... the beginning of the saved video is corrupt or such.
If I could get rid of that .......
EDIT Played a little with Avidemux ...... passed the saved video from this command
ffmpeg -f video4linux2 -i /dev/video0 -r 30 -vcodec mpeg4 -b 1000 -qscale 5 -bt 256k -y -f alsa -ac 1 -i hw:2,0 -ar 44100 `date +%s`.avi
through Avidemux introducing a delay of 1490ms gives me an acceptable result.
That stage should not be be necessary of course ...... and is not if I use my script to record audio and video separately and mux them afterwards.
So it is no real improvement unfortunately
