Converting wma to mp3 in bulk without changing directory

8

3

I have thousands of music tracks in WMA format from when I used to use Windows Media Player to rip CDs. Now I'm having problems playing them on my Linux desktop at work.

Is there a good solution (for Windows or Linux) for converting all the WMAs to MP3s while leaving them in the same directories as before? I tried using iTunes to do it, but it started creating new directories to store all the converted tracks, which I don't want.

Eddy

Posted 2011-06-19T19:14:30.030

Reputation: 2 897

1In Linux (what distro, by the way?) some combination of find -execdir and ffmpeg should do it, but I will run some test before I post an answer. – William Jackson – 2011-06-19T19:27:02.047

2Be aware that any time you convert between lossy formats, you lose quality. Whether that loss in quality is audible depends on the original quality, the the encoder you're using for the transcode, your playback equipment, and your ears. If it were me, I would look at re-ripping the CDs (if possible) rather than transcoding. Even though I know that takes a lot more time. You might also consider storing your ripped CDs in a lossless format (FLAC is my favorite, but there are others), and transcoding that to MP3 for your portable MP3 player, etc. That of course requires more disk space. – Flimzy – 2011-06-19T21:38:48.840

@William: At work I use openSUSE, at home I use linux mint (ubuntu) and windows 7. I'll have to check out ffmpeg when I have time and see if I can write a bash script or something. If you post an answer that works then I'll mark that – Eddy – 2011-07-01T11:47:50.613

@Flimzy: I'll try converting a few tracks and check by ear whether I notice the loss in quality. I'm not an audiophile so I suspect it will probably be ok for me, but better safe than sorry I suppose – Eddy – 2011-07-01T11:49:30.303

I use DB PowerAmp Music Converter for this, awesome software but not free (mp3 license required)...http://www.dbpoweramp.com/dmc.htm

– Moab – 2011-07-05T12:49:29.863

Answers

6

If you have thousands of files, then this will take forever.

find . -iname "*.wma" -execdir ffmpeg -i {} -ab 192k -map_metadata 0:s:0 {}.mp3 \;

(Older versions of ffmpeg may need -map_meta_data instead of -map_metadata, 0:0 instead of 0:s:0.)

I tested this on Ubuntu 16.04. If you haven't already, you need to install the packages ffmpeg and libavcodec-extra-52.

Start this command from the parent directory that contains all your WMA files. It will search through all subdirectories for any file with a .wma extension and attempt to convert it to MP3. If the source file is named Awesome Song.wma, the new file will be Awesome Song.wma.mp3 and will be in the same directory as the source file.

If you normally user a bitrate higher or lower than 192k, change the -ab 192k flag to whatever you want.

William Jackson

Posted 2011-06-19T19:14:30.030

Reputation: 7 646

1

This added flag will tell ffmpeg to try and preserve the ID3 tags:

find . -iname "*.wma" -execdir ffmpeg -i {} -ab 192k **-map_metadata 0:0** {}.mp3 \;

normod

Posted 2011-06-19T19:14:30.030

Reputation: 11

1

This one finds the WMA files, converts them to MP3 with a clean extension name of .mp3 instead of .wma.mp3 and deletes the old file. This has been tested to work on Fedora 19 while searching WMA files through 150 GB worth of files that are arranged by artist/album/<disk number>/file.

find . -iname "*.wma" -execdir bash -c 'NAME="{}" && ffmpeg -y -i "$NAME" -ab 192k "${NAME/.wma/.mp3}" && rm "$NAME"' \;

Randell

Posted 2011-06-19T19:14:30.030

Reputation: 1 153

Works in a Mac, seems to preserve some metadata too. Although I got a lot of Queue input is backward in time [mp3 @ 0x7fbffb02ba00] Application provided invalid, non monotonically increasing dts to muxer in stream warnings. – adib – 2015-01-07T11:49:29.663

0

I've never tried this software but it looks promising and it's free.

http://www.freemp3wmaconverter.com/

WMA to MP3 tutorial.

bzsparks

Posted 2011-06-19T19:14:30.030

Reputation: 174

0

Free Mp3 Wma Converter 1.95 will definitely get your job done.

Claudiu Constantin

Posted 2011-06-19T19:14:30.030

Reputation: 111