Is there any best practice to keep the size of the transcoded output file under a specific size?
I need to keep it under <100 MB but somehow I end up with big output files. The problem is that my (test) video file is 600kb while the generated output.wav 4MB. It is quite far away from what I expected.
var proc = new ffmpeg({
source: file,
nolog: false
});
proc.addInputOption('-acodec libopus');
format = "wav";
proc.addOptions([
'-f ' + format,
'-ab 192000',
'-ar 16000',
'-vn'
]);
This is how I gave the parameters to ffmpeg library. What parameters should I change here to reduce the size and keep the max. quality?
Using WAV as output format makes ffmpeg choose uncompressed PCM audio, where bitrate settings have no effect. You may want to read this post: What is a Codec (e.g. DivX?), and how does it differ from a File Format (e.g. MPG)?
If you were using the command line, you'd just have to copy the audio stream to an output file without touching the bitstream (
-c:a copy
):In fluent-ffmpeg, I guess this is the way to go:
You can also
webm
as output format by writing tooutput.webm
.