核心代码:

iloop = video_fps/2  # 每秒处理2帧
while iloop:
cap.grab() # 获取下一帧,只取帧不解码
iloop = iloop - 1
if iloop <1:
break

参考文章:

  1. ​​树莓派 跳帧​​