Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to convert a lot of *.flac and some high bitrate *.mp3 files to *.m4a files. I want to use a fixed bitrate of 192kb (stereo) and want to keep the audiotags (except of, obviously, the tag "bitrate" - this sshould nbe set to the correct 192kb.).

I'm using 64-bit Maverick.

I tried about every program I could find.

Including

  • Sound Converter

  • soundKonverter (KDE)

  • WinFF

  • Arista Transcoder, Handbrake, Transmageddon (fails, seems only video works)

  • ffmpeg (tried "-acodec libfaac -ab 192k -map_meta_data outfile.m4a:infile.mp3")

But either they don't transfer the tags or they don't offer any way to set the bitrate to fixed 192kb or the resulting file doesn't show the new bitrate in any audio program (for example: nautilus saying "bitrate" n.a.")!

share|improve this question
4  
Would you please edit your question to list the programs from the Ubuntu repository that you've tried? That would help us narrow which apps to suggest (and even assist in crafting a script). –  Daniel T Chen Dec 22 '10 at 3:16
    
Sry, you're right. I thought if anyone knows a working one we don't have to fiddle around with fixing my vain efforts ... but anyway: see above now. thx, p. –  piedro Dec 22 '10 at 10:19
1  
Nautilus might just not know how to read the bitrate using gstreamer. –  NightwishFan Dec 22 '10 at 11:59
    
@Nightwishfan: Maybe, but Amarok, banshee or guayadeque show "bitrate n.a." also ... –  piedro Dec 22 '10 at 15:19
1  
@dkeikyb: sry I won't get into any discussion about my motivation. But: I never asked about mp3 to m4a. I ripped my cds in flac, I have some raw wavs, a few high quality mp3 (320kb, a bit too bloated considering file size) and some files in ape. 192kb m4a has good enough quality for our purposes, can be used by all our devices and don't worry, we won't transcode 128kb, 160kb or 192kb mp3 in 192kb m4a ...If you're really interested in why m4a (aac) might be superior to mp3 plz open a new thread. I guess you'll get a lot of lively discussion on that topic. cya –  piedro Mar 5 '11 at 21:49

3 Answers 3

You can try this program, found in the medibuntu repository. It is command line, however it might be just what you need: http://packages.medibuntu.org/maverick/aacplusenc.html

It will probably only input wav files, otherwise your best option is soundconverter (which does not support fixed bitrate). Or a custom gstreamer pipline using gst-launch. http://linux.about.com/library/cmd/blcmdl1_gst-launch.htm

share|improve this answer
    
I tried your suggestion of using "aacplusenc". Could you give me an example? I get an error trying to set the bitrate to 192 AND it seems to only support a sample rate of 22050 ... The second option looks more promising but doesn't recognize "libfaac" or "faac" and I didn't get any conversion done at all. Could you give an example? –  piedro Jan 6 '11 at 0:33
    
Yes, to be honest it looks like the 64-bit build is flawed. I will try force installing the 32-bit to see if it is better. Edit: No dice, you would have to install 32-bit libs as well, and that just has too many potential downsides. –  NightwishFan Jan 7 '11 at 15:56

Try Mobile Media Convert. Get it from here http://www.miksoft.net/mobileMediaConverter.htm

share|improve this answer
    
Öooks promising, but doesn't exist for 64bit ... source code is older version ... did you try it, does it get all the tags and the bitrate right? –  piedro Dec 22 '10 at 15:26
    
I am using it in my 64 bit lucid. It works smoothly. To know how to install 32 bit application on 64 bit os see the last section here help.ubuntu.com/community/32bit_and_64bit –  Abhijit Navale Dec 22 '10 at 18:31
    
Could you give me a hint on installing? I have the ia32-libs installed but the gdebi installer still refuses to install the *,deb package: wrong architecture! Google search tells me everything should just work. What's wrong? –  piedro Dec 23 '10 at 8:36
    
Ok! I had to --force-architecture to do that. But now trying to convert anything I get this error: mencoder: relocation error: mencoder: symbol codec_wav_tags, version LIBAVFORMAT_52 not defined in file libavformat.so.52 with link time reference –  piedro Dec 23 '10 at 9:16
    
Try installing sudo apt-get install libavformat52 && sudo apt-get install libavformat-extra-52 –  Abhijit Navale Dec 27 '10 at 4:49

I'd stick with ffmpeg. You weren't far off. Here's what I've just used to convert a load of 50-meg flacs to 5-meg m4as, complete with metadata:

find -name "*.flac" -exec ffmpeg -ab 192k -i "{}" -map_meta_data "{}.m4a":"{}" "{}.m4a" \;

You could expand that to clean up the original files or save them somewhere else (I was actually struggling with that bit).

For some reason, mine was crawling along at 190kbits/s so there might be a better encoding string (I should hope there is, this is a bit silly).

share|improve this answer
    
hi Oli! thx for your line here. If you're struggling with cleaning up - you can use winff and add your line (well parts of your line) as custom profile, winFF is a gui for ffmpeg I guess. Funny thing still, all my *.m4a (aac) files from different sources show a bitrate whith every program reading the tags. The ones I convert myself don't, it seems like ffmpeg doesn't write the tag "bitrate" and the music library managment programs don't compute and add them. Cause I share my music with my girlfriends ipod, apple desktop and ps3 over lan streaming I'd rather have the bitrate info in correct. –  piedro Dec 23 '10 at 8:24
    
To be precise: converting to other formats then aac ffmpeg writes a correct bitrate tag! (tested with mp3 ogg). It would be so nice if all devices could read ogg - I'd happily stick with that! Annoying ... –  piedro Dec 23 '10 at 8:28
    
Checking once more I found that nautilus shows the bitrate on different songs encoded with 192k *.m4a on other devices NOT by reading the "bitrate" tag - there is none set! So the gstreamer backend seems to be able to compute the bitrate showing values like "188k", "192k", "189k" - all around the 192k that programs claimed they encoded with. –  piedro Dec 23 '10 at 8:44
    
hi Oli! If I open the encoded files (your line or my line) doesn't matter! with the program "mediainfo" it computes a bitrate of 152k! So by telling ffmpeg to encode with 192k it seems to result in 152k bitrate ... wtf is going on? –  piedro Dec 23 '10 at 9:22
1  
for multicore systems, try find . -name "*.flac" -print0 |xargs -r0I {} -P 6 ffmpeg -ab 192k -i "{}" -map_meta_data "{}.m4a":"{}" "{}.m4a": the -P argument is the number of concurrent jobs to run. –  jmtd Jan 24 '11 at 15:36

protected by fossfreedom Nov 18 at 9:12

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.