Why is the video of my test on Web Automation not being generated?

Could you please help me as I’m performing web automation and my tests are running fine but the video of my test is not being generated. Capabilities I am passing are given below:

caps.setCapability("build", "Automation Test");
            caps.setCapability("name", "Test 1");
            caps.setCapability("platform", platform);
            caps.setCapability("browserName", browser);
            caps.setCapability("version", version);
            caps.setCapability("network", true);
            caps.setCapability("visual", true);
            caps.setCapability("console", true);
            caps.setCapability("headless", true);

Hi Richard,

ok, so I can see you are passing caps.setCapability("headless", true); this capability is the reason your videos are not getting generated.

Please remove this capability and execute your test again and your test video will start getting generated.