Apple Intelligence now features Image Playground, Genmoji, Writing Tools enhancements, seamless support for ChatGPT, and visual intelligence.

Apple Intelligence has also begun language expansion with localized English support for Australia, Canada, Ireland, New Zealand, South Africa, and the U.K. Learn more >

You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Batch Convert MP4 to MP3

Can iTunes, QuickTime Player or any free software be used to convert a bunch of MP4's to MP3's? I have 184 video lectures I gave I want to turn into MP3's. So far QuickTime Player worked great, but that only converts one at a time and it is a very tedious and repetitive work.

MacBook Air

Posted on Aug 25, 2019 5:46 AM

Reply
Question marked as Top-ranking reply

Posted on Aug 25, 2019 11:53 AM

I combined what you helped with and the StackOverflow and came up with the solution below. I created a fold on the desktop, moved all the videos in that folder. I created the folder "outputs" within the folder with the videos. I option-dragged ffmpeg from the bin file to the folder with the videos (NOT in outputs). I wrote in terminal:


cd Desktop
cd "The name of the folder with the videos I wanted to convert"
for f in ./*.mp4; do ./ffmpeg -i "$f" -c:a libmp3lame "outputs/${./f%.mp4}.mp3"; done


This did it! Shout-out to you and our programmers out there, this piece of work was not pleasant. Or it is not for me.

21 replies
Question marked as Top-ranking reply

Aug 25, 2019 11:53 AM in response to VikingOSX

I combined what you helped with and the StackOverflow and came up with the solution below. I created a fold on the desktop, moved all the videos in that folder. I created the folder "outputs" within the folder with the videos. I option-dragged ffmpeg from the bin file to the folder with the videos (NOT in outputs). I wrote in terminal:


cd Desktop
cd "The name of the folder with the videos I wanted to convert"
for f in ./*.mp4; do ./ffmpeg -i "$f" -c:a libmp3lame "outputs/${./f%.mp4}.mp3"; done


This did it! Shout-out to you and our programmers out there, this piece of work was not pleasant. Or it is not for me.

Aug 25, 2019 10:50 AM in response to Bitee

Two things.

  1. In order for ./ to work, you must be in the current directory where the ffmpeg binary is located. That Bash error message indicates that you are not.
    1. In the Finder, and in your Downloads folder, find the ffmpeg-4.2-macos64-static folder.
    2. In that folder is a bin folder containing the ffmpeg binary.
    3. Press the option key and drag (copy) the ffmpeg binary onto your Desktop (for now)
    4. Place a sample .mp4 video on your Desktop too.
    5. Run the command syntax that I have provided changing the input .mp4 and output .mp3 filenames to your circumstance.
  2. Once you are satisfied that the particular ffmpeg command sequence produces a satisfactory .mp3, then I will write you a script that will loop through all of your 186 .mp4 files and generate your .mp3.

Aug 25, 2019 8:42 AM in response to BDAqua

Thank you so much for your reply. This has potential to be a life and money saver. I had to gave it access in System Preferences > Security & Privacy > Accessibility. Now I uploaded one lecture to see if it works and it says "1 failed." I tried 5 and 50 lectures and they also failed ("5 failed," etc.). I attached a picture with details if you have any insight on this. Thanks so much once more!

Aug 25, 2019 10:36 AM in response to Bitee

That link that I just provided, Download a 64-bit, static build of FFmpeg, is a .zip file, and in Firefox, clicking on that link displays:



If you click this link in Safari, (or as I have in Firefox) the zip file will get dropped into your Downloads folder. If you copy that ffmpeg binary as I suggested to your Desktop, you may have to revise the command to:


./ffmpeg -i ./"Herding Cats".mp4 -acodec libmp3lame -ac 2 -ab 160k -ar 48000 ./foo.mp3


That ./ nomenclature is telling the Terminal that you are running the command from the current directory (e.g. Desktop) location. Without that, the Terminal may not be able to find the path to the ffmpeg binary, the .mp4 file, or where to write the .mp3 file.

Aug 25, 2019 9:26 AM in response to Bitee

You can use FFmpeg to batch convert .mp4 to .mp3. Stackoverflow example of how to use FFmpeg in the Terminal to perform the .mp4 to .mp3 batch conversion.


And here is how to convert with either Constant Bit Rate, or Variable Bit Rate. Regardless of the fact that it is a Linux command-line example, the FFmpeg command syntax should be the same on macOS.

Aug 25, 2019 10:03 AM in response to Bitee

Stop. Remove the ffmpeg that you downloaded, because you can download a static build version that has all the good stuff built into it and no need for plug-ins.


Just download a 64-bit, static build of ffmpeg with all of the libraries included in it.


That zip file will get dropped into your Downloads folder as ffmpeg-4.2-macos-64bit-static.zip. Double-click to unzip into a folder of the same name (without the .zip extension). You can option-drag its bin folder's ffmpeg binary to your Desktop.


The following tested command will convert a .mp4 video that I dragged to the Desktop into a .mp3 audio file (also on the Desktop):


ffmpeg -i "Herding Cats".mp4 -acodec libmp3lame -ac 2 -ab 160k -ar 48000 foo.mp3

That command-line is from that Linux page link showing constant bitrate encoding (CBR).



Batch Convert MP4 to MP3

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.