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

After FFmpegFrameGrabber .close() ,The file is still occupied #1233

Closed
JiGuangYuan opened this issue Jun 21, 2019 · 4 comments
Closed

After FFmpegFrameGrabber .close() ,The file is still occupied #1233

JiGuangYuan opened this issue Jun 21, 2019 · 4 comments

Comments

@JiGuangYuan
Copy link

Code like this


 FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(new File("xxxx"));
        try {
            grabber.start();

        } catch (FrameGrabber.Exception e) {
            e.printStackTrace();
        }
.........
        try {
            grabber.close();
        } catch (FrameGrabber.Exception e) {
            e.printStackTrace();
        }

After FFmpegFrameGrabber .close() ,I can't delete this file.Prompt me that my file is occupied.
use JavaCV 1.5 ,Jdk 1.8

@saudet
Copy link
Member

saudet commented Jun 21, 2019

I cannot reproduce this issue here on Windows 10. This code delete the file just fine for me:

File f = new File("video.mp4");
FFmpegFrameGrabber g = new FFmpegFrameGrabber(f);
g.start();
g.close();
f.delete();

This is probably caused by a faulty antivirus software. Please make sure to disable all malware scanners.

@JiGuangYuan
Copy link
Author

I'm sorry.I double-checked the code, I found somewhere I invoke Twice start() ,then invoke close() ,The file is still occupied。

@saudet
Copy link
Member

saudet commented Jun 21, 2019

I see, we should add a check for that.

saudet added a commit that referenced this issue Jun 24, 2019
…r`, `FFmpegFrameGrabber`, or `FFmpegFrameRecorder` (issue #1233)
@saudet
Copy link
Member

saudet commented Jul 10, 2019

The check is now included in JavaCV 1.5.1. Thanks for reporting!

@saudet saudet closed this as completed Jul 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants