Transcoding for mod music

Tutorials, tips and tricks.

Moderator: moderators

Transcoding for mod music

Postby yoshi252 » Wed Mar 16, 2011 1:21 am

Here are some transcoding rules for playing MOD music. I did only test this using Linux.

MikMod is used to transcode .xm .s3m and .it files to raw wave. Unfortunately MikMod is very picky and won't output raw data voluntarily. A wrapper script is needed. The following code is the needed wrapper script.
Code: Select all
#!/bin/bash
mikmod -d stdout --noloops -X -q -i --hqmixer --surround --norc "$1" | tee

Save the file in /var/subsonic/transcode/ under the name mikmod_stdout and make it executable.

Here is the rule for .xm:
xm > mp3 | xm | mp3 | mikmod_stdout %s | lame -r -b %b --tt %t --ta %a --tl %l -S --resample 44.1 - - | <blank>

For normal .mod files and more exotic formats (like .dw and .cus) uade is used.

Here is the rule for .mod:
mod > mp3 | mod | mp3 | uade123 %s --headphones2 -c | lame -b %b --tt %t --ta %a --tl %l -S --resample 44.1 - - | <blank>
yoshi252
 
Posts: 1
Joined: Wed Mar 16, 2011 12:43 am

Postby marsmayhem » Fri Aug 12, 2011 11:14 pm

Anyone get this working on Windows and care to share?
marsmayhem
 
Posts: 19
Joined: Wed Aug 10, 2011 7:09 am

Re: Transcoding for mod music

Postby ch604 » Thu Oct 23, 2014 2:41 pm

I had to make one tweak for this to work in centos; changing 'mikmod' in the wrapper script to '/usr/local/bin/mikmod'. i also had to install 'lame' again separately and symlink this to /var/subsonic/transcode instead of the lame file that came with subsonic.

the only issue is that mikmod seems to ignore the --noloops option and just loops the xm file over and over again. not ideal for playlist usage. i checked back after i noticed i was listening to the same song over and over, and the length reported was 100 minutes and increasing!

edit:
To fix this temporarily, i changed the script so that it would kill the mikmod process after a few seconds, which on my system, gives me a file of just under 2 minutes:

Code: Select all
#!/bin/bash
/usr/local/bin/mikmod -d stdout --noloops -X -q -i --hqmixer --surround --norc "$1" | tee &
pid=$!
sleep 7 && kill $pid


note the ampersand after 'tee'. not completely ideal, as it still loops when it shouldnt, and killing the process stops the music at a weird spot, but at least you wont have to go back and skip things manually and potentially fill up your hard disk with converted temp mp3 files.
ch604
 
Posts: 3
Joined: Thu Jun 13, 2013 1:31 pm

Re: Transcoding for mod music

Postby jedinerd » Wed Jun 24, 2015 8:28 pm

I was able to accomplish the same thing by recompiling ffmpeg with libmodplug support, using the original set of compilation options from the copy of ffmpeg included in subsonic. All i had to do after that was swap the two, and add xm and mod to the list of accepted formats, as well as to the existing audio transcode that comes in the vanilla subsonic installation.

Code: Select all
cd ffmpeg
PATH="$PATH:$HOME/bin" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
--prefix="$HOME/ffmpeg_build" \
--extra-cflags="-I$HOME/ffmpeg_build/include" \
--extra-ldflags="-L$HOME/ffmpeg_build/lib" \
--bindir="$HOME/bin" \
--enable-gpl \
--enable-libass \
--enable-libfdk-aac \
--enable-libfreetype \
--enable-libmp3lame \
--enable-libopus \
--enable-libtheora \
--enable-libvorbis \
--enable-libvpx \
--enable-libx264 \
--enable-libmodplug \
--enable-nonfree \
--extra-libs='-lxml2 -lexpat -lfreetype' \
--enable-static \
--disable-shared \
--disable-ffserver \
--disable-doc \
--enable-bzlib \
--enable-zlib \
--enable-postproc \
--enable-runtime-cpudetect \
--enable-gpl \
--enable-gray \
--enable-libass \
--enable-libfreetype \
--enable-libopenjpeg \
--enable-libspeex \
--enable-libvo-aacenc \
--enable-libvo-amrwbenc \
--enable-version3
jedinerd
 
Posts: 4
Joined: Thu May 14, 2015 10:18 pm


Return to Tutorials

Who is online

Users browsing this forum: No registered users and 9 guests