<div dir="ltr"><div><div><div><br></div>As some of you may recall, every time I've posted a demo video to LAD, I've had to include a disclaimer excusing the poor quality due to a lack of functional screencasting tools.<br>
<br></div>Well, it took a couple of weeks of hair pulling and many, many hours of testing, but I finally arrived at a solution.<br><br></div>Anyone who wants to create a screencast and record audio via JACK *in perfect sync* must do the following:<br>
<br><div><div>Get ffmpeg. Apply this patch to it:<br></div><div><br><a href="https://github.com/original-male/FFmpeg/commit/d02509d04d396a98646ca81e9ba327a501486130.patch">https://github.com/original-male/FFmpeg/commit/d02509d04d396a98646ca81e9ba327a501486130.patch</a><br>
<br></div><div>Build it with vorbis and h264 support.<br><br></div><div>Then, start your favorite desktop environment. I use Xephyr for this.<br><br></div><div>Have jack running (at -r 48000)<br><br></div><div>Then run the following command:<br>
<br>ffmpeg -fflags +genpts+igndts -f x11grab -vsync 0 -r 30 -s 1920x1080 -i :${DISPLAY}.+0,0 -vcodec h264 -f jack -ac 2 -r:a 48000  -i screencast -acodec pcm_s16le -r:v 30 -vsync 2 -async 1 -map 0:0,1,0 -map 1:0 -preset ultrafast -qp 0 "$FILE"<br>
<br></div><div>Where DISPLAY is the number of your X11 display and FILE is the filename for the screencast. I use a .mkv extension for the matroska container.<br><br></div><div>Remember to connect the streams you want recorded to the 'screencast' JACK inputs!<br>
<br></div><div>With this setup I'm able to record a full 30 FPS @ 1080P with audio in perfect sync. Please share your results too. With some more evidence I might have a good case to get ffmpeg to accept my patch.<br>
<br></div><div>Enjoy! <br></div><div><br><br><br><br><br></div><div><br></div></div></div>