This commit is contained in:
Honney OC committed 2026-10-11 16:59:09 +00:00
1 parent 8b06eb2e42
commit 687b3bf77a
2 files changed
+17 -16

No files matched your search

+7 -6
View File
@@ -3,8 +3,9 @@
[extract] [extract]
# Input files — relative to repo root or absolute. Same as extract.py inputs. # Input files — relative to repo root or absolute. Same as extract.py inputs.
file_a = "/home/honney/Videos/Drachenzähmen/How to Train Your Dragon.mkv" # Example: file_a = "/path/to/movie_a.mkv"
file_b = "/home/honney/Videos/Drachenzähmen/Drachenzaehmen.mp4" file_a = "/path/to/movie_a.mkv"
file_b = "/path/to/movie_b.mp4"
# Window to extract (seconds). This is the ONLY duration needed. # Window to extract (seconds). This is the ONLY duration needed.
duration = 30 duration = 30
# Start offset in file (seconds, 0 = file start). ffmpeg -ss before -i for fast seek. # Start offset in file (seconds, 0 = file start). ffmpeg -ss before -i for fast seek.
@@ -22,8 +23,8 @@ proxy_width = 192
sample_rate = 48000 sample_rate = 48000
channels = 1 channels = 1
# If extracted wavs already exist, sync test can load them directly: # If extracted wavs already exist, sync test can load them directly:
# file_a_wav = "extracted/Drachenzaehmen_audio.wav" # file_a_wav = "extracted/movie_a_audio.wav"
# file_b_wav = "extracted/How to Train Your Dragon_audio.wav" # file_b_wav = "extracted/movie_b_audio.wav"
# EBU R128 loudness normalization (two-pass loudnorm) # EBU R128 loudness normalization (two-pass loudnorm)
normalize = true normalize = true
target_lufs = -14 # -14 streaming, -23 broadcast target_lufs = -14 # -14 streaming, -23 broadcast
@@ -48,5 +49,5 @@ max_lag = 0.0 # search half-window in seconds (0 = full range)
prefer_proxy = true # use {stem}_proxy.mkv when present, else {stem}_video.mkv prefer_proxy = true # use {stem}_proxy.mkv when present, else {stem}_video.mkv
decode_width = 192 # decode scale width when reading the full master decode_width = 192 # decode scale width when reading the full master
# Explicit extracted files (optional, relative to repo root or absolute): # Explicit extracted files (optional, relative to repo root or absolute):
# file_a_mkv = "extracted/Drachenzaehmen_proxy.mkv" # file_a_mkv = "extracted/movie_a_proxy.mkv"
# file_b_mkv = "extracted/How to Train Your Dragon_proxy.mkv" # file_b_mkv = "extracted/movie_b_proxy.mkv"
+10 -10
View File
@@ -133,16 +133,16 @@ class ApplySyncWorker(QtCore.QThread):
total_frames, _total_ms = self.probe_video_total(self.video_a) total_frames, _total_ms = self.probe_video_total(self.video_a)
# Single merged pipe: apply_sync forwards ffmpeg -progress key=value # stdout pipe carries only the -progress protocol (+ apply_sync's
# lines on stdout; human text has no "=" and is skipped for progress. # human log lines, forwarded below). stderr is inherited so ffmpeg's
# final summary stays visible in the launching terminal when run via ast.
proc = subprocess.Popen( proc = subprocess.Popen(
cmd, cwd=script_dir, cmd, cwd=script_dir,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, stdout=subprocess.PIPE, stderr=None,
universal_newlines=True, bufsize=1 universal_newlines=True, bufsize=1
) )
frames_done = 0 frames_done = 0
last_line = ""
assert proc.stdout is not None assert proc.stdout is not None
for line in proc.stdout: for line in proc.stdout:
if self._abort: if self._abort:
@@ -152,7 +152,6 @@ class ApplySyncWorker(QtCore.QThread):
line = line.strip() line = line.strip()
if not line: if not line:
continue continue
last_line = line
if line.startswith("frame="): if line.startswith("frame="):
try: try:
frames_done = int(line.split("=", 1)[1].strip()) frames_done = int(line.split("=", 1)[1].strip())
@@ -162,13 +161,14 @@ class ApplySyncWorker(QtCore.QThread):
elif line.startswith("progress=end"): elif line.startswith("progress=end"):
self.progress.emit(total_frames or frames_done, self.progress.emit(total_frames or frames_done,
total_frames or frames_done) total_frames or frames_done)
elif "=" not in line and ("error" in line.lower() or "failed" in line.lower()): elif "=" not in line:
self.status.emit(line) # Human-readable log (File A/B, Lag, Output, Synced output):
# mirror to the terminal instead of swallowing it.
print(f"[apply_sync] {line}", flush=True)
if "error" in line.lower() or "failed" in line.lower():
self.status.emit(line)
rc = proc.wait() rc = proc.wait()
# Keep ffmpeg's final summary line visible in the launching terminal.
if last_line:
print(f"[apply_sync] {last_line}", flush=True)
self.finished.emit(rc == 0) self.finished.emit(rc == 0)