- ffmpeg
- mkvserver_mk2
ffmpeg -f x11grab -s 1920x1080 -i :0.0 -r 5 -g 10 -vcodec vp9 -f matroska pipe:1 | ./server
-f x11grab
: Input format set to grab the X11 display.-s 1920x1080
: Frame size equal to the X11 dispay resolution.-i :0.0
:display.screen
numbers of the X11 server that should be grabbed.-r 5
: Frame rate, in this case 5 fps.-g 10
: Set Group Of Pictures to 10, meaning that there will be a new key-frame (Intra-coded frame) every 10/5=2s.-vcoded vp9
: Bitstream format set to VP9. AV1 will be a sensible option in the near future.-f matroska
: Output container format set to Matroska as required by mkvserver_mk2.pipe:1
: Output to stdout../server
: mkvserver_mk2.
Values were chosen to minimize lag.
Install libva-intel-driver
(up to Coffee Lake) or intel-media-driver
(from Broadwell onwards).
ffmpeg -vaapi_device /dev/dri/renderD128 -f x11grab -s 1920x1080 -i :0.0 -r 5 -g 10 -vf 'hwupload,scale_vaapi=format=nv12' -c:v h264_vaapi -qp 24 -f matroska pipe:1 | ./server
Based on FFmpeg wiki VAAPI Screen Capture