Redhwan
Redhwan

Reputation: 967

WARN:0 global /home//opencv-4.1.1/modules/videoio/src/cap.cpp

The system:

OpenCV =4.1.1

Ubuntu =16.04

python =2.7.12

my code:

#!/usr/bin/env python
import numpy as np
import cv2

cap = cv2.VideoCapture(0)
#print(cv2.getBuildInformation())
print('cap.isOpened')
if cap.isOpened():
    print ('cap is opened')
    while(True):
        re,img=cap.read()
        cv2.imshow("video output", img)
        k = cv2.waitKey(1)& 0xFF
        if k==27:
            break
cap.release()
cv2.destroyAllWindows()

it is working fine but getting this warning:

[ WARN:0] global /home/redhwan/opencv-4.1.1/modules/videoio/src/cap.cpp (163) open VIDEOIO(GSTREAMER): trying capture cameraNum=0 ...
libv4l2: error got 4 consecutive frame decode errors, last error: v4l-convert: libjpeg error: End Of Image
[ WARN:0] global /home/redhwan/opencv-4.1.1/modules/videoio/src/cap_gstreamer.cpp (1757) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module v4l2src0 reported: Failed to allocate a buffer
[ WARN:0] global /home/redhwan/opencv-4.1.1/modules/videoio/src/cap_gstreamer.cpp (886) open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:0] global /home/redhwan/opencv-4.1.1/modules/videoio/src/cap_gstreamer.cpp (480) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
[ WARN:0] global /home/redhwan/opencv-4.1.1/modules/videoio/src/cap.cpp (183) open VIDEOIO(GSTREAMER): can't create capture
[ WARN:0] global /home/redhwan/opencv-4.1.1/modules/videoio/src/cap.cpp (163) open VIDEOIO(V4L2): trying capture cameraNum=0 ...
[ WARN:0] global /home/redhwan/opencv-4.1.1/modules/videoio/src/cap.cpp (175) open VIDEOIO(V4L2): created, isOpened=1

when I installed OpenCV, I followed this https://www.pyimagesearch.com/2016/07/11/compiling-opencv-with-cuda-support/

please help me or any suggestions

Thank you in advance

Upvotes: 2

Views: 3193

Answers (1)

Redhwan
Redhwan

Reputation: 967

fixed for me, I change the version and installed OpenCV=3.3.1

Upvotes: 1

Related Questions