From 141fef93e7e46a5f8dd01876efc0c8ed8c46f85b Mon Sep 17 00:00:00 2001 From: Meisterlala <6453306+Meisterlala@users.noreply.github.com> Date: Fri, 17 Oct 2025 21:00:35 +0200 Subject: [PATCH] uupdate command --- PKGBUILD | 2 +- cmd/compressor/config.go | 4 ++-- cmd/compressor/main.go | 14 ++++++++------ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 14887e0..4580266 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: Misti pkgname=compressor-git -pkgver=r7.ba24d78 +pkgver=r8.7f948f4 pkgrel=1 pkgdesc="Video compressor service that watches input directory and compresses videos using ffmpeg" arch=('x86_64' 'aarch64') diff --git a/cmd/compressor/config.go b/cmd/compressor/config.go index 4695e3e..278224f 100644 --- a/cmd/compressor/config.go +++ b/cmd/compressor/config.go @@ -23,9 +23,9 @@ const ( defaultStabilityDuration = 3 * time.Second ) -const defaultFFMPEGCommand = "-y -hwaccel cuda -hwaccel_device 0 -i {{input}} -c:v hevc_nvenc -qp 25 -preset p6 -gpu 0 -b_qfactor 1.1 -b_ref_mode middle -bf 3 -g 250 -i_qfactor 0.75 -max_muxing_queue_size 1024 -multipass 1 -rc vbr -rc-lookahead 20 -temporal-aq 1 -tune hq -c:a aac -af volume=2.0 {{output}}" +const defaultFFMPEGCommand = "-y -hide_banner -nostats -hwaccel cuda -hwaccel_device 0 -i {{input}} -c:v hevc_nvenc -qp 25 -preset p6 -gpu 0 -b_qfactor 1.1 -b_ref_mode middle -bf 3 -g 250 -i_qfactor 0.75 -max_muxing_queue_size 1024 -multipass 1 -rc vbr -rc-lookahead 20 -temporal-aq 1 -tune hq -c:a aac -af volume=2.0 {{output}}" -const defaultFFMPEGCommandCPU = "-y -i {{input}} -c:v libx265 -preset slow -crf 24 -c:a aac -af volume=2.0 {{output}}" +const defaultFFMPEGCommandCPU = "-y -hide_banner -nostats -i {{input}} -c:v libx265 -preset slow -crf 24 -c:a aac -af volume=2.0 {{output}}" var defaultExtensions = []string{".mp4", ".mkv", ".mov", ".avi", ".flv", ".wmv", ".m4v", ".webm", ".ts"} diff --git a/cmd/compressor/main.go b/cmd/compressor/main.go index 82f8eca..6ca08fb 100644 --- a/cmd/compressor/main.go +++ b/cmd/compressor/main.go @@ -30,13 +30,15 @@ func main() { log.Printf(" Delete Source: %t", cfg.deleteSource) log.Printf(" Processing Suffix: %s", cfg.processingSuffix) log.Printf(" Output Extension: %s", cfg.outputExtension) - log.Printf(" HTTP Port: %s", cfg.httpPort) if cfg.httpPort == "" { log.Printf(" HTTP server disabled") + } else { + log.Printf(" HTTP Port: %s", cfg.httpPort) } - log.Printf(" Discord Webhook: %s", cfg.discordWebhookURL) if cfg.discordWebhookURL == "" { log.Printf(" Discord notifications disabled") + } else { + log.Printf(" Discord Webhook: %s", cfg.discordWebhookURL) } log.Printf(" Rescan Interval: %v", cfg.rescanInterval) log.Printf(" Stability Window: %v", cfg.stabilityWindow) @@ -48,11 +50,11 @@ func main() { } log.Printf(" Video Extensions: %v", exts) - if err := os.MkdirAll(cfg.inputDir, 0o755); err != nil { - log.Fatalf("create input dir: %v", err) + if _, err := os.Stat(cfg.inputDir); os.IsNotExist(err) { + log.Fatalf("input dir does not exist: %s", cfg.inputDir) } - if err := os.MkdirAll(cfg.outputDir, 0o755); err != nil { - log.Fatalf("create output dir: %v", err) + if _, err := os.Stat(cfg.outputDir); os.IsNotExist(err) { + log.Fatalf("output dir does not exist: %s", cfg.outputDir) } ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) -- 2.51.2