libav-stream-info-wasm
TypeScript icon, indicating that this package has built-in type declarations

2.1.0 • Public • Published

libav-stream-info-wasm

This library uses libav to extract an audio files metadata, just like ffprobe does.

Version 2.0.0 pulls the source code of ffmpeg version 4.3.1 in docker and compiles it to WASM/JS via emscripten.

At the end all code is bundled into a single file so it can be easily used in the Browser with any bundler.

Usage

The runtime exports two functions that take a File as an argument:

  • getAudioFileTags function returns an object of the corresponding metadata tags.
  • getAudioFileDuration function returns the duration of the audio file in milliseconds.

Internally this uses a WebWorker to prevent blocking the main thread.

Building

Prerequisites: Docker installed

bash build.sh

Thanks

A big thanks to https://github.com/tfoxy/ffprobe-wasm and https://github.com/alfg/ffprobe-wasm

Package Sidebar

Install

npm i libav-stream-info-wasm

Weekly Downloads

115

Version

2.1.0

License

MIT

Unpacked Size

22.4 MB

Total Files

8

Last publish

Collaborators

  • astinka
  • rswilli