This commit is contained in:
Honney OC committed 2026-10-11 16:59:09 +00:00
1 parent f5af9c534a
commit b0e362f44e
2 files changed
+14 -13

No files matched your search

+5 -4
View File
@@ -3,6 +3,7 @@
[extract]
# Input files — relative to repo root or absolute. Same as extract.py inputs.
# Example: file_a = "/path/to/movie_a.mkv"
file_a = "/path/to/movie_a.mkv"
file_b = "/path/to/movie_b.mp4"
# Window to extract (seconds). This is the ONLY duration needed.
@@ -22,8 +23,8 @@ proxy_width = 192
sample_rate = 48000
channels = 1
# If extracted wavs already exist, sync test can load them directly:
# file_a_wav = "extracted/movie_b_audio.wav"
# file_b_wav = "extracted/movie_a_audio.wav"
# file_a_wav = "extracted/movie_a_audio.wav"
# file_b_wav = "extracted/movie_b_audio.wav"
# EBU R128 loudness normalization (two-pass loudnorm)
normalize = true
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
decode_width = 192 # decode scale width when reading the full master
# Explicit extracted files (optional, relative to repo root or absolute):
# file_a_mkv = "extracted/movie_b_proxy.mkv"
# file_b_mkv = "extracted/movie_a_proxy.mkv"
# file_a_mkv = "extracted/movie_a_proxy.mkv"
# file_b_mkv = "extracted/movie_b_proxy.mkv"
+9 -9
View File
@@ -133,16 +133,16 @@ class ApplySyncWorker(QtCore.QThread):
total_frames, _total_ms = self.probe_video_total(self.video_a)
# Single merged pipe: apply_sync forwards ffmpeg -progress key=value
# lines on stdout; human text has no "=" and is skipped for progress.
# stdout pipe carries only the -progress protocol (+ apply_sync's
# 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(
cmd, cwd=script_dir,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
stdout=subprocess.PIPE, stderr=None,
universal_newlines=True, bufsize=1
)
frames_done = 0
last_line = ""
assert proc.stdout is not None
for line in proc.stdout:
if self._abort:
@@ -152,7 +152,6 @@ class ApplySyncWorker(QtCore.QThread):
line = line.strip()
if not line:
continue
last_line = line
if line.startswith("frame="):
try:
frames_done = int(line.split("=", 1)[1].strip())
@@ -162,13 +161,14 @@ class ApplySyncWorker(QtCore.QThread):
elif line.startswith("progress=end"):
self.progress.emit(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:
# 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()
# 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)