He could've recorded right after the sex finished or them otherwise interacting romantically, like kissing.
There's no requirement for recording her having sex without her consent.
The court ultimately sentenced the husband to five months, finding that intentionally recording the footage went beyond what could be justified by his attempt to prove an affair.