easyff
v1.0.0
Published
Easy To Use Super Simple
Downloads
1
Maintainers
Readme
EasyFF
Installation
npm install easyff
Example:
const { EasyFF } = require('EasyFF');
const ffmpeg = new EasyFF("input.mp4");
ffmpeg.on("log", console.log)
ffmpeg.on("error", console.error);
ffmpeg.on("proccess", (size, time, bitrate, speed, asjson)=>{
console.log(asjson);
})
ffmpeg.on("end", ()=>console.log("Complited!"))
ffmpeg.on("start", ()=>console.log("Started!"))
ffmpeg.addInput("input.mp4");
ffmpeg.toMP3();
ffmpeg.reWrite();
ffmpeg.output("output.mp3")
ffmpeg.run()
const { EasyFF } = require('EasyFF');
const fs = require('fs');
const ffmpeg = new EasyFF("input.mp4");
ffmpeg.on("log", console.log)
ffmpeg.on("error", console.error);
ffmpeg.on("proccess", (size, time, bitrate, speed, asjson)=>{
console.log(asjson);
})
ffmpeg.on("end", ()=>console.log("Complited!"))
ffmpeg.on("start", ()=>console.log("Started!"))
ffmpeg.pipe(fs.createWriteStream("output.mp3"));
ffmpeg.toMP3();
ffmpeg.reWrite();
ffmpeg.run()
const { EasyFF } = require('EasyFF');
const fs = require('fs');
const ffmpeg = new EasyFF("input.mp4");
ffmpeg.on("log", console.log)
ffmpeg.on("error", console.error);
ffmpeg.on("proccess", (size, time, bitrate, speed, asjson)=>{
console.log(asjson);
})
ffmpeg.on("end", ()=>console.log("Complited!"))
ffmpeg.on("start", ()=>console.log("Started!"))
ffmpeg.toMP3();
ffmpeg.reWrite();
ffmpeg.run(fs.createWriteStream("output.mp3"))
const { EasyFF } = require('EasyFF');
const ffmpeg = new EasyFF("input.mp4");
ffmpeg.on("log", console.log)
ffmpeg.on("error", console.error);
ffmpeg.on("proccess", (size, time, bitrate, speed, asjson)=>{
console.log(asjson);
})
ffmpeg.on("end", ()=>console.log("Complited!"))
ffmpeg.on("start", ()=>console.log("Started!"))
ffmpeg.addInput("https://download.samplelib.com/mp4/sample-5s.mp4");
ffmpeg.addInputOption('-re')
ffmpeg.addOutputOption(['-c:a', 'acc']);
ffmpeg.addOutputOption('-y')
ffmpeg.isWeb();
ffmpeg.reWrite();
ffmpeg.run("output.mp3")
Function
addInput(<mediaFile>) // add Input File or URL
output(<outputFile>) // Add output File
isWeb() // Allow HTTP and HTTPS
toMP3() // Setup for MP3 Output
noVideo() // add "-vn" aim use it for Stream to icecast
reWrite() // if File Exists reWrite
pipe(<WritableStream>) // for Hook WritableStream
run() // also can be use for WritableStream or outputFile
kill() // Kill All Proccess
addInputOption() // add InputOption in Array or String
addOutputOption() // add OutputOption in Array or String
Info
Is Use ffmpeg-static is no need to install ffmpeg on you system