How to process video with DFT/FFT - getting the frequency of green color changes? Goal: I have a video stream from a webcam. I need get frequency of the green color changes on the video.

Video color space is RGB
The signal looks sinusoidal with a frequency range 0.5 - 2.4 Hz

I performed the following steps:


Capture Video frames into collection.
Processing frames by Gaussian pyramid down level 4. (frame size now is ~ 37x32)
use DFT/FFT with sample rate 30
get spectrum
calculate frequency


on DFT I put data from each frame:
video frames quantity = 60

Method 1:
I collect green channel from frame and join with the green channel from a next frame, in result I have a big data array.

37*32=1184

1184*60=71040 the size of the sample buffer

one long array with 71040 data point of all pixels in the green channel of each frame.
(all green pixels from one frame + from next frame)

Method 2:
I collect the green channel from an each pixel on the frame and join with the same green channel pixel from a next frame, as a result I have a big data array.

1184 arrays with 60 data points
(each green pixel from one frame + from next frame)

Which method is the correct one?
If you need to track changes in time, then the most natural and obvious way is to form one temporal (green data) vector per pixel that you want to observe, then take its DFT (it's way 2, but with more than 2 frames). 

The actual vector length and DFT function that you should use will depend on the actual case you are working on. 


Suppose you work from a recorder video. Then, you can take the 1D DFT of the vector formed with the value of one pixel of interest in the whole sequence.
On the other hand, if you work from a live feed, then you need to use a FIFO data vector and probably apply a windowed 1D Fourier transform to avoid artifacts, see short-time Fourier transform.