diff --git a/CHANGELOG.md b/CHANGELOG.md index 3059d84a..e361e324 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +4.0.0 +======================== +* Rewrite of the recorder internals +* Creation of contact sheets is much faster +* You can now add timestamps to the contact sheet +* Fix online state detection for Bongacams + 3.13.1 ======================== * Fixed Streamate tabs diff --git a/client/src/main/java/ctbrec/ui/settings/SettingsTab.java b/client/src/main/java/ctbrec/ui/settings/SettingsTab.java index a432833f..834ee14c 100644 --- a/client/src/main/java/ctbrec/ui/settings/SettingsTab.java +++ b/client/src/main/java/ctbrec/ui/settings/SettingsTab.java @@ -119,6 +119,7 @@ public class SettingsTab extends Tab implements TabSelectionListener { private SimpleStringProperty ffmpegParameters; private SimpleBooleanProperty logFFmpegOutput; private SimpleBooleanProperty loghlsdlOutput; + private SimpleBooleanProperty logMissedSegments; private SimpleStringProperty fileExtension; private SimpleStringProperty server; private SimpleIntegerProperty port; @@ -177,6 +178,7 @@ public class SettingsTab extends Tab implements TabSelectionListener { ffmpegParameters = new SimpleStringProperty(null, "ffmpegMergedDownloadArgs", settings.ffmpegMergedDownloadArgs); logFFmpegOutput = new SimpleBooleanProperty(null, "logFFmpegOutput", settings.logFFmpegOutput); loghlsdlOutput = new SimpleBooleanProperty(null, "loghlsdlOutput", settings.loghlsdlOutput); + logMissedSegments = new SimpleBooleanProperty(null, "logMissedSegments", settings.logMissedSegments); fileExtension = new SimpleStringProperty(null, "ffmpegFileSuffix", settings.ffmpegFileSuffix); server = new SimpleStringProperty(null, "httpServer", settings.httpServer); port = new SimpleIntegerProperty(null, "httpPort", settings.httpPort); @@ -283,7 +285,8 @@ public class SettingsTab extends Tab implements TabSelectionListener { Setting.of("Playlist request timeout (ms)", playlistRequestTimeout, "Timeout in ms for playlist requests") ), Group.of("Logging", - Setting.of("Log FFmpeg output", logFFmpegOutput, "Log FFmpeg output to files in the system's temp directory") + Setting.of("Log FFmpeg output", logFFmpegOutput, "Log FFmpeg output to files in the system's temp directory"), + Setting.of("Log missed segments", logMissedSegments, "Write a log files in the system's temp directory to analyze missed segments") ), Group.of("hlsdl (experimental)", Setting.of("Use hlsdl (if possible)", useHlsdl, "Use hlsdl to record the live streams. Some features might not work correctly."), diff --git a/common/src/main/java/ctbrec/Settings.java b/common/src/main/java/ctbrec/Settings.java index 5c41f34d..18f1260e 100644 --- a/common/src/main/java/ctbrec/Settings.java +++ b/common/src/main/java/ctbrec/Settings.java @@ -87,6 +87,7 @@ public class Settings { public boolean localRecording = true; public boolean logFFmpegOutput = false; public boolean loghlsdlOutput = false; + public boolean logMissedSegments = false; public int minimumResolution = 0; public int maximumResolution = 8640; public int maximumResolutionPlayer = 0; diff --git a/common/src/main/java/ctbrec/recorder/download/hls/AbstractHlsDownload.java b/common/src/main/java/ctbrec/recorder/download/hls/AbstractHlsDownload.java index 6a02177c..f5e03dd4 100644 --- a/common/src/main/java/ctbrec/recorder/download/hls/AbstractHlsDownload.java +++ b/common/src/main/java/ctbrec/recorder/download/hls/AbstractHlsDownload.java @@ -30,7 +30,6 @@ import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Map.Entry; -import java.util.Objects; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -73,7 +72,6 @@ public abstract class AbstractHlsDownload extends AbstractDownload { private static final transient Logger LOG = LoggerFactory.getLogger(AbstractHlsDownload.class); private static final int TEN_SECONDS = 10_000; - private static final boolean DEBUG_HLS = Objects.equals(System.getenv("CTBREC_DEBUG_HLS"), "true"); private transient NumberFormat nf = new DecimalFormat("000000"); private transient int playlistEmptyCount = 0; @@ -321,7 +319,7 @@ public abstract class AbstractHlsDownload extends AbstractDownload { private void handleMissedSegments(SegmentPlaylist playlist, int nextSegmentNumber) throws IOException { if (nextSegmentNumber > 0 && playlist.seq > nextSegmentNumber) { recordingEvents.add(RecordingEvent.of("Missed segments: "+nextSegmentNumber+" < " + playlist.seq)); - if (DEBUG_HLS) { + if (config.getSettings().logMissedSegments) { File hlsEventsFile = File.createTempFile("/tmp/rec_evt_" + Instant.now() + "_" + model.getSanitizedNamed(), ".log"); try (OutputStream outputStream = Files.newOutputStream(hlsEventsFile.toPath(), CREATE, WRITE, TRUNCATE_EXISTING)) { BufferedWriter br = new BufferedWriter(new OutputStreamWriter(outputStream));