Page 1 of 1

Transcoding Ogg --> MP3

PostPosted: Fri Feb 08, 2008 3:04 pm
by woloi
I have a significant number of ogg files, which is fine for when I'm home with Amarok/Winamp depending on which computer I'm on. However, if I'm using another computer that does not have an ogg decoder, the transcoding feature sounds great!

I have oggdec and lame installed on my Linux computer, and just to be safe I've even linked /var/subsonic/transcode/oggdec and /var/subsonic/transcode/lame to the actual binaries. When I look in the subsonic.log file, it appears as if it transcodes the entire file from ogg to mp3, but then fails to play.

Code: Select all
[2008-02-08 14:52:29,320] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/oggdec)      [100.0%]
[2008-02-08 14:52:29,320] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/lame) Assuming raw pcm input file
[2008-02-08 14:52:29,325] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/lame) LAME 3.97 64bits (http://www.mp3dev.org/)
[2008-02-08 14:52:29,325] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/lame) Using polyphase lowpass filter, transition band: 16538 Hz - 17071 Hz
[2008-02-08 14:52:29,325] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/lame) Encoding <stdin> to <stdout>
[2008-02-08 14:52:29,325] DEBUG InputStreamReaderThread - (/var/subsonic/transcode/lame) Encoding as 44.1 kHz 128 kbps j-stereo MPEG-1 Layer III (11x) qval=3


This stream fails to play in the webplayer as well as Winamp. Unchecking the ogg>mp3 transcode box results in a ogg stream being sent to Winamp, which does play ok. Any ideas?

PostPosted: Fri Feb 08, 2008 3:13 pm
by woloi
I figured it out right after I posted...

The default setting for ogg>mp3 is missing a dash after the -o.

Original: oggdec %s -o
Correct: oggdec %s -o -

Without that dash, it will not output to stdout, and since lame is expecting a stdin for an input, of course nothing ever happens and it just hangs. Everything seems to be working now though! :D

PostPosted: Fri Feb 08, 2008 5:12 pm
by Ikyo
I would also suggest taking a look at a script that I posted a little while back. It interfaces in with mplayer. If Mplayer can play the file, this script will transcode anything and send it into lame.

http://forum.subsonic.org/forum/viewtopic.php?t=671

PostPosted: Tue Feb 16, 2010 4:10 pm
by masa6614
what should i put in the step1 and step2 fields within subsonic?

PostPosted: Tue Feb 23, 2010 6:04 pm
by masa6614
nevermind

step1: oggdec %s -o

step2: lame -b %b - -

PostPosted: Fri Mar 25, 2011 6:21 am
by grigorianz

ogg --> mp3 transcoding working under Linux

PostPosted: Wed Apr 20, 2011 5:54 pm
by Josholith
My configuration that is currently working to stream/transcode ogg --> mp3 under Linux (openSUSE 11.4 server, running the WAR version of Subsonic 4.4 in Tomcat):

Step 1:
oggdec -Q -o /dev/stdout %s

Step 2:
lame -b %b - -

Note, the -Q option in step 1 is optional, but without it, you will get hundreds of lines in your subsonic.log showing useless percent% completion stats from the oggdec process.

Hope it works for you.