Gentoo Forums
Gentoo Forums
Quick Search: in
converting m4a files under linux (gentoo)
View unanswered posts
View posts from last 24 hours

rackathon
 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
mwiertz
Tux's lil' helper
Tux's lil' helper


Joined: 07 Jul 2003
Posts: 88
Location: Selfkant, Germany

PostPosted: Wed May 18, 2005 12:21 pm    Post subject: converting m4a files under linux (gentoo) Reply with quote

Hi,

I was wondering if there's any kind of tool available that can convert the m4a files from sharpmusique (itunes) into mp3-files, so I can use the music I buyed on my mp3-player?

thnx
Max
Back to top
View user's profile Send private message
NorthWoodsman
Tux's lil' helper
Tux's lil' helper


Joined: 25 Apr 2003
Posts: 134

PostPosted: Wed May 18, 2005 2:59 pm    Post subject: Reply with quote

Look up Mplayer
Back to top
View user's profile Send private message
snuut
n00b
n00b


Joined: 22 Jun 2003
Posts: 19

PostPosted: Wed May 18, 2005 3:29 pm    Post subject: Reply with quote

m4a -> wav
Code:
for i in *.m4a; do mplayer -ao pcm "$i" -aofile "$i.wav"; done

wav -> mp3
Code:
for i in *.wav; do lame -h -b 192 "$i" "$i.mp3"; done

strip down file extensions
Code:
for i in *.mp3; do x=`echo "$i"|sed -e 's/m4a.wav.mp3/mp3/'`; mv "$i" "$x"; done


copied it somewhere, it worked for me.

regards
Back to top
View user's profile Send private message
mwiertz
Tux's lil' helper
Tux's lil' helper


Joined: 07 Jul 2003
Posts: 88
Location: Selfkant, Germany

PostPosted: Thu May 19, 2005 2:33 pm    Post subject: Reply with quote

Hi,

thanks for your reply...

I used it to build this script called m4a2mp3:

Code:
#!/bin/bash
#
# Convert m4a to mp3

for i in $1/*.m4a
do
  mplayer -ao pcm "$i" -aofile "$i.wav"
  dest=`echo "$i.wav"|sed -e 's/m4a.wav$/mp3/'`
  lame -h -b 192 "$i.wav" "$dest"
  rm $i $i.wav
done



I put this one /usr/local/bin and now I'm able to convert all m4a-files in the directory that I pass in the first parameter; so m4a2mp3 . for example will convert all the *.m4a files in the current working dir to mp3 and will clean up the source and temporary files. It will use as less diskspace as possible.

kind regards...
Back to top
View user's profile Send private message
rjs
Tux's lil' helper
Tux's lil' helper


Joined: 30 Jul 2004
Posts: 146
Location: Oriel College, Oxford

PostPosted: Wed Jun 01, 2005 9:47 am    Post subject: Reply with quote

mwiertz wrote:
Hi,

thanks for your reply...

I used it to build this script called m4a2mp3:

Code:
#!/bin/bash
#
# Convert m4a to mp3

for i in $1/*.m4a
do
  mplayer -ao pcm "$i" -aofile "$i.wav"
  dest=`echo "$i.wav"|sed -e 's/m4a.wav$/mp3/'`
  lame -h -b 192 "$i.wav" "$dest"
  rm $i $i.wav
done



I put this one /usr/local/bin and now I'm able to convert all m4a-files in the directory that I pass in the first parameter; so m4a2mp3 . for example will convert all the *.m4a files in the current working dir to mp3 and will clean up the source and temporary files. It will use as less diskspace as possible.

kind regards...


Thanks, that works perfectly for me :)
Back to top
View user's profile Send private message
curious_bob
l33t
l33t


Joined: 05 Dec 2003
Posts: 634
Location: Ellensburg, WA

PostPosted: Thu Jul 21, 2005 8:03 pm    Post subject: Reply with quote

using mplayer did not work for me. i had to use faad instead.
_________________
Play me online, well ya know that I'll beat you. If I ever meet you, I'll CRTL-ALT-DEL you!!!

The Black Vault The Largest Online Military and Government Research Center
Back to top
View user's profile Send private message
madman2003
Apprentice
Apprentice


Joined: 20 Feb 2005
Posts: 178

PostPosted: Fri Jul 22, 2005 5:03 am    Post subject: Reply with quote

Why are you converting lossy --> lossy, why did you buy those files in the first place without a player for them?
Back to top
View user's profile Send private message
curious_bob
l33t
l33t


Joined: 05 Dec 2003
Posts: 634
Location: Ellensburg, WA

PostPosted: Sat Jul 23, 2005 12:22 am    Post subject: Reply with quote

madman2003 wrote:
Why are you converting lossy --> lossy, why did you buy those files in the first place without a player for them?

I didn't buy them.
_________________
Play me online, well ya know that I'll beat you. If I ever meet you, I'll CRTL-ALT-DEL you!!!

The Black Vault The Largest Online Military and Government Research Center
Back to top
View user's profile Send private message
outspoken
Guru
Guru


Joined: 14 Feb 2004
Posts: 454
Location: orlando, fl

PostPosted: Sun Sep 18, 2005 1:51 pm    Post subject: Reply with quote

for those who find this thread useful in the future -aofile is depreciated in mplayer. now it is -ao pcm:file="filename"

so:

Code:


#!/bin/bash
#
# Convert m4a to mp3

for i in $1/*.m4a
do
  mplayer -ao pcm "$i" -ao pcm:file="$i.wav"
  dest=`echo "$i.wav"|sed -e 's/m4a.wav$/mp3/'`
  lame -h -b 192 "$i.wav" "$dest"
  rm $i $i.wav
done


or

Code:

for i in *.m4a; do mplayer -ao pcm "$i" -ao pcm:file="$i.wav"; done
Back to top
View user's profile Send private message
nautiazn85
n00b
n00b


Joined: 05 Aug 2005
Posts: 37

PostPosted: Fri Jan 06, 2006 11:18 pm    Post subject: Reply with quote

Is there a noticeable loss of audio quality when converting lossy -> lossy?
Back to top
View user's profile Send private message
bk0
Apprentice
Apprentice


Joined: 04 Jan 2004
Posts: 266

PostPosted: Fri Jan 06, 2006 11:55 pm    Post subject: Reply with quote

Yes. iTunes uses pitiful bitrates, even the original file doesn't sound all that great.

I'd suggest buying real CDs (which cost about the same as 10-12 iTunes tracks) and then ripping them into the format of your choice. Vastly better sound quality, no DRM and a physical lossless backup copy.
Back to top
View user's profile Send private message
nautiazn85
n00b
n00b


Joined: 05 Aug 2005
Posts: 37

PostPosted: Sat Jan 07, 2006 2:49 am    Post subject: Reply with quote

Yah I've already done that. The only problem is when I was still using Windows a few months ago, I used iTunes to rip a bunch of my cds. Now I want to play them in LINUX but amarok (taglib) doesn't have support for m4a yet.

I was going to convert the files... but I don't want them to be any worse than they are now.
Back to top
View user's profile Send private message
bk0
Apprentice
Apprentice


Joined: 04 Jan 2004
Posts: 266

PostPosted: Sat Jan 07, 2006 9:32 pm    Post subject: Reply with quote

nautiazn85 wrote:
Yah I've already done that. The only problem is when I was still using Windows a few months ago, I used iTunes to rip a bunch of my cds.


It will probably take just as much time to transcode the AAC tracks as would to re-rip the CDs. I really like Grip (http://nostatic.org/grip/) for CD ripping.
Back to top
View user's profile Send private message
lecleremi
n00b
n00b


Joined: 08 Dec 2005
Posts: 10
Location: Montréal

PostPosted: Fri May 19, 2006 2:26 pm    Post subject: Reply with quote

Hi there

I got the same problem with mplayer so I replaced it by faad and fix a problem with filenames ("$i" instead of $i and so on)

Code:
#!/bin/bash
#
# Convert m4a to mp3

for i in $1/*.m4a
do
  faad -o "$i.wav" "$i"
  dest=`echo "$i.wav"|sed -e 's/m4a.wav$/mp3/'`
  lame -h -b 192 "$i.wav" "$dest"
  rm "$i" "$i.wav"
done


Probably you can reduce used disk space by deleting $i before using lame and then deleting $i.wav
_________________
R. Leclercq
interests: none.
Back to top
View user's profile Send private message
TerranAce007
Apprentice
Apprentice


Joined: 13 Dec 2004
Posts: 281
Location: Texas

PostPosted: Sat May 27, 2006 11:04 am    Post subject: Reply with quote

Is there any way to transfer the audio tags by script as well? When I tried the script, the files I tested successfully transcode, but the tag info is not transfered (artist, title, track, albun, etc...) I am not veyr familiar with id3tag or other programs like that, but I am wondering if there is a better way than entering the data for my several thousand songs by hand...
_________________
It's all funny until someone gets hurt.


Then it's hilarious.
Back to top
View user's profile Send private message
Hydraulix
Guru
Guru


Joined: 11 Dec 2003
Posts: 447
Location: Baltimore, Maryland

PostPosted: Mon May 29, 2006 9:42 pm    Post subject: Reply with quote

Is there a way to convert mp3 to m4a on Linux?
_________________
It is the fate of operating systems to become free.
- Neal Stephenson

If only You and Dead people can read hex, how many people can read hex?
Back to top
View user's profile Send private message
ziegs
Tux's lil' helper
Tux's lil' helper


Joined: 29 Apr 2004
Posts: 119

PostPosted: Tue May 30, 2006 8:03 pm    Post subject: Reply with quote

here ya go

Code:
#!/bin/bash
#
# Convert mp3 to m4a

for i in $1/*.mp3
do
  mplayer -ao pcm "$i" -ao pcm:file="$i.wav"
  dest=`echo "$i.wav"|sed -e 's/mp3.wav$/m4a/'`
  faac -b 192 -o "$dest" "$i.wav"
  rm "$i" "$i.wav"
done


i tested, didn't really play around with the faac encoder settings because i didn't have time to look them up...i don't know why you'd want it in m4a...

enjoy


Last edited by ziegs on Tue May 30, 2006 8:15 pm; edited 1 time in total
Back to top
View user's profile Send private message
Hydraulix
Guru
Guru


Joined: 11 Dec 2003
Posts: 447
Location: Baltimore, Maryland

PostPosted: Tue May 30, 2006 8:13 pm    Post subject: Reply with quote

ziegs wrote:
here ya go

Code:
#!/bin/bash
#
# Convert mp3 to m4a

for i in $1/*.mp3
do
  mplayer -ao pcm "$i" -ao pcm:file="$i.wav"
  dest=`echo "$i.wav"|sed -e 's/mp3.wav$/m4a/'`
  faac -b 192 -o "$dest" "$i.wav"
  rm "$i" "$i.wav"
done


i tested, didn't really play around with the faac encoder settings because i didn't have time to look them up...i don't know why you'd want it in m4a...

enjoy[/code]



Thanks I'll give that a shot. The only reason I want m4a is it takes up less space. I might just convert over to mp3 but I'm looking for a codec that has great quality and take up less space.
_________________
It is the fate of operating systems to become free.
- Neal Stephenson

If only You and Dead people can read hex, how many people can read hex?
Back to top
View user's profile Send private message
ziegs
Tux's lil' helper
Tux's lil' helper


Joined: 29 Apr 2004
Posts: 119

PostPosted: Tue May 30, 2006 8:17 pm    Post subject: Reply with quote

i'd give ogg a shot then. unless you need it on your ipod, then m4a and mp3 are your only options for now.

i find m4a support to be too shoddy. faad/faac didn't work properly on amd64 till recently, and muine, the audio player i use, doesn't import m4a despite its backend handling them, so i'm stuck with ogg and mp3 and flac for now.
Back to top
View user's profile Send private message
Hydraulix
Guru
Guru


Joined: 11 Dec 2003
Posts: 447
Location: Baltimore, Maryland

PostPosted: Tue May 30, 2006 8:20 pm    Post subject: Reply with quote

ziegs wrote:
i'd give ogg a shot then. unless you need it on your ipod, then m4a and mp3 are your only options for now.

i find m4a support to be too shoddy. faad/faac didn't work properly on amd64 till recently, and muine, the audio player i use, doesn't import m4a despite its backend handling them, so i'm stuck with ogg and mp3 and flac for now.



Yeah sadly I have an iPod. Looks like I have to stick with mp*.
_________________
It is the fate of operating systems to become free.
- Neal Stephenson

If only You and Dead people can read hex, how many people can read hex?
Back to top
View user's profile Send private message
bk0
Apprentice
Apprentice


Joined: 04 Jan 2004
Posts: 266

PostPosted: Sat Jun 03, 2006 1:17 pm    Post subject: Reply with quote

Hydraulix wrote:

Yeah sadly I have an iPod. Looks like I have to stick with mp*.


Not if you install Rockbox.
Back to top
View user's profile Send private message
Hydraulix
Guru
Guru


Joined: 11 Dec 2003
Posts: 447
Location: Baltimore, Maryland

PostPosted: Sat Jun 03, 2006 11:05 pm    Post subject: Reply with quote

bk0 wrote:
Hydraulix wrote:

Yeah sadly I have an iPod. Looks like I have to stick with mp*.


Not if you install Rockbox.



I installed it before but didn't like it. I just like how the original firmware is laid out.
_________________
It is the fate of operating systems to become free.
- Neal Stephenson

If only You and Dead people can read hex, how many people can read hex?
Back to top
View user's profile Send private message
CptnObvious999
Apprentice
Apprentice


Joined: 19 Dec 2004
Posts: 292

PostPosted: Sat Jun 03, 2006 11:22 pm    Post subject: Reply with quote

Hydraulix wrote:
bk0 wrote:
Hydraulix wrote:

Yeah sadly I have an iPod. Looks like I have to stick with mp*.


Not if you install Rockbox.



I installed it before but didn't like it. I just like how the original firmware is laid out.

Maybe try iPod Linux I have not tried it and I think I remember someone talking about OGG support on it, I don't have an iPod so I couldn't tell you. (I have an iAudio X5L w00t w00t ;-) )
Back to top
View user's profile Send private message
ziegs
Tux's lil' helper
Tux's lil' helper


Joined: 29 Apr 2004
Posts: 119

PostPosted: Sat Jun 03, 2006 11:27 pm    Post subject: Reply with quote

the problem with ipodlinux is that its not fully supported on most of the newer ipods.

i have a 4g, and i don't even think usb or firewire transfers are working on those yet...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum