opencv中视频不能截取为图片,以下是什么原因😱

error: OpenCV(4.5.2) :-1: error: (-5:Bad argument) in function 'VideoCapture'

Overload resolution failed:

  • Can't convert object of type 'tuple' to 'str' for 'filename'
  • Required argument 'apiPreference' (pos 2) not found
  • Argument 'index' is required to be an integer
  • Required argument 'apiPreference' (pos 2) not found

参数写错了,或者漏掉参数了,看看函数需要的参数格式和类型跟你写的是否一致