HydrogenAudio

Hosted Forums => foobar2000 => Support - (fb2k) => Topic started by: pandy71 on 2019-03-29 14:00:12

Title: foobar2000 unable to open supported container and audio codec without extension.
Post by: pandy71 on 2019-03-29 14:00:12
Hi,
Decided to report very strange bug - seem foobar2000 is unable to open/play files:
- without extension
- with different extension than expected by foobar2000

Bug was discovered on file with nominal '.webm' extension and audio codec opus.
after changing extension to '.opus' foobar2000 hang on seek (i assume seek) window, after removing extension from file foobar2000 reported that it is unable to play unknown format, after adding '.webm' extension foobar2000 had no issues with file.
Same, valid file was used to demonstrate issue.

I was really surprised to realize that foobar2000 rely fully on extension.

Title: Re: foobar2000 unable to open supported container and audio codec without extension.
Post by: lvqcl on 2019-03-29 16:42:36
IIRC it's a feature, not a bug.
Title: Re: foobar2000 unable to open supported container and audio codec without extension.
Post by: pandy71 on 2019-03-31 21:17:31
IIRC it's a feature, not a bug.

Oh... are you able to elaborate on this? My impression was that extension was important for DOS and since non-DOS modern OS are present this should be not a problem to parse header to detect container and codec.

Explanation why this seem to be serious functionality limitation.
Prefer to keep extension webm for video/audio files where for only audio i prefer to use different naming convention.
Title: Re: foobar2000 unable to open supported container and audio codec without extension.
Post by: j7n on 2019-03-31 21:38:42
For audio only Matroska files you can use *.mka file extension, or demux the opus stream into standard Ogg container.

If you use wrong or custom file extensions, you'll eventually run into issues with some software, like a generic front end for CLI encoders, which doesn't know all possible file headers, or a program like IrfanView that will bug you about the wrong extension. I believe DOS programs were equally able to parse file headers, but it was not efficient to do so with streamable formats like MP3 or ADTS that have short headers where the sync pattern can be falsely detected, or when hundreds or thousands of files must be listed by format quickly in a file manager.
Title: Re: foobar2000 unable to open supported container and audio codec without extension.
Post by: kode54 on 2019-04-01 00:47:02
Windows does not have the benefit of the file command (https://en.wikipedia.org/wiki/File_(command)), and even systems that do employ it have had problems with false positives due to the mis-ordering of signatures in the signature database, or signatures being too greedy, matching arbitrary strings in the middle of files of other formats.

For instance, one file type would match the date stamp in a Postscript file containing the word "Tuesday", and cause it to be mis-identified as a different file type, and thus it would become un-printable. (bug report (https://bugs.launchpad.net/ubuntu/+source/cupsys/+bug/255161/comments/28))