Respected Sir,
I have done connections for camera input interface following this site:
Only instead of Camera at end, I have connected a DVD player.
There is a video in CD inserted in DVD player. I want to read the video from CD which is in DVD player. Now, I have created a OpenCV (Version - 5.3.1) program for accessing the video from DVD player in which I have written
VideoCapture cap(0)
Is this correct?
After cross-compiling the program to output, and running it on board with ./output, I get following error:
***OpenCV Error: Unspecified error (GStreamer: unable to start pipeline
) in cvCaptureFromCAM_GStreamer, file /usr/src/debug/opencv/3.3+gitAUTOINC+87c21
VIDEOIO(cvCreateCapture_GStreamer(CV_CAP_GSTREAMER_V4L2, reinterpret_cast
/usr/src/debug/opencv/3.3+gitAUTOINC+87c27a074d_2a9d1b22ed_a62e20676a_34e4206aee
in function cvCaptureFromCAM_GStreamer***
Program in OpenCV (3.5.2)
using namespace std;
using namespace cv;
int main()
{
VideoCapture cap(0);
int size = 2;
bool drawCross = 1;
int x = 320;
int y = 240;
int z = 0;
int thick = 1;
while(true)
{
Mat frame;
// Capture frame-by-frame
cap >> frame;
// If the frame is empty, break immediately
if (frame.empty())
break;
// for converting the frame to grayscale
Mat gray;
cvtColor( frame, gray , COLOR_BGR2GRAY);
if (drawCross)
{
line( frame, Point( x- 10*size-z, y ), Point( x + 10*size + z, y), Scalar( 0, 0, 255 ), thick, 4 );
line( frame, Point( x, y-10*size + z), Point( x, y + 10*size + z), Scalar( 0, 0, 255 ), thick, 4);
}
imshow(" figure ",frame);
char c=(char)waitKey(25);
char m=(char)waitKey(25);
char n=(char)waitKey(25);
}
cap.release();
destroyAllWindows();
return 0;
}
Thank you for help.