file-type plugin for improved audio / video type detection
npm install @file-type/av


bash
npm install @file-type/av
`
Usage
The following example shows how add the XML detector to file-type.
`js
import {fileTypeFromFile} from 'file-type';
import {detectAv} from 'file-type/av';
const fileType = await fileTypeFromFile('example.mka', {customDetectors: [detectAv]});
console.log(JSON.stringify(fileType));
`
Support media formats
- Matroska
- audio/matroska, mka
- video/matroska, mkv
- MP4:
- audio/mp4, m4a
- video/mp4, mp4
- Ogg:
- audio/ogg; codecs=opus, opus (Opus)
- audio/ogg; codecs=speex, spx (Speex)
audio/ogg; codecs=vorbis, ogg (Vorbis
video/ogg, ogv (Theora)
video/webm, webm
audio/webm, webm
audio/x-ms-asf, wma
video/x-ms-asf, wmv