Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memory goes up with videocapture read images from rtsp stream #455

Closed
XuqxMaritech opened this issue Nov 26, 2015 · 2 comments
Closed

memory goes up with videocapture read images from rtsp stream #455

XuqxMaritech opened this issue Nov 26, 2015 · 2 comments
Labels

Comments

@XuqxMaritech
Copy link

Hello! I am using opencv 3.0 beta with visual studio 2013 under windows 7 and 64bit. I downloaded opencv3.0 beta for windows from http://opencv.org/downloads.html.
The following is the code I am using to capture the video from rtsp stream and then save some frames every several minutes. It has no problem to capture and read the stream. But I found, the function "read(InputArrray Image)" cause the memory leak. The memory goes up slowly, about one MB for two or three hours. But it keep going up. I am using it for severy months continually. so it is seriouly problem for me. The following is my code for test. Please help me find out where is my problem with these code. Thanks a lot!

 int main()
 {
 string fileNameSave;
 string URLName;
BOOL stop = FALSE;
BOOL saveFrame = TRUE;
BOOL got_frame = FALSE;
string fileSave = "saveFrame.jpg";
URLName = "rtsp://username:password@IP adress:554/h264/ch1/main/av_stream";
VideoCapture capture;
Mat frame;
capture.open(URLName);
if (!capture.isOpened()){
    cout << " channel 1st has error " << endl;
}
while (!stop){  
    got_frame = capture.read(frame); //here the memory keep goes up
    //save the frame every minute locally
    if (saveFrame == TRUE){
        if (got_frame){
            imwrite(fileSave, frame);
        }
    }
}
capture.release();
return 0;


}
@mshabunin
Copy link
Contributor

Duplicate of opencv/opencv#5715, not related to contrib.

@XuqxMaritech
Copy link
Author

I have downloaded the newest release for Opencv, Currently, it is stable without memory going up.

Thanks a lot!

xuqx

From: Maksim Shabunin
Date: 2015-12-03 17:21
To: Itseez/opencv_contrib
CC: XuqxMaritech
Subject: [SPAM] [Disarmed] Re: [opencv_contrib] memory goes up with videocapture read images from rtsp stream (#455)
Closed #455.

Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants