From 1c14430c99afb38ac74c4a36118e7f836adc504a Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Thu, 20 Apr 2023 16:48:04 -0700 Subject: [PATCH] Preliminary hw transcode support for Photoprism on pi4 --- services/main.tf | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/services/main.tf b/services/main.tf index 09b6fb3..bf38f2c 100644 --- a/services/main.tf +++ b/services/main.tf @@ -73,6 +73,15 @@ module "photoprism_module" { ingress = true service_port = 2342 sticky_disk = true + constraints = [{ + attribute = "$${meta.hw_transcode.type}" + # operator = "is_set" + value = "raspberry" + }] + docker_devices = [{ + host_path = "$${meta.hw_transcode.device}" + container_path = "$${meta.hw_transcode.device}" + }] env = { PHOTOPRISM_DEBUG = true # UI @@ -126,6 +135,13 @@ module "photoprism_module" { PHOTOPRISM_DATABASE_SERVER="{{ .Address }}:{{ .Port }}" {{- end }} {{- end }} + {{ if eq (env "meta.hw_transcode.type") "raspberry" -}} + PHOTOPRISM_FFMPEG_ENCODER=raspberry + PHOTOPRISM_FFMPEG_BUFFERS=64 + {{ else if eq (env "meta.hw_transcode.type") "intel" -}} + PHOTOPRISM_FFMPEG_ENCODER=intel + PHOTOPRISM_INIT="intel tensorflow" + {{- end }} EOF dest_prefix = "$${NOMAD_SECRETS_DIR}/" dest = "env"