From c707e76bd64b8fc9c30b2a3d46b8905316d785e1 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Wed, 19 Jun 2024 12:25:43 +0000 Subject: [PATCH 1/2] Fast track extractions if there is no subtitles --- transcoder/src/extract.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/transcoder/src/extract.go b/transcoder/src/extract.go index cb6b77f7..d12b84a7 100644 --- a/transcoder/src/extract.go +++ b/transcoder/src/extract.go @@ -29,6 +29,12 @@ func Extract(path string, sha string) (<-chan struct{}, error) { os.MkdirAll(attachment_path, 0o644) os.MkdirAll(subs_path, 0o755) + // If there is no subtitles, there is nothing to extract (also fonts would be useless). + if len(info.Subtitles) == 0 { + close(ret) + return + } + cmd := exec.Command( "ffmpeg", "-dump_attachment:t", "", From 8d6b699f112179bdfe52876d58147a95478cb806 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Wed, 19 Jun 2024 12:40:43 +0000 Subject: [PATCH 2/2] Add some codecs --- transcoder/src/codec.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/transcoder/src/codec.go b/transcoder/src/codec.go index 4aa63fa0..0bd23f44 100644 --- a/transcoder/src/codec.go +++ b/transcoder/src/codec.go @@ -91,6 +91,10 @@ func GetMimeCodec(stream *ffprobe.Stream) *string { return &ret + case "mp3": + ret := "mp4a.40.34" + return &ret + case "opus": ret := "Opus" return &ret @@ -107,6 +111,10 @@ func GetMimeCodec(stream *ffprobe.Stream) *string { ret := "fLaC" return &ret + case "alac": + ret := "alac" + return &ret + default: log.Printf("No known mime format for: %s", stream.CodecName) return nil