davidzeng0 / sange

FFmpeg Powered Audio Player in node.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sange

FFmpeg powered audio player in node.js

Sange and Yasha, when attuned by the moonlight and used together, become a very powerful combination.

prerequisites

only compiles on Linux or WSL2+.

  1. node.js
  2. cmake
  3. c++ compiler
  4. ffmpeg
  5. libuv
  6. libopus

install

# dependencies
apt install cmake g++ gcc libuv1-dev libopus-dev
# ffmpeg quick install (see below for issues and fixed installation)
apt install libavcodec-dev libavcodec58 libavformat-dev libavformat58 libavutil-dev libavutil56 libavfilter7 libavfilter-dev libswresample-dev libswresample3

# optional
apt install ninja-build

# install
npm i git://github.com/davidzeng0/sange.git

ffmpeg

building ffmpeg from source may boost performance
known issue: the default TLS library (gnutls) that ships with ffmpeg causes an infinite loop. building with OpenSSL fixes that issue. running with jemalloc helps with memory leaks

before installing, make sure ffmpeg and its libraries are not already on the machine
by uninstalling all libav*-dev and libav* packages and deleting any manual installations of ffmpeg and its libraries to avoid issues

apt install pkg-config libssl-dev libmp3lame-dev libopus-dev libvorbis-dev nasm

git clone --depth 1 https://github.com/FFmpeg/FFmpeg
cd FFmpeg
./configure --arch=amd64 --disable-stripping --enable-openssl --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-shared --enable-nonfree
make -j $(nproc)
make install
ldconfig

run with jemalloc

apt install libjemalloc-dev

LD_PRELOAD=/path/to/your/libjemalloc.so node entry.js

About

FFmpeg Powered Audio Player in node.js

License:MIT License


Languages

Language:C++ 92.9%Language:JavaScript 3.3%Language:C 2.9%Language:CMake 0.9%