libav-stream-info-wasm
v2.1.1
Published
wasm bindings for libav to extract audio (e.g. ID3) tags and duration
Downloads
1,332
Readme
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