I want to convert all my mp4 files in a folder into mp3 in a new folder I've tried something like:

$ffmpeg -i \*.mp4 -vn mp3/\*.mp3

but it didn't work. It involved an infinite loop and my computer didn't respond anymore. Any solution ? Thanks.

1 Answer 1

for i in *.mp4; do ffmpeg -i "$i" -f mp3 -ab 192k -vn -ar 44100 -ac 2 aud/"${i%.*}.mp3"; done
  • vn: disable video recording during the conversion.
  • ar: set audio sampling rate in Hz.
  • ab: set the audio bitrate.
  • ac: set the number of audio channels.
  • -f: format.
  • aud: name of the audio folder

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.