I use VLC media player 2.2.8 Weatherwax (revision 2.2.7-14-g3cc1d8cba9), installed from my distrib repo (Arch Linux). My purpose is to create a command which records a video of my desktop, with audio input from micro.
After some research, I've used this command :
vlc screen://
:screen-fps=24
:screen-follow-mouse
:screen-mouse-image=cursor.png
:input-slave=alsa://hw:1,0
:sout="#transcode{vcodec=h264,venc=x264,vb=2048,acodec=mp3,scale=1.0,vfilter=croppadd{cropleft=0,croptop=0,cropright=0,cropbottom=0}}:duplicate{dst=std{mux=mp4,access=file,dst=out.mp4}}"
I tested it for a ~1mn video, and it worked without any noticeable issue. Then I recorded an ~1h video, and the result is the following : Link to image (imgur).
The values are approximative. The audio lag begins with ~3s, and finishes with ~3mn. Except the lag, video and audio work properly.
Why is there an audio lag ? Is it due to some sort of compression, or some reasons like "the micro input is slower than screen video capture" ?
Thank you for your answer.