Add fbdir
option to Xvfb object:
vdisplay = Xvfb(width=1920, height=1080, colordepth=24, fbdir="/tmp/")
This option will tell xfvb to save dumps of its contents to PROVIDED_FOLDER/Xvfb_screen<n>
The dump file will be in .xwd
format, so it needs to be converted to some format supported by image viewers.
For the convenience you can use the following script:
#!/bin/bash
for i in $(seq 10000); do
/bin/cp Xvfb_screen? Xvfb_screen.xwd;
convert /tmp/Xvfb_screen.xwd screen_image_$i.png;
sleep 1;
done
Adjust the value in sleep
depending on what fps you want to get, e.g. for 60 fps use 0.016