Ask Your Question
0

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

asked 2020-02-17 23:17:46 -0500

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?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2020-02-18 03:27:49 -0500

supra56 gravatar image

updated 2020-02-18 04:15:21 -0500

You forgot to add quote. Change this:

video = cv2.VideoCapture(/dev/video0)

to:

video = cv2.VideoCapture("dev/video0")

Updated: I removed single quote.

edit flag offensive delete link more

Comments

Is your pc comes with USB 3.0?

supra56 gravatar imagesupra56 ( 2020-02-18 03:52:42 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-02-17 23:17:21 -0500

Seen: 23 times

Last updated: Feb 18