How to convert multiple m4a audio files in one directory to ogg format in UbuntuLinux? That’s the question that got me started down this road.
I was hoping for an easy way to do multiple files using FFMPEG but I don’t understand the command line structure well enough. In the meantime, I ran across this script that does the job.
- Install faad and lame with the command – sudo apt-get install faad lame
- Copy-n-paste the script and save it as m4a2mp3.sh in your /home/usrdirectory
(e.g. /home/mg) - Make the script executable with this command – sudo chmod 777 m4a2mp3.sh
- Switch to the directory and call the script with /home/m4a2mp3.sh
(Note: If you find an error in these instructions, please let me know! Thx in advance!)
#!/bin/bash
#for i in *.wma ; do
current_directory=$( pwd )
#remove spaces
for i in *.[Mm]4[Aa]; do mv "$i" `echo $i | tr ' ' '_'`; done
#remove uppercase
for i in *.[Mm]4[Aa]; do mv "$i" `echo $i | tr '[A-Z]' '[a-z]'`; done
#ripping with mplayer
echo Processing file: $i
#for i in *.mp3 ; do mplayer -vo null -vc dummy -ao pcm:file=$i.wav $i; done
for i in *.m4a ; do faad $i; done
#Convert to OGG
oggenc *.wav;
#removing old file
rm *.wav;
#rm *.m4a
How would one do this for multiple files with FFMPEG?
Subscribe to Around the Corner-MGuhlin.org
Be sure to visit the ShareMore! Wiki.
Discover more from Another Think Coming
Subscribe to get the latest posts sent to your email.
You do not need sudo to 'chmod' a file that you created in your home dir. And, you SHOULD NOT 'chmod 777' because that will give WRITE permission to ALL users. This is absolutely terrible suggestion 'chmod 777'. You could have just done:##chmod +x script.sh
You do not need sudo to 'chmod' a file that you created in your home dir. And, you SHOULD NOT 'chmod 777' because that will give WRITE permission to ALL users. This is absolutely terrible suggestion 'chmod 777'. You could have just done:##chmod +x script.sh
@Felipe, thanks for the feedback! It's only a terrible suggestion if you're worried about security…right?
@Felipe, thanks for the feedback! It's only a terrible suggestion if you're worried about security…right?
Hi. The problem I find, is that this post will teach people to ignore or downplay the importance of computer security. As a blogger trying to help other readers out, you ought to post code that is acceptably security, at least moderately secure. This way, the hundreds of thousands of people that followed this advice, won't have 777 scripts strewn about their home-dirs (or worse) root-dirs.Thanks,Felipe
Hi. The problem I find, is that this post will teach people to ignore or downplay the importance of computer security. As a blogger trying to help other readers out, you ought to post code that is acceptably security, at least moderately secure. This way, the hundreds of thousands of people that followed this advice, won't have 777 scripts strewn about their home-dirs (or worse) root-dirs.Thanks,Felipe
http://www.oggconvert.comonline tool to convert ogg files, no downloadsworks better on smaller files because it's web based
http://www.oggconvert.comonline tool to convert ogg files, no downloadsworks better on smaller files because it's web based
You can also go to OGG converter to convert OGG files to MP3, AAC, FLAC, OGG, WMA, M4A, WAV online. I hope its big help.
You can also go to OGG converter to convert OGG files to MP3, AAC, FLAC, OGG, WMA, M4A, WAV online. I hope its big help.