我编写了一个程序,它从gstreamer管道读取帧,用opencv库处理它们,然后写回gstreamer管道 .

代码段:

cv::VideoCapture cap("v4l2src ! video/x-raw, framerate=30/1, width=640, height=480, format=RGB ! videoconvert ! appsink");
if (!cap.isOpened()) {
    printf("=ERR= can't create video capture\n");
    return -1;
}

cv::VideoWriter writer;
writer.open("appsrc ! videoconvert ! x264enc noise-reduction=10000 tune=zerolatency byte-stream=true threads=4 key-int-max=15 ! mpegtsmux ! udpsink host=localhost port=9999"
            , 0, (double)15, cv::Size(640, 480), true);
if (!writer.isOpened()) {
    printf("=ERR= can't create video writer\n");
    return -1;
}

/* Read/write frames as usual */
// Mat frame
// while true
//     cap >> frame
//     process the frame
//     writer << frame

该程序在我的ubuntu 14.04 64位VM上运行良好 . 但是,当我试图在Jetson TK1上运行它时, VideoCaptureVideoWriter 总是在 isOpened() 上返回 false .

我正在使用Opencv4Tegra,然后我从源代码构建了opencv并安装了它 . 两者都有同样的问题 . 有谁知道为什么VideoCapture无法在Jetson TK1上打开gstreamer管道?是因为它不能在32位机器上运行吗?

请注意,我使用的是Opencv 2.4.13和Gstreamer 1.2以及相机Logitech C310 .