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
#!/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?
Be sure to visit the ShareMore! Wiki.
5 comments:
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?
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.com
online tool to convert ogg files, no downloads
works 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.
Post a Comment