file-type
file-type copied to clipboard
Ability to detect audio WebM
WebM audio file detected as:
{
ext: 'webm',
mime: 'video/webm'
}
expected:
{
ext: 'webm',
mime: 'audio/webm'
}
Sample file: 02 - Poxfil - Solid Ground (5 sec).opus.webm.zip
I think we should wait to add more formats until the tokenizer branch has been merged into master.
~~WebM is a sub format (based on the profile) of Matroska. It requires to parse the Matroska file. Given the complexity of that format, I am not sure if it belongs in the "core" of file-type. Similar to the MS-CFB (.msi, .doc) It may be better to move this into a plugin. You can use music-metadata (which I am the author of) to retrieve further information about your Matroska file. Maybe I'll write a file-type audio extension plugin using from that recipe one day. Anyway for now I will close this issue. Feel free to reply.~~
WebM detection, within EBML container has been implemented in #286.
The sample file still gives me video/webm.
Same here!
Received buffer with mimetype audio/webm;codecs=opus
[FYLE-FYPE] Detected MIME type: { ext: 'webm', mime: 'video/webm' }
@pejuam, @guizzo, you are right, file-type can distinct sub-type WebM from other EBML, but indeed it cannnot distinct between 'video/webm and audio/webm.
Not sure if that distinction is feasible in file-type. Even in music-metadata I do not have an isVideo detection, as suggested here. Reason being this is not a trivial thing to implement.
Related to issue #400.
I am working on a plugin for file-type which is able better distinct audio / video types: @file-type/av.
I covered audio and video Matroska files, not sure yet what it takes to cover similar WebM files.