I found I had to choose a particular fps for the video and no convertion when recording.
So I have recorded in raw (YUY2 in my case), recorded the audio separately, muxed the two and then converted.
Yes it is inconvenient ..... and much longer than should be necessary .... but the results are reliable.
Hopefully I will stumble on a better scheme in the future.
There is no reason I can think of, that it could not all be done in one operation on this 4 core machine.
Well there is one thing .... and I know nothing about it ....... apparently Alsa has a buffer size set somewhere.
I think it would be worthwhile to change that to see if it makes a difference with the sync problem.
BTW ..... I did get it done in one command and each recording had the same out of sync time ...... about 1.5 secs. The variation was less than 0.1 secs IIRC.
If I could figure out why that was so then all would be well.
For the moment ..... to take care of the few recordings I need ..... the present arrangement will do. I can let it process away in the background after the recording itself is completed.
Still a work-in-progress EDIT:
Leiche ....... I wonder how this command works on your system ........
ffmpeg -f video4linux2 -i /dev/video0 -r 30 -vcodec mpeg4 -b 1000 -qscale 0.1 -bt 256k -y -f alsa -ac 1 -i hw:1,0 -ar 44100 ffmpeg-`date +%s`.mp4
The qscale is extremely high above ..... I was testing how high I could make it. Maybe a value of 2.0 or 3.0 would be good enough.
Please let me know if you try it
This is the one with the consistent sync offset.