Run code on prerecorded video

Is there any way to record a test video/pictures with the camera and then run/test code using that pre-recording?

See Examples - video Recording - Image writer.