streamonkey / libav-stream-info-wasm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

License:MIT License


Languages

Language:TypeScript 57.0%Language:C++ 22.6%Language:Dockerfile 10.3%Language:Makefile 4.2%Language:HTML 3.1%Language:Shell 2.9%