Skip to content

Borewit/file-type-av

Repository files navigation

NPM version Node.js CI npm downloads

@file-type/av

A plugin for file-type that detects audio and video file formats. This plugin helps differentiate between audio and video file types more precisely.

Installation

npm install @file-type/av

Usage

Here’s how to use this plugin with file-type to detect audio/video formats:

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. You are free to use, modify, and distribute this project as needed.

About

file-type plugin for improved audio / video type detection

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

No packages published