EcEng
EcEng

Reputation: 23

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;
}

Upvotes: 0

Views: 541

Answers (1)

user1505520
user1505520

Reputation: 415

You didn't close the for loop's brackets.

Upvotes: 1

Related Questions