I want to capture raspberry pi desktop without connected monitor. IS it possible to run a program capture with script at boot up and record the desktop? Or the raspberry pi must be connected with monitor to recognize that there is a port (monitor) ?
The simplest way is to set the resolution in config.txt along these lines:
# Set to allow monitor to be added after boot hdmi_force_hotplug=1 # Set resolution to PAL @ 12180x1024 60Hz hdmi_group=2 hdmi_mode=35
You can then use VNC to set the desktop up if the program you want to record is not automatic.
As for capturing the screen: