Skip to content

fix OutOfMemory bug#15

Open
hnvn wants to merge 17 commits into
bytedeco:masterfrom
hnvn:android
Open

fix OutOfMemory bug#15
hnvn wants to merge 17 commits into
bytedeco:masterfrom
hnvn:android

Conversation

@hnvn

@hnvn hnvn commented May 14, 2017

Copy link
Copy Markdown
Contributor

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

@saudet

saudet commented May 14, 2017

Copy link
Copy Markdown
Member

Sounds good, but please resolve the conflicts! Thanks

@saudet

saudet commented May 21, 2017

Copy link
Copy Markdown
Member

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

hnvn commented May 21, 2017

Copy link
Copy Markdown
Contributor Author

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

@saudet

saudet commented May 21, 2017

Copy link
Copy Markdown
Member

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

@hnvn

hnvn commented May 22, 2017

Copy link
Copy Markdown
Contributor Author

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

saudet commented May 22, 2017

Copy link
Copy Markdown
Member

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

hnvn commented May 22, 2017

Copy link
Copy Markdown
Contributor Author

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

@saudet

saudet commented May 22, 2017

Copy link
Copy Markdown
Member

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

hnvn commented May 22, 2017

Copy link
Copy Markdown
Contributor Author

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

saudet commented May 22, 2017

Copy link
Copy Markdown
Member

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

hnvn commented May 22, 2017

Copy link
Copy Markdown
Contributor Author

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

@saudet

saudet commented Sep 9, 2017

Copy link
Copy Markdown
Member

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