[FFmpeg-user] Large Sized output files recieved while encoding the audio
Ferdi Scholten
ferdi at sttc-nlp.nl
Wed Apr 20 21:58:18 EEST 2022
Rephrasing the requirement.
> We have an audio pipeline which redacts the audios using the set of start
> time and end time provided from our ML team. To achieve this, we execute
> the ffmpeg command with filter
> "volume=enable='between(t,starttime,endtime)':volume=0".
> For some cases, we are receiving audio files with codecs which are causing
> the outputs to have large file sizes. One such example is below,
> ffprobe and ffmpeg output of the file is attached to the mail.
> *command:* ffmpeg -i call.wav -af "volume=enable='between(t,0,1)':volume=0"
> output.wav
> *behaviour: *executed within a second, input file size 2.1 mb, output file
> size 176 mb
>
> As we can see here, the output file size is 88 times the original. The
> objective here is to achieve the output file size of less than 2-3 times
> the original without reducing the sound quality.
> I went through the documentation but couldn't find any suitable way to fix
> it. Let me know if anyone knows the issue in my command. Please point me to
> some resource containing the details of audio codecs and filtering.
>
> Regards,
> Shubham
>
The input file is a 19 kb/s highly compressed audio file (opus codec
lossy format variable bitrate)
The generated wav output is in pcm 1536 kb/s uncompressed cbr.
so 1536 / 19 = 80.84... times bigger output (at least) so your 88 times
bigger is expected going from highly compressed variable bitrate audio
to uncompressed constant bitrate audio.
You should not convert the audio, just use a universal container like
matroska that can contain almost any existing codec.
Try this command:
ffmpeg -i call.wav -af "volume=enable='between(t,0,1)':volume=0"
-c:a copy output.mka
Learn about codecs, lossy and lossless encoding and differnt containers
to know what is going on.
maybe this can help you learn:
http://ce.sharif.edu/courses/91-92/2/ce873-1/resources/root/Class%20Notes/MMN-lec3-Audio-911121.pdf
Greetings
Ferdi
More information about the ffmpeg-user
mailing list