| | 94 | |
| | 95 | == Lossless recording == |
| | 96 | |
| | 97 | If you want a perfect recording of your desktop, x264 can help. Use lossless encoding, e.g.: |
| | 98 | |
| | 99 | {{{ |
| | 100 | ffmpeg -video_size 1920x1080 -framerate 30 -f x11grab -i :0.0 -c:v libx264 -qp 0 -preset ultrafast -profile:v high444 capture.mkv |
| | 101 | }}} |
| | 102 | |
| | 103 | The high444 profile is used to ensure a lossless RGB to YUV transformation. Otherwise, the capture will not be lossless, and text will look blurry. {{{-qp 0}}} tells x264 to encode in lossless mode, {{{-preset ultrafast}}} advises it to do so fast. |
| | 104 | |
| | 105 | The encoder should be fast enough on most modern hardware to record without any framedrop, and even leave enough CPU headroom for other applications. |
| | 106 | |
| | 107 | If most of your screen will be static, it may be useful to use the {{{-tune stillimage}}} parameter, i.e.: |
| | 108 | |
| | 109 | {{{ |
| | 110 | ffmpeg -video_size 1920x1080 -framerate 30 -f x11grab -i :0.0 -c:v libx264 -qp 0 -tune stillimage -preset ultrafast -profile:v high444 capture.mkv |
| | 111 | }}} |
| | 112 | |
| | 113 | If you're going to archive the recording or are concerned about file size, re-encode it losslessly again but with a slower preset. Note that since the initial recording was lossless, and the re-encode is lossless too, no quality loss is introduced in this process in any way. |
| | 114 | |
| | 115 | {{{ |
| | 116 | ffmpeg -i capture.mkv -c:v libx264 -qp 0 -tune stillimage -preset veryslow -profile:v high444 capture_smaller.mkv |
| | 117 | }}} |