Best thing to do would be to build a frame synchroniser using external ram. You need external ram because you need to be able to store two whole fields/frames from both sources in memory. You need it double buffered so you are always reading from one while writing to the other. You may even need it triple buffered to cope with them being out of sync. This way you know you are always processing the same frames in parrallel.
Otherwise you could just count the clock cycles between the syncs. The only problem with it is that it is likely to drift over time.