LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 10-29-2003, 07:06 AM   #1
scottie
Member
 
Registered: Oct 2003
Location: UK
Distribution: Slackware 8.0
Posts: 56

Rep: Reputation: 15
Converting wma to mp3


i recently changed from windows to linux (slackware 8.0) however a lot of my music is in the form of .wma files. Whats the best way of changing them to mp3 files in linux? I looked in sourceforge but i couldnt see anything of interest.

I've also got a similar problem with needing to convert .avi files to .mpg

scottie
 
Old 10-29-2003, 07:40 AM   #2
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix, 98,2000 + various
Posts: 3,171

Rep: Reputation: 51
you can use mplayer to output the .wma files to .wav then convert
the wav files how you wish.
 
Old 10-29-2003, 08:42 AM   #3
seidren
Member
 
Registered: May 2003
Distribution: Ubuntu, Windows XP
Posts: 90

Rep: Reputation: 15
to convert WMA to WAV using mplayer

mplayer -ao pcm -aofile "filename.wav" "filename.wma"

to convert WAV to MP3 using lame

lame --preset standard "filename.wav"

You can consult the man pages to get more information on the options
 
Old 10-29-2003, 09:00 AM   #4
guygriffiths
Member
 
Registered: Jun 2003
Location: Reading, UK
Distribution: Debian 3.0, LFS
Posts: 524

Rep: Reputation: 35
Stop! Why do you want mp3's? If you have a personal mp3 player then that's ok, but if not, then convert them to oggs. A friend of mine with nothing better to do encoded one file in about 5 different quality mp3s and 7 different quality oggs. The oggs were listenable down to about level 3, which could fit a 5 minute song into 500KB. In general the result of his "study" was that oggs give better quality sound for smaller files, or if you prefer, small files for the same quality sound.
Guy
 
Old 10-29-2003, 09:13 AM   #5
scottie
Member
 
Registered: Oct 2003
Location: UK
Distribution: Slackware 8.0
Posts: 56

Original Poster
Rep: Reputation: 15
cool, any ideas how to convert .avi to .mpg?

scottie
 
Old 10-29-2003, 09:33 AM   #6
guygriffiths
Member
 
Registered: Jun 2003
Location: Reading, UK
Distribution: Debian 3.0, LFS
Posts: 524

Rep: Reputation: 35
Again, I don't mean to push you into something you don't want, but I would keep them as .avi. If they're not compressed, you want them in DivX or Xvid format. These are both great formats. The advantage is that they are much much smaller than any mpeg format.
However, the tool you will need for either format is transcode. It's the ultimate coder from anything to anything else pretty much. Although you'll probably need some codecs. It's console based though, but there are front-ends available. I believe that k3b should do the job, although it's primarily a CD burner (and a damn fine one at that). If not, dvd::rip definately works.
Guy
 
Old 10-30-2003, 06:19 AM   #7
seidren
Member
 
Registered: May 2003
Distribution: Ubuntu, Windows XP
Posts: 90

Rep: Reputation: 15
guygrifiths is right about OGG. Its better to convert to OGG than to MP3s, because I too believe that OGGs give better compression as well as maintain the sound quality than MP3s do. But still the difference is not very great to say that MP3s are totally obsolete. Ogg and Mp3 seem to be similar to Linux and Windows fighting their way through people.

guygrifiths is also right about converting to MPEG. Its better to leave the file as avi if its is compressed. If you want you could compress them using the DivX format.
Again, Mencoder can do that (comes with Mplayer).

Read the man pages for mplayer, under the encoding options, you will find information on the codecs you can use.

This will recompress an avi with mp3 for sound codec and mpeg4 ( which is said to be DivX 4/5 in the man page) for video codec.

mencoder -oac mp3lame -ovc lavc -lameopts preset=standard -lavcopts vcodec=mpeg4 -o "outputfile.avi" "inputfile.avi"

You can just as well encode the avi to mpeg just by changing the vcodec value to vcodec=mpeg1video or vcodec=mpeg2video.
You can even encode to a WMV just by setting vcodec=wmv1 or vcodec=wmv2

Check the available video codecs in the man page under -lavcopts , vcodec.
 
Old 10-30-2003, 10:25 AM   #8
evil_Tak
Member
 
Registered: Oct 2003
Distribution: Debian/unstable
Posts: 85

Rep: Reputation: 15
Quote:
Originally posted by scottie
cool, any ideas how to convert .avi to .mpg?
There are legitimate reasons for wanting to do this, such as wanting to burn (s)vcds. The following instructions are written for vcd, but can easily be changed for svcd. They also assume an avi at resolution 352x240x23.98fps with 44100Hz 2channel audio. This is not the _only_ way to do things, but this is the way that results (for me) in the best quality mpegs/vcds with the least trouble.

First, make sure you have the following software: mplayer, mjpeg tools, toolame, and sox.

Unfortunately, mplayer/mencoder is currently unable to correctly convert a file to mpeg in one pass. So, I convert the video in one pass, the audio in another pass, and then multiplex them together. Begin by making two fifos (named pipes):
Code:
mkfifo vfifo; mkfifo afifo; ln -s vfifo stream.yuv
Now, convert the video:
Code:
mpeg2enc -n n -v 0 -f 2 -b 1024 -F 1 -o file.m1v < vfifo &; mplayer -ac dummy -ao null -vo yuv4mpeg -noframedrop file.avi
Next, convert the audio:
Code:
toolame -b 224 -m s afifo file.mp2 &; mplayer -vc dummy -vo null -ao pcm -nowaveheader -aofile afifo file.avi
Finally, multiplex the audio and video for a complete mpeg file:
Code:
mplex -f 1 file.m1v file.mp2 -o file.mpg
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
For people how want to play WMA files without converting MP3 files waelaltaqi Linux - Software 15 11-17-2005 08:30 AM
Converting wma format to mp3 format. fakie_flip Linux - General 6 10-02-2005 07:49 PM
Converting from .wma to .mp3/.ogg Napalm Llama Linux - Software 2 09-10-2005 11:18 AM
trouble with mencoder converting wma to mp3 TheOneAndOnlySM Linux - Software 0 11-01-2004 09:26 PM
converting wma to mp3 rolanaj Linux - Software 2 08-16-2003 03:46 PM


All times are GMT -5. The time now is 07:52 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration