andygrundman / Audio-Scan

Audio::Scan - Fast Perl XS metadata and tag reader for all common audio file formats
GNU General Public License v2.0
4 stars 13 forks source link

Bad Opus Header with embedded art (possibly over a certain size) #7

Open wickedlemon opened 4 years ago

wickedlemon commented 4 years ago

Using Audioscan 1.02 as part of LMS.

The scanner is not importing about 300 Opus files. Some Opus files work ok, some don't.

Checking debug log the problem files give a "Not an Opus file (bad opus header)" error. I've managed to narrow the issue down to the embedded artwork. They all import fine with artwork removed. I've tried tagging in Foobar and MP3Tag and checking with opusinfo.exe and there are no errors reported or playback issues with the files.

I've tried gradually reducing the artwork quality and it seems files start importing ok once the artwork size is under about 45KB.

All over formats happily support larger embedded artwork, so is there something in the Opus spec that is causing this error or is this just an issue with the scanner?

andygrundman commented 4 years ago

Thanks for the report, I can reproduce it and will take a look.

domcote commented 3 years ago

I can confirm some of this odd behavior. However, here is a file with 175KB artwork that seems to scan and playback fine: https://1drv.ms/u/s!AoQI5_3ipPc6pN58xQs5_pwWRsR_3A?e=oKHjss This file was created by Foobar, while converting from a FLAC file with album art. It seems recent versions of Foobar automatically embed album art while converting. Adding album art to an .opus file with Foobar's tagging feature breaks the file very consistently. It doesn't get added to the DB at all. @wickedlemon Are you using Foobar to convert + tag by any chance? I am, and I found that not only albumart causes issues, Replay Gain also doesn't work. Here's an ongoing discussion of that: https://forums.slimdevices.com/showthread.php?107011-Howto-play-Ogg-Opus-files&p=1002142&viewfull=1#post1002142 and also over at hydrogenaudio: https://hydrogenaud.io/index.php?topic=115094.new#info_992375 Apparently, dbpoweramp does a better job. If I find time, I'll do some testing with dbpoweramp.

wickedlemon commented 3 years ago

I use Mp3tag to tag all my audio files.

Manlycookiebear commented 3 years ago

I'm also experiencing the same problem in LMS. Once I resize the cover to a smaller size than 45KB, I can play that file with LMS.