Ask Your Question

Revision history [back]

intermittently get multiple error while reading frame from video capture card using python opencv bindings

System information:
Opencv : 4.2.0
Python : 3.5.7 Operating system : Ubuntu 64bit 16.04.1
Kernel version: 4.15.0
Video capture card : HD60 Game Live usb 3.0

Step to reproduce:

import cv2
video = cv2.VideoCapture(/dev/video0)
if video.isOpen():
    while True:
        check, frame = video.read()

Detailed description: Intermittently getting below error while reading frame by frame using cv2.VideoCapture.read()

  1. Corrupt JEPG data : 7 extraneous bytes before marker 0xd6
  2. Corrupt JEPG data : premature end of data segment
  3. VIDIOC_QBUF : Invalid arguments
  4. Read failed error

Can someone let me know if there any known issue with opencv libraries or workaound to fix these issues?