#!/linuxSucks/ffmpeg Examples
Nov 20, 2023Extract audio from a video
ffmpeg -i video.mp4 -b:a 128k -filter:a "volume=1dB" -codec:a libmp3lame audio.mp3
- -b:a (vibrated)
- -filter:a “volume=1dB” (increase volume)
- -codec:a libmp3lame (mp3 codec)
For scripts
mkv to mp3
for f in *.mkv; do
ffmpeg -i "$f" -b:a 128k -filter:a "volume=1dB" -codec:a libmp3lame -map 0:1 "${f%mkv}mp3"
done
mp4 to mp3
for f in *.mp4; do
ffmpeg -i "$f" -b:a 128k -filter:a "volume=1dB" -codec:a libmp3lame -map 0:1 "${f%mp4}mp3"
done