From 05a4aa775a252e68741e525554d3dae4a8564f9a Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Tue, 11 Aug 2026 00:34:01 +0300 Subject: [PATCH] =?UTF-8?q?feat:=20=D0=B2=D0=B8=D0=B4=D0=B5=D0=BE-=D0=BA?= =?UTF-8?q?=D0=BE=D0=B4=D0=B5=D0=BA=20h264=5Fnvenc=20(GPU)=20=D0=B2=D0=BC?= =?UTF-8?q?=D0=B5=D1=81=D1=82=D0=BE=20libvpx-vp9=20(CPU),=20=D0=BA=D0=BE?= =?UTF-8?q?=D0=B4=D0=B5=D0=BA=20=D0=B2=20=D0=BA=D0=BE=D0=BD=D1=84=D0=B8?= =?UTF-8?q?=D0=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - AppProperties.videoCodec (дефолт h264_nvenc), application.yaml - тесты: libx264 (без GPU), JobExecutorTest/JobPollerTest - аудио libvorbis/ogg и mkv-контейнер не тронуты --- src/main/kotlin/pw/binom/mirror/worker/config/AppProperties.kt | 1 + src/main/kotlin/pw/binom/mirror/worker/convert/JobExecutor.kt | 3 +-- src/main/resources/application.yaml | 1 + src/test/kotlin/pw/binom/mirror/worker/JobPollerTest.kt | 1 + .../kotlin/pw/binom/mirror/worker/convert/JobExecutorTest.kt | 1 + 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/pw/binom/mirror/worker/config/AppProperties.kt b/src/main/kotlin/pw/binom/mirror/worker/config/AppProperties.kt index 5e72997..54d6af9 100644 --- a/src/main/kotlin/pw/binom/mirror/worker/config/AppProperties.kt +++ b/src/main/kotlin/pw/binom/mirror/worker/config/AppProperties.kt @@ -14,6 +14,7 @@ data class AppProperties( val ffprobePath: String = "ffprobe", val localFileStorage: Path = Path.of("/tmp/media-mirror-worker"), val ffmpegThreadCount: Int? = null, + val videoCodec: String = "h264_nvenc", ) { data class Jellyfin( val url: String = "", diff --git a/src/main/kotlin/pw/binom/mirror/worker/convert/JobExecutor.kt b/src/main/kotlin/pw/binom/mirror/worker/convert/JobExecutor.kt index 19684fd..f716050 100644 --- a/src/main/kotlin/pw/binom/mirror/worker/convert/JobExecutor.kt +++ b/src/main/kotlin/pw/binom/mirror/worker/convert/JobExecutor.kt @@ -100,7 +100,7 @@ class JobExecutor( output = videoFile, width = newWidth, height = newHeight, - videoCodec = VIDEO_CODEC, + videoCodec = props.videoCodec, removeAudio = true, removeSubtitles = true, removeMetadata = true, @@ -154,7 +154,6 @@ class JobExecutor( } companion object { - private const val VIDEO_CODEC = "libvpx-vp9" private const val MAX_HEIGHT = 480 private const val VIDEO_CONTAINER = "mkv" private const val AUDIO_CODEC = "libvorbis" diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index f99ecff..f106462 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -24,6 +24,7 @@ app: ffmpegPath: ffmpeg ffprobePath: ffprobe localFileStorage: /tmp/media-mirror-worker + videoCodec: h264_nvenc server: port: 8081 diff --git a/src/test/kotlin/pw/binom/mirror/worker/JobPollerTest.kt b/src/test/kotlin/pw/binom/mirror/worker/JobPollerTest.kt index d0dd645..9a0f0a3 100644 --- a/src/test/kotlin/pw/binom/mirror/worker/JobPollerTest.kt +++ b/src/test/kotlin/pw/binom/mirror/worker/JobPollerTest.kt @@ -54,6 +54,7 @@ class JobPollerTest : AbstractMinioTest() { registry.add("app.s3.prefix") { "mirror" } registry.add("app.ffmpegPath") { "/usr/bin/ffmpeg" } registry.add("app.ffprobePath") { "/usr/bin/ffprobe" } + registry.add("app.videoCodec") { "libx264" } registry.add("app.localFileStorage") { Files.createTempDirectory("mmw-worker-test").toString() } diff --git a/src/test/kotlin/pw/binom/mirror/worker/convert/JobExecutorTest.kt b/src/test/kotlin/pw/binom/mirror/worker/convert/JobExecutorTest.kt index 423febd..5ac2f57 100644 --- a/src/test/kotlin/pw/binom/mirror/worker/convert/JobExecutorTest.kt +++ b/src/test/kotlin/pw/binom/mirror/worker/convert/JobExecutorTest.kt @@ -23,6 +23,7 @@ class JobExecutorTest : AbstractMinioTest() { ffmpegPath = "/usr/bin/ffmpeg", ffprobePath = "/usr/bin/ffprobe", localFileStorage = tempDir, + videoCodec = "libx264", ) private fun executor(): JobExecutor {