after gemini
This commit is contained in:
commit
6c18827b93
2 files changed
+141
No files matched your search
@@ -0,0 +1,46 @@
|
||||
import subprocess
|
||||
|
||||
video_a = "/home/honney/projects/mkv/Saga of Tanya the Evil/Season 1/Saga Of Tanya The Evil - S01E01 - The Devil Of The Rhine.mkv"
|
||||
video_b = "/home/honney/projects/mkv/Saga of Tanya the Evil (2017-2017) [imdbid-tt6455986]/Season 01/Saga of Tanya the Evil S01E001.mkv"
|
||||
|
||||
offset_seconds = -0.1918081918081918
|
||||
offset_ms = offset_seconds * 1000
|
||||
preview_length = 10
|
||||
# 0.1 entspricht 1/10 der Geschwindigkeit
|
||||
speed_factor = 0.1
|
||||
|
||||
filter_complex = (
|
||||
f"[1:v]scale=640:-1[left_vid];"
|
||||
f"[0:v]scale=640:-1,hflip,drawtext="
|
||||
f"fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf:"
|
||||
f"text='Offset\\: {offset_ms:.2f}ms':"
|
||||
f"x=10:y=10:fontsize=24:fontcolor=white:box=1:boxcolor=black@0.5[right_vid];"
|
||||
f"[left_vid][right_vid]hstack=inputs=2"
|
||||
)
|
||||
|
||||
# Schritt 1: Video rendern
|
||||
cmd_ffmpeg = [
|
||||
"ffmpeg", "-y",
|
||||
"-itsoffset", f"{offset_seconds:.6f}", "-i", video_b,
|
||||
"-i", video_a,
|
||||
"-filter_complex", filter_complex,
|
||||
"-t", str(preview_length),
|
||||
"-c:v", "libx264",
|
||||
"-crf", "18",
|
||||
"-preset", "fast",
|
||||
"sync_preview.mp4"
|
||||
]
|
||||
|
||||
# Schritt 2: MPV starten
|
||||
cmd_mpv = [
|
||||
"mpv",
|
||||
f"--speed={speed_factor}",
|
||||
"--title=Sync-Check (1/10 Speed)",
|
||||
"sync_preview.mp4"
|
||||
]
|
||||
|
||||
print("Rendere Vorschau...")
|
||||
subprocess.run(cmd_ffmpeg)
|
||||
|
||||
print("Starte MPV...")
|
||||
subprocess.run(cmd_mpv)
|
||||
Reference in new issue
Block a user