Set the GPIO to input mode with pull-up. Place 100nF capacitor between GPIO and GND. (Optional) ...
ffmpeg -f kmsgrab -i - -vf "hwdownload,format=bgr0" screenshot.png