1.5.3 • Published 2 years ago
yaffu v1.5.3
Yet Another FFmpeg Util
Dependencies
- FFmpeg
Install
npm install yaffu@latest
Example
Run the example/grid.mjs
script which demos genericCombine
(mixes all audio and stacks all video on a centered grid):
git clone https://github.com/erwinv/yaffu
cd yaffu
# build modules
npm install
npm run build
# run examples
cd example
npm install
node grid.mjs
# other examples
node presentation.mjs
node participant.mjs
node full.mjs
Using genericCombine
is as simple as:
import { ffmux, genericCombine } from 'yaffu'
const inputPaths = [
//...
]
await ffmux(genericCombine(inputPaths, 'combined.mp4'))
API
High-level API
mixAudio
downmixes and mixes all input audio to stereocompositeGrid
stacks all video input on a grid layout (max 16 or 4x4 grid)compositePresentation
main tile (presentation) on the left, vertically stacked tiles on the right (max 4)genericCombine
is a convenient wrapper that does bothmixAudio
andcompositeGrid
Low-level API
FilterGraph
filter graph builder classffmux
executes the filter graph and muxes to the defined outputffconcatDemux
concatenates all input files using FFmpeg's concat demuxerffprobe
probe media file's metadata
import { FilterGraph, ffmux } from 'yaffu'
const inputPaths = [
//...
]
const graph = new FilterGraph(inputPaths)
// build filter graph by piping streams through filters to output streams
graph
.pipe(['0:a', '1:a'], ['aout']) // input stream ids, output stream ids
.filter('amix', [], { normalize: 0 }) // filter name, direct options, key-value options
.filter('dynaudnorm') // filter with no opts (use default opts)
// map stream/s to output file
graph.map(['aout'], 'output.aac')
// run the muxer
await ffmux(graph)
1.5.3
2 years ago
1.5.2
2 years ago
1.5.1
2 years ago
1.5.0
2 years ago
1.4.13
2 years ago
1.4.12
2 years ago
1.4.11
2 years ago
1.4.10
2 years ago
1.4.9
2 years ago
1.4.8
2 years ago
1.4.7
2 years ago
1.4.6
2 years ago
1.4.5
2 years ago
1.4.4
2 years ago
1.4.3
2 years ago
1.4.2
2 years ago
1.4.1
2 years ago
1.4.0
2 years ago
1.3.0
2 years ago
1.2.1
2 years ago
1.2.0
2 years ago
1.1.0
2 years ago
1.0.5
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago