bytedeco / javacv

Java interface to OpenCV, FFmpeg, and more
Other
7.42k stars 1.57k forks source link

Error on InputStream.read(): java.io.IOException: closed #2049

Open ulde1 opened 1 year ago

ulde1 commented 1 year ago

When I use FFmpegFrameGrabber(InputStream) and the InputStream is closed, I only get the message on stderr: Error on InputStream.read(): java.io.IOException: closed FFmpegFrameGrabber#grab then still waits in line 1454 pkt.stream_index(-1); infinitly.

I would appreciate, if FFmpegFrameGrabber#grab would return a null Frame, so I can take appropriate action. Even better would be, if FFmpegFrameGrabber#grab throws that java.io.IOException.

saudet commented 1 year ago

Duplicate of #1892

saudet commented 1 year ago

That appears to be caused by some bug in JNI, but someone would need to debug this...

saudet commented 1 year ago

Could you try this on another platform with another JVM such as Android and see if the same thing happens? If this only occurs with Java SE, this will at least indicate to us that this is an issue with the JDK that we can report upstream.