Ask Your Question
0

Opencv rtsp stream synchronize problem help!

asked 2014-03-25 20:41:25 -0500

updated 2014-03-26 03:07:46 -0500

berak gravatar image

sorry about my lower english I'm south korean, but I think you can read it

When i get H.264 video stream with RTSP, I have prablem with getting decend image.

In code

I use cvWaitKey(1) 1~100 for synchronize cameras buffer and cvQueryFrame()

I think this problem is just TIME problem But I don't know how get signal of Camera's buffer is written.

int cnt = 0;
int count = 0;
IplImage *img[MAXCAM];
CvCapture *camera[MAXCAM]; 
CString numFrame[MAXCAM];

/// 임의 영역 
//camera[0] = cvCreateFileCapture("rtsp://127.0.0.1:951/everyone"); 
//camera[1] = cvCreateFileCapture("rtsp://admin:admin@192.168.100.80:554/channel1"); 
camera[0] = cvCreateFileCapture("rtsp://admin:admin@192.168.100.80:554/channel1"); 
camera[1] = cvCreateFileCapture("rtsp://127.0.0.1:951/everyone"); 


for (cnt = 0 ; cnt<MAXCAM; cnt++ ) {
    if (camera[cnt] == NULL) {
        return -1;
    }
    numFrame[cnt].Format("CAM %d", cnt);
    cvNamedWindow(numFrame[cnt]);;
}   

while (cvWaitKey(1) != 27) {        /// cvWaitKey 가 보내주는 bitrate 에 맞추어 출력하지 못할경우 이미지 일그러짐 현상 
    //for ( cnt = 0; cnt < MAXCAM ; cnt ++ ) {
        img[1] = cvQueryFrame(camera[1]); 
        //if (img[cnt] == NULL)  
        //  return -2;          
        cvShowImage(numFrame[1], img[1]);
    //}
}

for (cnt = 0; cnt < MAXCAM; cnt++) {
    cvReleaseCapture(&camera[cnt]);
    cvReleaseImage(&img[cnt]);
}
return 0;
edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted
0

answered 2014-06-12 10:59:45 -0500

boris gravatar image

hi, i have the same problem, do you have an answer?

edit flag offensive delete link more
0

answered 2014-05-23 07:53:38 -0500

RafaelTSCS gravatar image

Hello!

Is your problem the same as mine?

Have you managed to solve it? If so, what did you do?

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

Stats

Asked: 2014-03-25 20:41:25 -0500

Seen: 830 times

Last updated: Jun 12 '14