There are many better ways to do what you want - one is to actually record the scene with a video camera similr to a GoPro type, but the video only gets stored to the SD card when a flash is detected. So basically the camera keeps the last 5 seconds or so of video in volatile memory (RAM) and when a flash is…