Skip to content

Commit

Permalink
* Retry after 10 ms when av_read_frame() returns EAGAIN in `FFmp…
Browse files Browse the repository at this point in the history
…egFrameGrabber.grabFrame()` (issue #1784)

 * Upgrade dependencies for OpenBLAS 0.3.20, Tesseract 5.1.0
  • Loading branch information
saudet committed Mar 29, 2022
1 parent c78b0f1 commit 8d75c0a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@

* Retry after 10 ms when `av_read_frame()` returns `EAGAIN` in `FFmpegFrameGrabber.grabFrame()` ([issue #1784](https://github.com/bytedeco/javacv/issues/1784))
* Append `frame_rate=%d/%d` input parameter in `FFmpegFrameFilter` as required by `xfade` ([issue #1776](https://github.com/bytedeco/javacv/issues/1776))
* Update `FFmpegStreamingTimeout` sample to use `timeout` instead of `stimeout` for RTSP ([pull #1758](https://github.com/bytedeco/javacv/pull/1758))
* Restore static calls to `FFmpegFrameGrabber.tryLoad()` and `FFmpegFrameRecorder.tryLoad()` ([issue #1756](https://github.com/bytedeco/javacv/issues/1756))
* Enable by default on `RealSense2FrameGrabber.start()` all color, depth, and IR streams as `videoStream` ([pull #1750](https://github.com/bytedeco/javacv/pull/1750))
* Upgrade dependencies for OpenBLAS 0.3.20, Tesseract 5.1.0

### February 11, 2022 version 1.5.7
* Fix accuracy and latency issues with `FFmpegFrameGrabber.setVideoFrameNumber()` ([pull #1734](https://github.com/bytedeco/javacv/pull/1734))
Expand Down
4 changes: 2 additions & 2 deletions platform/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>openblas-platform</artifactId>
<version>0.3.19-${javacpp.version}</version>
<version>0.3.20-${javacpp.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco</groupId>
Expand Down Expand Up @@ -93,7 +93,7 @@
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>tesseract-platform</artifactId>
<version>5.0.1-${javacpp.version}</version>
<version>5.1.0-${javacpp.version}</version>
</dependency>

<dependency>
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>openblas</artifactId>
<version>0.3.19-${javacpp.version}</version>
<version>0.3.20-${javacpp.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco</groupId>
Expand Down Expand Up @@ -135,7 +135,7 @@
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>tesseract</artifactId>
<version>5.0.1-${javacpp.version}</version>
<version>5.1.0-${javacpp.version}</version>
</dependency>

<dependency>
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/org/bytedeco/javacv/FFmpegFrameGrabber.java
Original file line number Diff line number Diff line change
Expand Up @@ -1351,8 +1351,19 @@ public synchronized Frame grabFrame(boolean doAudio, boolean doVideo, boolean do
if (pkt.stream_index() != -1) {
// Free the packet that was allocated by av_read_frame
av_packet_unref(pkt);
pkt.stream_index(-1);
}
if ((ret = av_read_frame(oc, pkt)) < 0) {
if (ret == AVERROR_EAGAIN()) {
try {
Thread.sleep(10);
continue;
} catch (InterruptedException ex) {
// reset interrupt to be nice
Thread.currentThread().interrupt();
return null;
}
}
if (doVideo && video_st != null) {
// The video codec may have buffered some frames
pkt.stream_index(video_st.index());
Expand Down

0 comments on commit 8d75c0a

Please sign in to comment.