| | 99 | == Use Windows 8+ Desktop Duplication API == |
| | 100 | |
| | 101 | Windows 8 introduced a new way of capturing whole desktops: The Desktop Duplication API |
| | 102 | |
| | 103 | FFmpeg implements support for it in the form of the [https://ffmpeg.org/ffmpeg-filters.html#ddagrab ddagrab] filter. |
| | 104 | |
| | 105 | It provides the user with on-gpu D3D11 textures, in the form of ffmpeg D3D11VA frames, which can then be directly encoded by a compatible hardware encoder: |
| | 106 | {{{ |
| | 107 | ffmpeg -init_hw_device d3d11va -filter_complex ddagrab=0 -c:v h264_nvenc -cq:v 20 output.mkv |
| | 108 | }}} |
| | 109 | |
| | 110 | Or downloaded and processed as usual, though with a bit of overhead compared to pure on-GPU processing: |
| | 111 | {{{ |
| | 112 | ffmpeg -filter_complex ddagrab=0,hwdownload,format=bgra -c:v libx264 -crf 20 output.mkv |
| | 113 | }}} |
| | 114 | |