Linux - SoftwareThis 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
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.
I discovered the world of video game music. Most of them are in .mod and .xm format. I want to be able to convert them via the command line to .mp3 so that I can play them on my iPod. Anyone know a good tool that does this?
You might want to look at one of these programs: http://woolyss.com/tracking-trackers.php?s=Linux
Many of them will import a .mod or .xm file and export a WAV file. You could convert a wav file to mp3 using sox, ffmpeg or mencoder or audacity. These aren't command line programs. However, you might want to try calling one from the command line with --help. Sometimes a graphical program can be used from the command line. For example, you can use acroread to convert pdfs to postscript files from the command line.
It could be that sox or ffmpeg can convert .mod files, but the manpages, and `ffmpeg -formats' didn't list these formats. Search your package manager for programs to play mod files. A program like mplayer can save the output to a file in .wav format. Other players may be able to do the same.
Thanks Frank and jschiwal. It already seems complicated. I've been running "make" on ffmpeg for the past 20 minutes so I hope that works. (I'm disappointed it's not available via yum.)
I don't mind converting from .xm/.mod to .wav and then from .wav to .mp3, but the command line is a must for me since I never use X at all. The tracker solution might work, but I would like to know definitively which one does what I need rather than experimenting with apps to find a decent CLI feature set.
We'll see what happens with ffmpeg; if that fails, mencoder might be a good solution. Audacity is a decent app, but it's GUI, right?
If anyone has specific experience with any of the aforementioned tools, please let me know how you do it!
ffmpeg results for *.xm (assuming my syntax is correct)
Code:
# ffmpeg -i 'song1.xm' -acodec copy - acodec ac3 -ab 384k song1.mp3 -acodec mp2 -ab 192k -newaudio
FFmpeg version 0.6.1, Copyright (c) 2000-2010 the FFmpeg developers
built on Nov 14 2010 21:58:45 with gcc 4.5.1 20100924 (Red Hat 4.5.1-4)
configuration:
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libswscale 0.11. 0 / 0.11. 0
song1.xm: Invalid data found when processing input
ffmpeg results for *.mod:
attempt #1 with first file -
Code:
# ffmpeg -i boing.mod -acodec copy - acodec ac3 -ab 384k boing.mp3 -acodec mp2 -ab 192k -newaudio
FFmpeg version 0.6.1, Copyright (c) 2000-2010 the FFmpeg developers
built on Nov 14 2010 21:58:45 with gcc 4.5.1 20100924 (Red Hat 4.5.1-4)
configuration:
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libswscale 0.11. 0 / 0.11. 0
boing.mod: Invalid data found when processing input
attempt #2 with another file:
Code:
# ffmpeg -i filek.mod -acodec copy - acodec ac3 -ab 384k filek.mp3 -acodec mp2 -ab 192k -newaudio
FFmpeg version 0.6.1, Copyright (c) 2000-2010 the FFmpeg developers
built on Nov 14 2010 21:58:45 with gcc 4.5.1 20100924 (Red Hat 4.5.1-4)
configuration:
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libswscale 0.11. 0 / 0.11. 0
[NULL @ 0x9e7d420]Format detected only with low score of 1, misdetection possible!
[aac @ 0x9e7e600]channel element 3.6 is not allocated
[aac @ 0x9e7e600]More than one AAC RDB per ADTS frame is not implemented. Update your FFmpeg version to the newest one from SVN. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0x9e7e600]Error decoding AAC frame header.
[aac @ 0x9e7d420]Could not find codec parameters (Audio: aac, 44100 Hz, stereo, s16, 958 kb/s)
[aac @ 0x9e7d420]Estimating duration from bitrate, this may be inaccurate
filek.mod: could not find codec parameters
That's slightly promising, but if it's not going to convert .xm files (a higher priority), I'm not sure it's the right app for the job.
Don't use "acodec copy". That is for duplicating the audio steam into the output container. If the container doesn't support that stream, it won't work. You also have a space before the second -acodec argument. Settle on one codec to use, and use compatible bitrate and frame rate parameters. You said you wanted to produce mp3 files:
An aac stream is another option. The mp2 codec is what you would use for mpeg videos.
I don't believe that my version of ffmpeg supports either .mod or .xm files.
Try running "ffprobe <filename>" to see if the format is detected.
I did find a program called Gmodplay. I don't know if it can export as well, buy you might want to look for it on sourceforge. Also, this wiki on Linux audio may be useful as well locating linux utilities. http://wiki.linuxaudio.org/wiki/start
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.