摘要 |
Embodiments of the present invention provide frame type detection and frame size detection methods and apparatuses for a video stream. The video frame type detection method includes: obtaining a size of a current video frame, where the current video frame is located after the first video frame of the video stream; obtaining a change feature value of the current video frame according to the current video frame and a size of a previous first video frame adjacent to the current video frame; obtaining an I-frame threshold of the current video frame according to a video frame rate and a location of the current video frame; and determining whether the previous first video frame is an I frame according to the change feature value of the current video frame and a change feature value of the previous first video frame, the I-frame threshold of the current video frame, and the size of the current video frame, the size of the previous first video frame, and a size of a previous second video frame. The present invention provides a complete and effective frame type detection method, and therefore only one video frame before a previous first video frame is considered during detection of a frame type of the previous first video frame; in addition, impact of a video frame rate is fully considered. |