LMS-Community / slimserver

Server for Squeezebox and compatible players. This server is also called Lyrion Music Server.
https://lyrion.org
Other
1.2k stars 298 forks source link

OGG files with implausibly long durations #281

Open cheesestraws opened 5 years ago

cheesestraws commented 5 years ago

Logitech Media Server Version: 7.9.1 - 1522157629 @ Fri Mar 30 12:25:29 CEST 2018 Platform Architecture: x86_64-linux Audio::Scan: 0.95

The scanner seems to be detecting some OGG files as having implausibly long durations. I'm guessing this might actually be an Audio::Scan bug but

sqlite> select url,secs from tracks where secs>31536000 LIMIT 1; -- tracks longer than 1 year?
file:///mnt/media/home/media/player/Other/B/Berestez/Kahvi%20Collective%20Archive%20Vol%201/Plokcity.ogg|1.84467440715621e+16

FFmpeg has no problem parsing out the right length from this file:

$ ffprobe /mnt/media/home/media/player/Other/B/Berestez/Kahvi\ Collective\ Archive\ Vol\ 1/Plokcity.ogg

...
[ogg @ 0x5602c91d7fc0] 107 bytes of comment header remain
Input #0, ogg, from '/mnt/media/home/media/player/Other/B/Berestez/Kahvi Collective Archive Vol 1/Plokcity.ogg':
  Duration: 00:06:12.40, start: 0.000000, bitrate: 157 kb/s
...

It might be worth noting that all the files that exhibit this behaviour show the 'n bytes of comment header remain' in ffmpeg:

$ sqlite3 library.db "select url from tracks where secs>31536000" | perl -MURI::Escape -e 'while(<>) { s|^file://|"|; s|$|"|; print uri_unescape($_); }' | xargs -n 1 ffprobe 2>&1 | grep comment | wc -l
8

though this may, of course, be a red herring—it seems to be quite common in my random selection of ogg files.

I've dug a bit until I hit Audio::Scan, so I'm guessing this might well be an Audio::Scan bug, but this is the point where my expertise runs out (I know nothing about the internals of audio files), so I thought it'd be worth bringing someone's attention to. As far as I know, the oggs that exhibit this behaviour are freely distributable, so I can send copies of them if useful.

michaelherger commented 5 years ago

Yes, this sounds like an Audio::Scan issue. First of all you should update LMS to 7.9.2, as we have more recent versions of this library for some platforms. If that doesn't help (or Audio::Scan isn't available for a more recent version than 0.95 for your platform) you might want to compile it yourself using the build script from https://github.com/Logitech/slimserver-vendor/tree/public/7.9/CPAN.

Worst case I'd recommend to head over to https://github.com/andygrundman/Audio-Scan and report the issue there.

cheesestraws commented 5 years ago

Yeah, I've just grabbed the latest Audio::Scan out of CPAN and knocked up a minimal test case and it still does it, so I don't think updating will help yet. I should have done that to start with, really. Looks like not your bug—I'll go and report it on Audio::Scan. Will link the issue here when I do. Sorry for wasting your time :-).

cheesestraws commented 5 years ago

https://github.com/andygrundman/Audio-Scan/issues/6

github-actions[bot] commented 1 week ago

:warning: This issue is stale because it has been open for 720 days with no activity. Please chime in if you want to keep it alive.