bytedeco / javacv

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

1.5.7 grabImage hanging 1min #2037

Open syschen opened 1 year ago

syschen commented 1 year ago

hi @saudet

I'm grabbing images from a live streaming, But the data tracker shows the GAP between keyframes and also happens in other frames,

Any ideas why?

CODE: while ((frame = grabber.grabImage()) != null) { if (!frame.keyFrame) { logEvent("FrameTypeCount", "NonKeyFrame"); continue; } logEvent("FrameTypeCount", "KeyFrame"); }

KeyFrame Tracker:
image

NonKeyFrame Tracker: image

early version 1.5.4 shows like this: image image

saudet commented 1 year ago

Please make sure that FFmpegLogCallback.set() has been called and check for any warning messages.

syschen commented 1 year ago

image

Just Normal messages.

Tricky is this problem only happens in prod,In dev everything is just fine(both 1.5.4 and 1.5.7 , same os CentOS 7.6.1810).

And In prod we rollback our app to 1.5.4 the gap can dispear.

image

saudet commented 1 year ago

Sounds like something that might be related to garbage collection. Make sure it's not causing any signification latency.

syschen commented 1 year ago

Sounds like something that might be related to garbage collection. Make sure it's not causing any signification latency.

Metric system shows no fullgc or CPU usage or IO lag problems. -_-!

saudet commented 1 year ago

Can you try again with JavaCV 1.5.9?

saudet commented 1 year ago

Please try again with the snapshots: http://bytedeco.org/builds/