Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Haven't messed with much tagging, but the way I'd approach it would be to insert a step that reads the tag and dumps it to a text file before converting to mp3. Convert to mp3. Then reapply the tag with some tagging app. Could probably be scripted with little effort.
Alright I found a good example. Google for oggasm. It's a PeRL script which recursively converts mp3 to ogg. It converts the tags and applies them to the new file as well. I'm just learning perl so it's a bit out of the realm of total understanding for me, but it certainly can be done...relatively easily it looks.
here's a short bash script that uses faad2 and lame to convert from .m4a to mp3, transfers all the tag information, and deletes the intermediary .wav and .txt files it created
the script still has to be saved and run in each directory containing .m4a files you want to convert, but I suspect that would be trivial to fix for anyone who actually knows a thing or two about bash scripts:
naturally you can substitute you favorite lame settings instead of --alt-preset 160
this works with mp4 file info in the format faad v2.0 prints out; later/earlier versions may require changes
Distribution: Monkey linux on Compaq LTE Elite 4/50E; Mandrake 10.0
Posts: 2
Rep:
Hi all,
for the sake of completeness and quality, I have taken the liberty of modifying
d-rockbrinks' script into one that converts m4a to ogg, using faad and oggenc, and does the tagging ogg-style:
vdHummes, you should add that script to the wiki if you sure it works well. I've started a new section for just this sort of thing. Might be nice to have conversion scripts localized in one place...
i tried all the scrips posted here and got the same error each time .......
"Warning: Pulse coding not allowed in short blocks" fills up the terminal
and then when it finally stops it says
Could not find "19 Track 19.wav".
rm: cannot remove `19 Track 19.wav': No such file or directory
go to the directory where your m4a files are and try running faad "filename.m4a"
on the command line
then do ls
if you don't see a ".wav" file then you have a problem. either you need to update your faad program or there is simply a problem with your m4a files. Also make sure you have the correct permissions. And that you are copying and pasting the scripts correctly and not just typing them in (sometimes that leads to typos).
If it is the case that your faad needs to be updated (and I see you are using fc3) then type yum update and finally yum install faad2
Hope that helps,
As for me I am using d-rockbrinks' script with much success and also learning a thing or two about bash scripting.
Thanks everyone who has contributed!
Last edited by VibeOfOurTribe; 05-24-2005 at 11:26 AM.
Originally posted by Shade
Put all the .m4a files into one directory
then write a quick script.
-SNIP-
That will use mplayer do dump m4a into a regular wave file.
Next, you need to use lame to convert the .wavs into .mp3s. You could use oggenc if you wanted .oggs.
-SNIP-
However.. the file will look like "filename.m4a.wav.mp3"
So, to clean that up we use...
-SNIP-
Well, your solution is good but I can add some tips :
1) mplayer can write to mp3 directly using lame
2) bash can convert filenames to remove unwanted extensions :
Code:
for i in *.m4; do
mencoder "$i" -o "${i/m4a/mp3}" -oac mp3lame
done
You can use the -lameopts mencoder flag to specify bitrate and stuff for lame....
script=$0
command=$1
for f in echo *
do
if [ -d "$f" ]
then
cd "$f"
$script $command
cd ..
else
$command "$f"
fi
done
I used it to convert a DVDs worth of various artists.
Change to top level folder (e.g. itunes ;-) and execute 'convertr m4a2mp3' for example and the script will enter into all the subdirectories calling the conversion script specified.
THANK you whoever did it for making the ogg vorbis version, I don't want to use it, but shortly ago I spent several hours making and many, many more perfecting a script to convert mp3 to ogg. it hurts me deeply to find people ignoring this great format, and instead using inferior ones.
..I do realize that there is a better script written in perl that does it and with many more options but I don't really care and at the time I didn't know
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.