sentriz/gonic

Add mka and ac3 Support

Closed this issue · 7 comments

gonic version: 0.16.2

if from docker, docker tag: Custom built from git Master
if from source, git tag/branch: Master

Would it be possible to add support for these mime types? Most DVD concert rips contain AC3 audio. I usually use mka as the container for it but ac3 is usually the standard container.

In previous gonic versions, I've been able to add them to mime.go and the scanner would pick them up but doesn't look like that file exists anymore. I've attempted to add them to taglib.go myself and build a docker image but I haven't been successful there so likely doing something wrong.

what's the file extension? and are there any example files online to test?

mime inference is now delegated to go's stdlib and shared-mime-info, it should just be a matter of updating taglib.go CanRead() as you mentioned

.mka and .ac3 are the extensions.

There's samples for ac3 but not sure if there's any for mka.
https://filesamples.com/formats/ac3

audio/x-matroska is the mimetype for mka
https://mimetype.io/audio/x-matroska

I tried adding to https://github.com/sentriz/gonic/blob/master/tags/taglib/taglib.go#L16 but was unsuccessful.

thanks I'll try that. can you elaborate on it being unsuccessful? did you get errors?

No errors, folder is just empty because it's not seeing any media.

an errors in the gonic logs? if the CanRead was updated it will attempt to read tags

Ok so it looks like the issue is Gonic ignores all files without tags as I noticed this same error in the logs even for FLAC files that do not have any tags. I figured this would be an issue when browsing by tags but less so when browsing by folder structure.
Navidrome has audio/x-matroska listed as a mimetype so the database sees the file and I can play it, but it cannot read tags so defaults to [Unknown Artist] [Unknown Album].

"/Music/Metallica/2003 - St. Anger Rehearsals (62853-2) [DVD]": populate track "01 - Frantic.mka": cannot process
/Music/Metallica/2003 - St. Anger Rehearsals (62853-2) [DVD]/01 - Frantic.mka: could not read tags

Mp3tag can write Matroska tags to files but doesn’t look like Taglib has the support yet. Looks like it may be a few weeks away though so perhaps I should wait and see how that plays out. Interestingly, VLC can read these tags and it supposedly uses Taglib as well.
taglib/taglib#1149

I could put AC3 audio into a MPEG-4 container but I’m not sure I want .m4a as an extension for both AAC encoded files and AC3 encoded files as my transcoding script reads the file extension to determine the transcoding parameters.

.ac3 support may be out of the mix entirely since it's a raw file and untaggable. I'm ok with that as I believe matroska should be the standard container for AC3.

OK then sounds good to wait until taglib supports it