forked from j62/ctbrec
Merge branch 'dev' into v4
# Conflicts: # common/src/main/java/ctbrec/recorder/FFmpeg.java
This commit is contained in:
commit
500be5eee4
|
@ -43,6 +43,7 @@
|
||||||
|
|
||||||
<logger name="ctbrec.LoggingInterceptor" level="info"/>
|
<logger name="ctbrec.LoggingInterceptor" level="info"/>
|
||||||
<logger name="ctbrec.io.CookieJarImpl" level="INFO"/>
|
<logger name="ctbrec.io.CookieJarImpl" level="INFO"/>
|
||||||
|
<logger name="ctbrec.recorder.FFmpeg" level="DEBUG"/>
|
||||||
<logger name="ctbrec.recorder.OnlineMonitor" level="INFO"/>
|
<logger name="ctbrec.recorder.OnlineMonitor" level="INFO"/>
|
||||||
<logger name="ctbrec.recorder.RecordingFileMonitor" level="TRACE"/>
|
<logger name="ctbrec.recorder.RecordingFileMonitor" level="TRACE"/>
|
||||||
<logger name="ctbrec.recorder.download.dash.DashDownload" level="DEBUG"/>
|
<logger name="ctbrec.recorder.download.dash.DashDownload" level="DEBUG"/>
|
||||||
|
|
|
@ -56,6 +56,7 @@ public class Settings {
|
||||||
public String colorBase = "#FFFFFF";
|
public String colorBase = "#FFFFFF";
|
||||||
public int concurrentRecordings = 0;
|
public int concurrentRecordings = 0;
|
||||||
public boolean confirmationForDangerousActions = false;
|
public boolean confirmationForDangerousActions = false;
|
||||||
|
public String contactsheetTimestampLook = "font=sans-serif:fontcolor=white:fontsize=60:box=1:boxcolor=black@0.5:boxborderw=5";
|
||||||
public boolean determineResolution = false;
|
public boolean determineResolution = false;
|
||||||
public List<String> disabledSites = new ArrayList<>();
|
public List<String> disabledSites = new ArrayList<>();
|
||||||
public String downloadFilename = "${modelSanitizedName}-${localDateTime}";
|
public String downloadFilename = "${modelSanitizedName}-${localDateTime}";
|
||||||
|
|
|
@ -4,6 +4,7 @@ import static java.util.concurrent.TimeUnit.*;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
@ -37,7 +38,9 @@ public class ProcessStreamRedirector implements Runnable {
|
||||||
executor.schedule(this, 100, MILLISECONDS);
|
executor.schedule(this, 100, MILLISECONDS);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOG.debug("Error while reading from process output stream: {}", e.getLocalizedMessage());
|
if (!Objects.equals(e.getMessage(), "Stream Closed")) {
|
||||||
|
LOG.debug("Error while reading from process output stream: {}", e.getLocalizedMessage(), e);
|
||||||
|
}
|
||||||
keepGoing = false;
|
keepGoing = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ public class FFmpeg {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void exec(String[] cmdline, String[] env, File executionDir) throws IOException {
|
public void exec(String[] cmdline, String[] env, File executionDir) throws IOException {
|
||||||
LOG.debug("FFmpeg command line: {}", Arrays.toString(cmdline));
|
LOG.trace("FFmpeg command line: {}", Arrays.toString(cmdline));
|
||||||
process = Runtime.getRuntime().exec(cmdline, env, executionDir);
|
process = Runtime.getRuntime().exec(cmdline, env, executionDir);
|
||||||
afterStart();
|
afterStart();
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ public class FFmpeg {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void shutdown(int exitCode) throws IOException {
|
public void shutdown(int exitCode) throws IOException {
|
||||||
LOG.debug("FFmpeg exit code was {}", exitCode);
|
LOG.trace("FFmpeg exit code was {}", exitCode);
|
||||||
ffmpegLogStream.flush();
|
ffmpegLogStream.flush();
|
||||||
ffmpegLogStream.close();
|
ffmpegLogStream.close();
|
||||||
stdoutRedirector.setKeepGoing(false);
|
stdoutRedirector.setKeepGoing(false);
|
||||||
|
@ -77,7 +77,7 @@ public class FFmpeg {
|
||||||
if (ffmpegLog == null) {
|
if (ffmpegLog == null) {
|
||||||
ffmpegLog = File.createTempFile("ffmpeg_", ".log");
|
ffmpegLog = File.createTempFile("ffmpeg_", ".log");
|
||||||
}
|
}
|
||||||
LOG.debug("Logging FFmpeg output to {}", ffmpegLog);
|
LOG.trace("Logging FFmpeg output to {}", ffmpegLog);
|
||||||
ffmpegLog.deleteOnExit();
|
ffmpegLog.deleteOnExit();
|
||||||
ffmpegLogStream = new FileOutputStream(ffmpegLog);
|
ffmpegLogStream = new FileOutputStream(ffmpegLog);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -78,7 +78,7 @@ public class CreateContactSheet extends AbstractPlaceholderAwarePostProcessor {
|
||||||
output.getCanonicalPath()
|
output.getCanonicalPath()
|
||||||
};
|
};
|
||||||
String[] cmdline = OS.getFFmpegCommand(args);
|
String[] cmdline = OS.getFFmpegCommand(args);
|
||||||
LOG.debug("Executing {} in working directory {}", Arrays.toString(cmdline), executionDir);
|
LOG.trace("Executing {} in working directory {}", Arrays.toString(cmdline), executionDir);
|
||||||
File ffmpegLog = new File(System.getProperty("java.io.tmpdir"), "create_contact_sheet_" + rec.getId() + ".log");
|
File ffmpegLog = new File(System.getProperty("java.io.tmpdir"), "create_contact_sheet_" + rec.getId() + ".log");
|
||||||
FFmpeg ffmpeg = new FFmpeg.Builder()
|
FFmpeg ffmpeg = new FFmpeg.Builder()
|
||||||
.logOutput(config.getSettings().logFFmpegOutput)
|
.logOutput(config.getSettings().logFFmpegOutput)
|
||||||
|
@ -102,6 +102,7 @@ public class CreateContactSheet extends AbstractPlaceholderAwarePostProcessor {
|
||||||
int numberOfThumbs = rows * cols;
|
int numberOfThumbs = rows * cols;
|
||||||
long lengthInSeconds = rec.getLength().getSeconds();
|
long lengthInSeconds = rec.getLength().getSeconds();
|
||||||
double thumbnailInterval = lengthInSeconds / (double)numberOfThumbs;
|
double thumbnailInterval = lengthInSeconds / (double)numberOfThumbs;
|
||||||
|
String timestampLook = config.getSettings().contactsheetTimestampLook;
|
||||||
|
|
||||||
NumberFormat nf = new DecimalFormat("000");
|
NumberFormat nf = new DecimalFormat("000");
|
||||||
for (int i = 0; i < numberOfThumbs; i++) {
|
for (int i = 0; i < numberOfThumbs; i++) {
|
||||||
|
@ -114,8 +115,7 @@ public class CreateContactSheet extends AbstractPlaceholderAwarePostProcessor {
|
||||||
int minutes = (int) (startTimeInSeconds % 3600 / 60);
|
int minutes = (int) (startTimeInSeconds % 3600 / 60);
|
||||||
int seconds = (int) (startTimeInSeconds % 60);
|
int seconds = (int) (startTimeInSeconds % 60);
|
||||||
String timestamp = String.format("%02d\\:%02d\\:%02d", hours, minutes, seconds);
|
String timestamp = String.format("%02d\\:%02d\\:%02d", hours, minutes, seconds);
|
||||||
videoFilter += ",drawtext='text=" + timestamp
|
videoFilter += ",drawtext='text=" + timestamp + ":" + timestampLook + ":x=(w-text_w-20):y=(h-text_h-20)'";
|
||||||
+ ":fontcolor=white:fontsize=48:box=1:boxcolor=black@0.5:boxborderw=5:x=(w-text_w-20):y=(h-text_h-20)'";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
File input = getInputFile(rec);
|
File input = getInputFile(rec);
|
||||||
|
@ -135,7 +135,7 @@ public class CreateContactSheet extends AbstractPlaceholderAwarePostProcessor {
|
||||||
output.getCanonicalPath()
|
output.getCanonicalPath()
|
||||||
};
|
};
|
||||||
String[] cmdline = OS.getFFmpegCommand(args);
|
String[] cmdline = OS.getFFmpegCommand(args);
|
||||||
LOG.info("Executing {} in working directory {}", Arrays.toString(cmdline), executionDir);
|
LOG.trace("Executing {} in working directory {}", Arrays.toString(cmdline), executionDir);
|
||||||
|
|
||||||
FFmpeg ffmpeg = new FFmpeg.Builder()
|
FFmpeg ffmpeg = new FFmpeg.Builder()
|
||||||
.logOutput(config.getSettings().logFFmpegOutput)
|
.logOutput(config.getSettings().logFFmpegOutput)
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
<logger name="ctbrec.LoggingInterceptor" level="INFO"/>
|
<logger name="ctbrec.LoggingInterceptor" level="INFO"/>
|
||||||
<logger name="ctbrec.io.CookieJarImpl" level="INFO"/>
|
<logger name="ctbrec.io.CookieJarImpl" level="INFO"/>
|
||||||
<logger name="ctbrec.recorder.Chaturbate" level="INFO" />
|
<logger name="ctbrec.recorder.Chaturbate" level="INFO" />
|
||||||
|
<logger name="ctbrec.recorder.FFmpeg" level="DEBUG"/>
|
||||||
<logger name="ctbrec.recorder.OnlineMonitor" level="INFO"/>
|
<logger name="ctbrec.recorder.OnlineMonitor" level="INFO"/>
|
||||||
<logger name="ctbrec.recorder.server.HlsServlet" level="INFO"/>
|
<logger name="ctbrec.recorder.server.HlsServlet" level="INFO"/>
|
||||||
<logger name="ctbrec.recorder.server.RecorderServlet" level="INFO"/>
|
<logger name="ctbrec.recorder.server.RecorderServlet" level="INFO"/>
|
||||||
|
|
Loading…
Reference in New Issue