We develop a general-purpose framework for analysis of time-resolved X-ray data based on optical flow. We perform a systematic evaluation of state-of-the-art optical flow techniques and their components. On the top of motion estimation we provide an extensive data analysis toolkit. All the devised techniques can be applied in 4D (3D + time). The implementation employs advanced numerical schemes and computations on GPU. We present the application of the optical flow methods to a number of scientific problems from various research fields.