From 2d3bb0c5c836d4df755bfcb62accd920f4fc2f4c Mon Sep 17 00:00:00 2001 From: 0xb00bface <0xboobface@gmail.com> Date: Wed, 7 Oct 2020 21:14:15 +0200 Subject: [PATCH] Add possibility to define the contactsheet file name with variables --- CHANGELOG.md | 1 + .../ctbrec/recorder/postprocessing/CreateContactSheet.java | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e09299de..135339f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * Fix: Stripchat models with @ in their name were not recorded * Fix: Camsoda browsing, the "New" tab is gone though. The information is not available anymore +* You can now use variable to define the contactsheet file name 3.10.0 ======================== diff --git a/common/src/main/java/ctbrec/recorder/postprocessing/CreateContactSheet.java b/common/src/main/java/ctbrec/recorder/postprocessing/CreateContactSheet.java index e99eb4a8..392f9872 100644 --- a/common/src/main/java/ctbrec/recorder/postprocessing/CreateContactSheet.java +++ b/common/src/main/java/ctbrec/recorder/postprocessing/CreateContactSheet.java @@ -58,7 +58,7 @@ public class CreateContactSheet extends AbstractPlaceholderAwarePostProcessor { color}, new StringBuffer(), null).toString(); File executionDir = rec.getPostProcessedFile().isDirectory() ? rec.getPostProcessedFile() : rec.getPostProcessedFile().getParentFile(); - File output = new File(executionDir, filename); + File output = new File(executionDir, fillInPlaceHolders(filename, rec, config)); File input = getInputFile(rec); String[] args = { @@ -80,9 +80,10 @@ public class CreateContactSheet extends AbstractPlaceholderAwarePostProcessor { }; String[] cmdline = OS.getFFmpegCommand(args); LOG.info("Executing {} in working directory {}", Arrays.toString(cmdline), executionDir); - Process ffmpeg = Runtime.getRuntime().exec(cmdline, new String[0], executionDir); + Process ffmpeg = Runtime.getRuntime().exec(cmdline, OS.getEnvironment(), executionDir); int exitCode = 1; File ffmpegLog = File.createTempFile("create_contact_sheet_" + rec.getId() + '_', ".log"); + ffmpegLog.deleteOnExit(); try (FileOutputStream mergeLogStream = new FileOutputStream(ffmpegLog)) { Thread stdout = new Thread(new StreamRedirectThread(ffmpeg.getInputStream(), mergeLogStream)); Thread stderr = new Thread(new StreamRedirectThread(ffmpeg.getErrorStream(), mergeLogStream));