From a26f40df8e81637eabe5f480dd8313c4ad8f67d1 Mon Sep 17 00:00:00 2001 From: Tobi Delbruck Date: Sat, 16 Mar 2024 12:33:54 +0100 Subject: [PATCH] fixed JaerAviWriter to ensure that active rendering (rather than requesting repaint) is on while writing a movie. Otherwise frames can be dropped from output video. --- src/net/sf/jaer/util/avioutput/JaerAviWriter.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/net/sf/jaer/util/avioutput/JaerAviWriter.java b/src/net/sf/jaer/util/avioutput/JaerAviWriter.java index d4761b899..722124d50 100644 --- a/src/net/sf/jaer/util/avioutput/JaerAviWriter.java +++ b/src/net/sf/jaer/util/avioutput/JaerAviWriter.java @@ -65,6 +65,10 @@ public void annotate(GLAutoDrawable drawable) { } if (isRecordingActive() && isWriteEnabled() && writeFrameNowFlag) { + if(!chip.getAeViewer().isActiveRenderingEnabled()){ + chip.getAeViewer().setActiveRenderingEnabled(true); + showPlainMessageDialogInSwingThread("Set active rendering enabled (View/View/Filtering options) to ensure that each frame is painted", "Active rendering enabled"); + } GL2 gl = drawable.getGL().getGL2(); BufferedImage bi = toImage(gl, drawable.getNativeSurface().getSurfaceWidth(), drawable.getNativeSurface().getSurfaceHeight()); int timecode = chip.getAeViewer().getAePlayer().getTime(); @@ -72,6 +76,8 @@ public void annotate(GLAutoDrawable drawable) { writeFrameNowFlag=false; // TODO move to super } } + + /** * @return the showTimeFactor