diff --git a/src/faceblur/app.py b/src/faceblur/app.py index 10392de..77d3179 100644 --- a/src/faceblur/app.py +++ b/src/faceblur/app.py @@ -92,7 +92,7 @@ class WelcomeScreen(Screen): } #logo { - color: $text; + color: $accent; text-style: bold; margin-bottom: 2; width: auto; @@ -144,7 +144,7 @@ class WelcomeScreen(Screen): with Middle(): with Vertical(id="app-container"): with Center(): - yield Static(LOGO, id="logo") + yield Label("PyFaceBlur", id="logo") with Horizontal(classes="form-row"): yield Label("Video file:", classes="form-label") @@ -644,7 +644,7 @@ class EncodingScreen(Screen): yield Label("Encoding video with face blur...", id="encoding-phase") yield ProgressBar(total=100, id="encoding-progress") yield Label("", id="encoding-status") - yield Label(f"Output: {self.output_path}", id="output-label") + yield Label(f"Output: {self.output_path.name}", id="output-label") yield Button("Done — Exit", id="done-btn", variant="success") def on_mount(self) -> None: diff --git a/src/faceblur/encode.py b/src/faceblur/encode.py index 7524139..5229365 100644 --- a/src/faceblur/encode.py +++ b/src/faceblur/encode.py @@ -116,7 +116,59 @@ def find_best_encoder() -> Tuple[str, List[str], List[str]]: if subprocess.run(cmd, capture_output=True, timeout=5).returncode == 0: return "h264_nvenc", [], [] - # 2. Linux VA-API (AMD/Intel) + # 2. Linux VA-API (AV1) + cmd = [ + "ffmpeg", + "-v", + "quiet", + "-vaapi_device", + "/dev/dri/renderD128", + "-f", + "lavfi", + "-i", + "nullsrc=s=64x64:d=0.1", + "-vf", + "format=nv12,hwupload", + "-c:v", + "av1_vaapi", + "-f", + "null", + "-", + ] + if subprocess.run(cmd, capture_output=True, timeout=5).returncode == 0: + return ( + "av1_vaapi", + ["-vaapi_device", "/dev/dri/renderD128"], + ["-vf", "format=nv12,hwupload"], + ) + + # 3. Linux VA-API (HEVC/H.265) + cmd = [ + "ffmpeg", + "-v", + "quiet", + "-vaapi_device", + "/dev/dri/renderD128", + "-f", + "lavfi", + "-i", + "nullsrc=s=64x64:d=0.1", + "-vf", + "format=nv12,hwupload", + "-c:v", + "hevc_vaapi", + "-f", + "null", + "-", + ] + if subprocess.run(cmd, capture_output=True, timeout=5).returncode == 0: + return ( + "hevc_vaapi", + ["-vaapi_device", "/dev/dri/renderD128"], + ["-vf", "format=nv12,hwupload"], + ) + + # 4. Linux VA-API (H.264) cmd = [ "ffmpeg", "-v", @@ -142,7 +194,7 @@ def find_best_encoder() -> Tuple[str, List[str], List[str]]: ["-vf", "format=nv12,hwupload"], ) - # 3. AMD AMF (Windows/Proprietary Linux) + # 5. AMD AMF (Windows/Proprietary Linux) cmd = [ "ffmpeg", "-v",