forked from j62/ctbrec
Remove unused postProcessing setting
This commit is contained in:
parent
b8ffdb32ce
commit
93deeb3e52
|
@ -8,7 +8,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ctbrec</groupId>
|
<groupId>ctbrec</groupId>
|
||||||
<artifactId>master</artifactId>
|
<artifactId>master</artifactId>
|
||||||
<version>3.9.0</version>
|
<version>3.10.0</version>
|
||||||
<relativePath>../master</relativePath>
|
<relativePath>../master</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ctbrec</groupId>
|
<groupId>ctbrec</groupId>
|
||||||
<artifactId>master</artifactId>
|
<artifactId>master</artifactId>
|
||||||
<version>3.9.0</version>
|
<version>3.10.0</version>
|
||||||
<relativePath>../master</relativePath>
|
<relativePath>../master</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,6 @@ public class Settings {
|
||||||
public boolean onlineCheckSkipsPausedModels = false;
|
public boolean onlineCheckSkipsPausedModels = false;
|
||||||
public int overviewUpdateIntervalInSecs = 10;
|
public int overviewUpdateIntervalInSecs = 10;
|
||||||
public String password = ""; // chaturbate password TODO maybe rename this onetime
|
public String password = ""; // chaturbate password TODO maybe rename this onetime
|
||||||
public String postProcessing = "";
|
|
||||||
public int postProcessingThreads = 2;
|
public int postProcessingThreads = 2;
|
||||||
public List<PostProcessor> postProcessors = new ArrayList<>();
|
public List<PostProcessor> postProcessors = new ArrayList<>();
|
||||||
public String proxyHost;
|
public String proxyHost;
|
||||||
|
|
|
@ -1,59 +1,11 @@
|
||||||
package ctbrec.recorder.download;
|
package ctbrec.recorder.download;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import ctbrec.Config;
|
|
||||||
import ctbrec.OS;
|
|
||||||
import ctbrec.Recording;
|
|
||||||
import ctbrec.io.StreamRedirectThread;
|
|
||||||
|
|
||||||
public abstract class AbstractDownload implements Download {
|
public abstract class AbstractDownload implements Download {
|
||||||
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(AbstractDownload.class);
|
|
||||||
|
|
||||||
protected Instant startTime;
|
protected Instant startTime;
|
||||||
|
|
||||||
protected void runPostProcessingScript(Recording recording) throws IOException, InterruptedException {
|
|
||||||
String postProcessing = Config.getInstance().getSettings().postProcessing;
|
|
||||||
if (postProcessing != null && !postProcessing.isEmpty()) {
|
|
||||||
File target = recording.getAbsoluteFile();
|
|
||||||
Runtime rt = Runtime.getRuntime();
|
|
||||||
String[] args = new String[] {
|
|
||||||
postProcessing,
|
|
||||||
target.getParentFile().getAbsolutePath(),
|
|
||||||
target.getAbsolutePath(),
|
|
||||||
getModel().getName(),
|
|
||||||
getModel().getSite().getName(),
|
|
||||||
Long.toString(recording.getStartDate().getEpochSecond())
|
|
||||||
};
|
|
||||||
if(LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("Running {}", Arrays.toString(args));
|
|
||||||
}
|
|
||||||
Process process = rt.exec(args, OS.getEnvironment());
|
|
||||||
// TODO maybe write these to a separate log file, e.g. recname.ts.pp.log
|
|
||||||
Thread std = new Thread(new StreamRedirectThread(process.getInputStream(), System.out));
|
|
||||||
std.setName("Process stdout pipe");
|
|
||||||
std.setDaemon(true);
|
|
||||||
std.start();
|
|
||||||
Thread err = new Thread(new StreamRedirectThread(process.getErrorStream(), System.err));
|
|
||||||
err.setName("Process stderr pipe");
|
|
||||||
err.setDaemon(true);
|
|
||||||
err.start();
|
|
||||||
|
|
||||||
int exitCode = process.waitFor();
|
|
||||||
LOG.debug("Process finished with exit code {}", exitCode);
|
|
||||||
if (exitCode != 0) {
|
|
||||||
throw new ProcessExitedUncleanException("Post-Processing finished with exit code " + exitCode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Instant getStartTime() {
|
public Instant getStartTime() {
|
||||||
return startTime;
|
return startTime;
|
||||||
|
|
|
@ -398,7 +398,6 @@ public class DashDownload extends AbstractDownload {
|
||||||
new FfmpegMuxer(dir, file);
|
new FfmpegMuxer(dir, file);
|
||||||
targetFile = file;
|
targetFile = file;
|
||||||
recording.setPath(path.substring(0, path.length() - 5));
|
recording.setPath(path.substring(0, path.length() - 5));
|
||||||
runPostProcessingScript(recording);
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new PostProcessingException(e);
|
throw new PostProcessingException(e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,12 +125,6 @@ public class FFmpegDownload extends AbstractHlsDownload {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void postprocess(Recording recording) {
|
public void postprocess(Recording recording) {
|
||||||
Thread.currentThread().setName("PP " + model.getName());
|
|
||||||
try {
|
|
||||||
runPostProcessingScript(recording);
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new PostProcessingException(e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -215,7 +215,6 @@ public class HlsDownload extends AbstractHlsDownload {
|
||||||
try {
|
try {
|
||||||
generatePlaylist(recording);
|
generatePlaylist(recording);
|
||||||
recording.setStatusWithEvent(State.POST_PROCESSING);
|
recording.setStatusWithEvent(State.POST_PROCESSING);
|
||||||
runPostProcessingScript(recording);
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new PostProcessingException(e);
|
throw new PostProcessingException(e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -489,12 +489,6 @@ public class MergedFfmpegHlsDownload extends AbstractHlsDownload {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void postprocess(Recording recording) {
|
public void postprocess(Recording recording) {
|
||||||
Thread.currentThread().setName("PP " + model.getName());
|
|
||||||
try {
|
|
||||||
runPostProcessingScript(recording);
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new PostProcessingException(e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void downloadFinishedRecording(String segmentPlaylistUri, File target, ProgressListener progressListener, long sizeInBytes) throws Exception {
|
public void downloadFinishedRecording(String segmentPlaylistUri, File target, ProgressListener progressListener, long sizeInBytes) throws Exception {
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<groupId>ctbrec</groupId>
|
<groupId>ctbrec</groupId>
|
||||||
<artifactId>master</artifactId>
|
<artifactId>master</artifactId>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<version>3.9.0</version>
|
<version>3.10.0</version>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
<module>../common</module>
|
<module>../common</module>
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ctbrec</groupId>
|
<groupId>ctbrec</groupId>
|
||||||
<artifactId>master</artifactId>
|
<artifactId>master</artifactId>
|
||||||
<version>3.9.0</version>
|
<version>3.10.0</version>
|
||||||
<relativePath>../master</relativePath>
|
<relativePath>../master</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,6 @@ public class ConfigServlet extends AbstractCtbrecServlet {
|
||||||
addParameter("maximumResolution", "Maximum Resolution", DataType.INTEGER, settings.maximumResolution, json);
|
addParameter("maximumResolution", "Maximum Resolution", DataType.INTEGER, settings.maximumResolution, json);
|
||||||
addParameter("minimumSpaceLeftInBytes", "Leave Space On Device (GiB)", DataType.LONG, settings.minimumSpaceLeftInBytes, json);
|
addParameter("minimumSpaceLeftInBytes", "Leave Space On Device (GiB)", DataType.LONG, settings.minimumSpaceLeftInBytes, json);
|
||||||
addParameter("onlineCheckIntervalInSecs", "Online Check Interval (secs)", DataType.INTEGER, settings.onlineCheckIntervalInSecs, json);
|
addParameter("onlineCheckIntervalInSecs", "Online Check Interval (secs)", DataType.INTEGER, settings.onlineCheckIntervalInSecs, json);
|
||||||
addParameter("postProcessing", "Post-Processing", DataType.STRING, settings.postProcessing, json);
|
|
||||||
addParameter("postProcessingThreads", "Post-Processing Threads", DataType.INTEGER, settings.postProcessingThreads, json);
|
addParameter("postProcessingThreads", "Post-Processing Threads", DataType.INTEGER, settings.postProcessingThreads, json);
|
||||||
addParameter("recordingsDir", "Recordings Directory", DataType.STRING, settings.recordingsDir, json);
|
addParameter("recordingsDir", "Recordings Directory", DataType.STRING, settings.recordingsDir, json);
|
||||||
addParameter("recordSingleFile", "Record Single File", DataType.BOOLEAN, settings.recordSingleFile, json);
|
addParameter("recordSingleFile", "Record Single File", DataType.BOOLEAN, settings.recordSingleFile, json);
|
||||||
|
|
Loading…
Reference in New Issue