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

fix OutOfMemory bug #15

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open

fix OutOfMemory bug #15

wants to merge 17 commits into from

Conversation

hnvn
Copy link
Contributor

@hnvn hnvn commented May 14, 2017

I've removed FfmpegFrameFilter out of my project order to tackle OutOfMemory problem

@saudet
Copy link
Member

saudet commented May 14, 2017

Sounds good, but please resolve the conflicts! Thanks

@saudet
Copy link
Member

saudet commented May 21, 2017

Could you somehow make the changes optional, by leaving it up to the user to use either FFmpeg or OpenCV via a static boolean flag, for example? It would be nice to keep both code examples.

@hnvn
Copy link
Contributor Author

hnvn commented May 21, 2017

My OutOfMemory problem comes from FFmpegFrameFilter, I don't know how to fix this bug if still using FFmpeg.

@saudet
Copy link
Member

saudet commented May 21, 2017

That's fine, it might be a bug in JavaCV :)

@hnvn
Copy link
Contributor Author

hnvn commented May 22, 2017

Another reason, I implement CvCameraPreview tend to use with OpenCV, so it should only depend on OpenCV library. FFmpeg is a quite big library. Keep my class independents on FFmpeg help me reduce my application size.

@saudet
Copy link
Member

saudet commented May 22, 2017

That's fine, I would just like to keep the example code somewhere for others to reference, that's all! Maybe as a separate class or something. What do you think?

@hnvn
Copy link
Contributor Author

hnvn commented May 22, 2017

I don't think my old code with FFmpeg is a good practice.

@saudet
Copy link
Member

saudet commented May 22, 2017

Why not? Some people may simply want to record all the frames into a video file, in which case we would not need OpenCV, so it makes sense to do it with FFmpeg in that case.

@hnvn
Copy link
Contributor Author

hnvn commented May 22, 2017

No, I mean my code with FFmpeg is not good enough to be an example because it still contains bugs. I don't want to expose the code contain bugs for everyone.

@saudet
Copy link
Member

saudet commented May 22, 2017

Ah, I see what is wrong. We should move the call to filter.start() right after filter.setPixelFormat(AV_PIX_FMT_NV21), and the one to filter.stop() right before filter.release(). That should fix the memory issue.

@hnvn
Copy link
Contributor Author

hnvn commented May 22, 2017

Ok, I will try, test and get back to you soon.

@saudet
Copy link
Member

saudet commented Sep 9, 2017

Any updates? Have you had some time to check it out?

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

Successfully merging this pull request may close these issues.

2 participants