ffmpeg audio volume adjust

當多媒體檔案聲音大小需要調整時
可參考 https://trac.ffmpeg.org/wiki/AudioVolume

get stats

ffmpeg -i INPUT_FILE -filter:a volumedetect -f null NUL (NUL or /dev/null)

[Parsed_volumedetect_0 @ 000001be4a046040] n_samples: 26064896
[Parsed_volumedetect_0 @ 000001be4a046040] mean_volume: -32.1 dB
[Parsed_volumedetect_0 @ 000001be4a046040] max_volume: -5.6 dB

adjust volume

ffmpeg -i INPUT_FILE -af "volume=5.6dB" -c:v libx264 -crf 23 -c:a aac -q:a 100 OUTPUT_FILE

This entry was posted in System Administration. Bookmark the permalink.

Leave a Reply