I want the following functions ， please help.
Image data input: 8K ，black and white ，line camera.
Signal input: front GPIO
To realize the function:
1: One frame is generated for every 1000 lines of images.
2: The front GPIO input signal is a periodic signal, and the frequency changes between 1k-100k. The period of the periodic signal needs to be detected. The period value of the signal is filled in the first 8 bytes of the first line of each frame image.