UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Adventurer
Adventurer
182 Views
Registered: ‎09-25-2018

x11 forwarding video clip

hello friends,

I have problem with x11 forwarding a video with simple opencv app. I tried x11 to forward an image with simple opencv app and it works without any problem, but when I try to use a simple video clip, I get this error

 

Failed to query video capabilities: Inappropriate ioctl for device
libv4l2: error getting capabilities: Inappropriate ioctl for device
VIDEOIO ERROR: V4L: device Ben.mp4: Unable to query number of channels

(showimage:1261): GLib-GObject-CRITICAL **: g_object_set: assertion 'G_IS_OBJECT                                   (object)' failed
Error opening video stream or file

 

The Ben.mp4 is the video clip I am trying to use with opencv. here is my simple opencv code


#include <opencv2/opencv.hpp>
#include <iostream>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>

using namespace std;
using namespace cv;



int main(int argc, char *argv[])
{

      
    
    
    
    VideoCapture cap("Ben.mp4");
    
  // Check if camera opened successfully
  if(!cap.isOpened()){
    cout << "Error opening video stream or file" << endl;
    return -1;
  }
     
  while(1){
 
    Mat frame;
    // Capture frame-by-frame
    cap >> frame;
 
    // If the frame is empty, break immediately
    if (frame.empty())
      break;
 
    // Display the resulting frame
    imshow( "Frame", frame );
    
    // Press  ESC on keyboard to exit
    char c=(char)waitKey(1);
    if(c==27)
      break;
  }
 
  // When everything done, release the video capture object
  cap.release();
 
  // Closes all the frames
  destroyAllWindows();

    return 0;
}

please help.

thanks

0 Kudos