In the Internet of Things environment, most facial recognition systems are highly susceptible to face spoofing attacks. To increase the security and reliability of such systems, this paper proposes an anti-spoofing method for facial recognition systems based on optical flow and texture features. The spoofing-detection algorithm first generates the optical flow field map of the face area using the optical flow method and a face-detection method, based on two consecutive frames of the captured face video. Then, the original RGB face area image and optical flow field map are input into a two-channel convolutional neural network to extract and fuse the features of the face. Finally, based on the optical flow and texture features, this method classifies real and fake faces. In addition, to better generate the optical flow field map containing liveness information, a motion amplification algorithm is applied to enhance the 0.04–0.4 Hz signal in the video frame by 20 times. For texture and optical flow presentation, we propose a lightweight network with dynamic convolution and multi-level feature fusion blocks. This paper used the Replay Attack spoofing dataset from IDIAP, consisting of 1300 videos, for model training, verification, and testing. Experiments showed that the algorithm proposed in the paper performed well on the Replay Attack data set and achieved a half total error rate of 0.66%.