From d4b9554b74fbcf22619cf32a9262324de8f3763b Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Sun, 27 Jun 2021 11:10:56 -0400 Subject: [PATCH] moving more of the QT bits into its own area --- .../src/processing/app/tools/MovieMaker.java | 36 ++++-------------- .../processing/app/tools/QuickTimeEngine.java | 38 ++++++++++++++++--- 2 files changed, 40 insertions(+), 34 deletions(-) diff --git a/build/shared/tools/MovieMaker/src/processing/app/tools/MovieMaker.java b/build/shared/tools/MovieMaker/src/processing/app/tools/MovieMaker.java index d45a59cbe..d06d9e895 100644 --- a/build/shared/tools/MovieMaker/src/processing/app/tools/MovieMaker.java +++ b/build/shared/tools/MovieMaker/src/processing/app/tools/MovieMaker.java @@ -28,37 +28,14 @@ import ch.randelshofer.gui.datatransfer.FileTextFieldTransferHandler; /** - * Hacked from Werner Randelshofer's QuickTimeWriter demo. The original version - * can be found here. - *

- * A more up-to-date version of the project is - * here. - * Problem is, it's too big, so we don't want to merge it into our code. - *

- * Broken out as a separate project because the license (CC) probably isn't - * compatible with the rest of Processing and we don't want any confusion. - *

- * Added JAI ImageIO to support lots of other image file formats [131008]. - * Also copied the Processing TGA implementation. - *

- * Added support for the gamma ('gama') atom [131008]. - *

- * A few more notes on the implementation: - *

- * Ben Fry 2011-09-06, updated 2013-10-09 + * Tool for creating movie files from sequences of images. + * Originally hacked from Werner Randelshofer's QuickTimeWriter demo, + * reorganized for Processing 4 to instead use FFmpeg. */ public class MovieMaker extends JFrame implements Tool { private Preferences prefs; - private QuickTimeEngine engine; + //private QuickTimeEngine engine; + private FFmpegEngine engine; public String getMenuTitle() { @@ -72,7 +49,8 @@ public class MovieMaker extends JFrame implements Tool { public void init(Base base) { - engine = new QuickTimeEngine(this); + //engine = new QuickTimeEngine(this); + engine = new FFmpegEngine(this); initComponents(base.getActiveEditor() == null); ((JComponent) getContentPane()).setBorder(new EmptyBorder(12, 18, 18, 18)); diff --git a/build/shared/tools/MovieMaker/src/processing/app/tools/QuickTimeEngine.java b/build/shared/tools/MovieMaker/src/processing/app/tools/QuickTimeEngine.java index 17becab7d..0625f3777 100644 --- a/build/shared/tools/MovieMaker/src/processing/app/tools/QuickTimeEngine.java +++ b/build/shared/tools/MovieMaker/src/processing/app/tools/QuickTimeEngine.java @@ -19,6 +19,39 @@ import ch.randelshofer.media.mp3.MP3AudioInputStream; import ch.randelshofer.media.quicktime.QuickTimeWriter; +/** + * Code that's specific to the original QuickTime writer, which no longer + * works on macOS 10.15 and later, because Apple has removed support for + * most compression types (Animation, etc) that are not MPEG. + *

+ * Originally hacked from Werner Randelshofer's QuickTimeWriter demo. + * That source code can be found here. + *

+ * A more up-to-date version of the project is + * here. + * Problem is, it's too big, so we don't want to merge it into our code. + *

+ * Broken out as a separate project because the license (CC) probably isn't + * compatible with the rest of Processing and we don't want any confusion. + *

+ * Added JAI ImageIO to support lots of other image file formats [131008]. + * Also copied the Processing TGA implementation. + *

+ * Added support for the gamma ('gama') atom [131008]. + *

+ * A few more notes on the implementation: + *

+ * Ben Fry 2011-09-06, updated 2013-10-09, and again on 2021-06-27 + */ class QuickTimeEngine { Component parent; @@ -216,13 +249,8 @@ class QuickTimeEngine { if (prevImgDuration != 0) { qtOut.writeFrame(0, prevImg, prevImgDuration); } -// if (streaming.equals("fastStart")) { -// qtOut.toWebOptimizedMovie(movieFile, false); -// tmpFile.delete(); -// } else if (streaming.equals("fastStartCompressed")) { qtOut.toWebOptimizedMovie(movieFile, true); tmpFile.delete(); -// } qtOut.close(); qtOut = null; } finally {