简体   繁体   中英

stream video in OpenCV

I am running a simple OpenCV program on the beaglebone, for debugging purposes i would like to see a stream of the output. i have tried to do this in the command line

./myprog | avconv -f rawvideo -pix_fmt bgr24 -s 160x90 -r 30 -i - -an -f mpegts udp://192.168.7.1:1234

I am using VLC to play the udp stream on my laptop, but this does not seem to work,I am wondering what other ways i can achieve this, any help would be apreciated.

and my program is simply,

int main()
{
    VideoCapture capture(0);
   if(!capture.isOpened()){
        cout << "Failed to connect to the camera." << endl;
    }
    for(;;)
    {
    Mat frame;
    capture >> frame;
        if(frame.empty()){
        cout << "Failed to capture an image" << endl;
        return -1;
        }
    cout << frame.data;
    return 0;
}

您没有关闭for循环的括号。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM