
Press enter and wait for it to finish.Īfter a successful conversion, the resulting audio files will be saved under ~/Music directory with folder name being the name of the previous folder containing video files with the extension -mp3 at the end.

Since I’m running the script inside the directory with Video files I’ll like to convert to mp3, I’ll go with option 1. Make the script executable: chmod +x mp3con.sh Step 3: Convert mp4/mkv/WebM media files to mp3 on Linux:Įxecute script, ( You can do it in the folder containing mp4 videos) # Create dir to store mp3 files if it doesn't existĮcho "$base_name" | xargs -d "\n" -I. You can as well copy below script snippet. Installation can also be done by manually compiling ffmpeg from source. Sudo yum install ffmpeg ffmpeg-devel lameĬentOS / RHEL 8: Install FFmpeg on CentOS / RHEL 8

Sudo dnf -y install ffmpeg ffmpeg-devel lameįor CentOS 7: sudo yum -y install epel-release Sudo dnf -y install $(rpm -E %fedora).noarch.rpm For Arch Linux users, install Prerequisites ffmpeg and lame by:įor Ubuntu / Debian: sudo apt -y install ffmpeg lameįor Fedora: sudo dnf -y install $(rpm -E %fedora).noarch.rpm
