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
551 Views
Registered: ‎09-25-2018

x11 forwarding video clip

Jump to solution

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
1 Solution

Accepted Solutions
Highlighted
Adventurer
Adventurer
245 Views
Registered: ‎09-25-2018

Re: x11 forwarding video clip

Jump to solution

Hi @yisonglee 

it is not a problem with x11, if you use zynqmp with display port you will face to the same problem. this problem is regarding with liav and ffmpeg, please refer this answer given by Sandeepg. I didnt do the third step in this method but it worked without that step. please read that thread top to bottom, I used this method for ultra96 board and zedboard. wish you the very best.

 

0 Kudos
4 Replies
Visitor yisonglee
Visitor
251 Views
Registered: ‎07-02-2019

Re: x11 forwarding video clip

Jump to solution

Hi,I encounted the same problem with you. My video cannot be opened by VideoCapture open(). Can you give me some advice? Thanks.

0 Kudos
Highlighted
Adventurer
Adventurer
246 Views
Registered: ‎09-25-2018

Re: x11 forwarding video clip

Jump to solution

Hi @yisonglee 

it is not a problem with x11, if you use zynqmp with display port you will face to the same problem. this problem is regarding with liav and ffmpeg, please refer this answer given by Sandeepg. I didnt do the third step in this method but it worked without that step. please read that thread top to bottom, I used this method for ultra96 board and zedboard. wish you the very best.

 

0 Kudos
Visitor yisonglee
Visitor
223 Views
Registered: ‎07-02-2019

Re: x11 forwarding video clip

Jump to solution

Hi @1ymw1 


My board is ZCU102 zynqmp. As your suggest, i download gst-libav-1.12.2.tar.xz and place it in the petalinux2018.2 path. Then i did as Sandeepg's solution(step1 &step2). Now, my project works perfectly.BTW,  you are god too.  thanks for your really really really kinds help.

Best Regards.

Yisong

Adventurer
Adventurer
210 Views
Registered: ‎09-25-2018

Re: x11 forwarding video clip

Jump to solution

hi @yisonglee 

I am glad that it helped you.

0 Kudos