https://github.com/borewit/file-type-av
file-type plugin for improved audio / video type detection
https://github.com/borewit/file-type-av
Last synced: 5 months ago
JSON representation
file-type plugin for improved audio / video type detection
- Host: GitHub
- URL: https://github.com/borewit/file-type-av
- Owner: Borewit
- License: mit
- Created: 2025-06-30T15:21:47.000Z (12 months ago)
- Default Branch: master
- Last Pushed: 2025-07-15T17:12:19.000Z (11 months ago)
- Last Synced: 2025-08-21T00:05:57.781Z (10 months ago)
- Language: JavaScript
- Size: 10.2 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
[](https://npmjs.org/package/@file-type/av)
[](https://github.com/Borewit/file-type-av/actions/workflows/nodejs-ci.yml)
[](https://npmcharts.com/compare/@file-type/av?start=365)
# @file-type/av
A plugin for [file-type](https://github.com/sindresorhus/file-type) that detects _audio_ and _video_ file formats.
This plugin helps differentiate between audio and video file types more precisely.
## Installation
```bash
npm install @file-type/av
```
## Usage
Here’s how to use this plugin with `file-type` to detect audio/video formats:
```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, null, 2));
```
---
## Supported 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)
### WebM
- `audio/webm` – `.webm`
- `video/webm` – `.webm`
### Windows Media
- `audio/x-ms-asf` – `.wma`
- `video/x-ms-asf` – `.wmv`
---
## License
Licensed under the [MIT License](LICENSE.txt).
You are free to use, modify, and distribute this project as needed.