From 83b1c6b3985367d7ae9507e2d140984884f0bfb7 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Sun, 12 May 2024 17:47:21 +0200 Subject: [PATCH] Add eac3 to list of supported codecs --- transcoder/src/codec.go | 6 ++++++ transcoder/utils.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/transcoder/src/codec.go b/transcoder/src/codec.go index e6afd0ac..344c0dda 100644 --- a/transcoder/src/codec.go +++ b/transcoder/src/codec.go @@ -3,6 +3,7 @@ package src import ( "cmp" "fmt" + "log" "strings" "github.com/zoriya/go-mediainfo" @@ -118,11 +119,16 @@ func GetMimeCodec(mi *mediainfo.File, kind mediainfo.StreamKind, i int) *string ret := "mp4a.a5" return &ret + case "audio/eac3", "E-AC-3": + ret := "mp4a.a6" + return &ret + case "audio/x-flac", "FLAC": ret := "fLaC" return &ret default: + log.Printf("No known mime format for: %s", codec) return nil } } diff --git a/transcoder/utils.go b/transcoder/utils.go index 961e0f24..74a04a8d 100644 --- a/transcoder/utils.go +++ b/transcoder/utils.go @@ -19,7 +19,7 @@ var safe_path = src.GetEnvOr("GOCODER_SAFE_PATH", "/video") // Encode the version in the hash path to update cached values. // Older versions won't be deleted (needed to allow multiples versions of the transcoder to run at the same time) // If the version changes a lot, we might want to automatically delete older versions. -var version = "v1." +var version = "v2-" func GetPath(c echo.Context) (string, string, error) { key := c.Param("path")