Skip to content

Commit

Permalink
fixed JaerAviWriter to ensure that active rendering (rather than requ…
Browse files Browse the repository at this point in the history
…esting repaint) is on while writing a movie.

Otherwise frames can be dropped from output video.
  • Loading branch information
Tobi Delbruck authored and Tobi Delbruck committed Mar 16, 2024
1 parent 716b46d commit a26f40d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/net/sf/jaer/util/avioutput/JaerAviWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,19 @@ 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();
writeFrame(bi, timecode);
writeFrameNowFlag=false; // TODO move to super
}
}



/**
* @return the showTimeFactor
Expand Down

0 comments on commit a26f40d

Please sign in to comment.