Page 1 of 1

[Solved] Transcoding FLAC to MP3

PostPosted: Sat Nov 27, 2010 9:40 pm
by PieterB
I've been searching for answers quite a while now, but haven't found anything useful.

I am running 3.7 (build 898) – June 15, 2009

I want to transcode flac to MP3

I have:

Step 1: flac *.wav (I lost the default, which didn't work)
Step 2: lame -v -V 0 -b 96 -B 320 -x - -

This setup doesn't work, what WOULD work?

Thanks for answering.

PieterB

PostPosted: Sat Nov 27, 2010 11:27 pm
by ShaqFu
What version of Subsonic are you running, and what error is it throwing?

I had issues getting transcoding to work until I placed ffmpeg and lame binaries in /var/subsonic/transcode (using the WAR version on OpenSolaris). If Subsonic's not seeing the necessary binaries, that might be why.

PostPosted: Sun Nov 28, 2010 9:16 am
by stozher
Step 1: flac -d -s %s -
Step 2: lame --preset cbr %b -S - -

or

Step 1: ffmpeg -i %s -f wav -ar 44100 -ac 2 -
Step 2: lame --preset cbr %b -S - -

%s - source file (*.flac); %b - bitrate (192 is a good choice)

I'm not sure about version 3.7 but if above examples don't work - post another transcoding row from your version here.

PostPosted: Sun Nov 28, 2010 10:34 am
by PieterB
stozher wrote:I'm not sure about version 3.7 but if above examples don't work - post another transcoding row from your version here.


Thanks very much.

flac > mp3 settings

Step 1: flac -d -s %s -
Step 2: lame -v -V 0 -b 96 -B 320 -x - -

Doesn't play the file (through MediaMonkey) but produces a .wav file in the same directory as the .flac file!

This is the log:

[11/28/10 1:41:14 PM CET] INFO StreamController Starting stream PieterB@127.0.0.1:4330 (MediaMonkey)
[11/28/10 1:41:14 PM CET] INFO PlaylistInputStream Opening new song Complete CD2 - Symphony no 2 in C minor Resurrection - Zubin Mehta & Vienna Philharmonic Orchestra - Ileana Cotrubas - Christa Ludwig\006 No 2 in C minor - 1. Allegro maestoso.flac
[11/28/10 1:41:15 PM CET] DEBUG TranscodeInputStream Starting transcoder: [c:\subsonic\transcode\flac] [-d] [-s] [\\Naslite-11\Disk-1\Music\Gustav Mahler\Mahler Complete Works DGG\Complete CD2 - Symphony no 2 in C minor Resurrection - Zubin Mehta & Vienna Philharmonic Orchestra - Ileana Cotrubas - Christa Ludwig\006 No 2 in C minor - 1. Allegro maestoso.flac] [-]
[11/28/10 1:41:15 PM CET] DEBUG TranscodeInputStream Starting transcoder: [c:\subsonic\transcode\lame] [-v] [-V] [0] [-b] [96] [-B] [320] [-x] [-] [-]
[11/28/10 1:42:09 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\lame) Assuming raw pcm input file : Forcing byte-swapping
[11/28/10 1:42:09 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\lame) LAME version 3.96.1 (http://lame.sourceforge.net/)
[11/28/10 1:42:09 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\lame) CPU features: MMX (ASM used), SSE, SSE2
[11/28/10 1:42:09 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\lame) Using polyphase lowpass filter, transition band: 19383 Hz - 19916 Hz
[11/28/10 1:42:09 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\lame) Encoding to
[11/28/10 1:42:09 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\lame) Encoding as 44.1 kHz VBR(q=0) j-stereo MPEG-1 Layer III (ca. 5.7x) qval=3
[11/28/10 1:42:29 PM CET] INFO StreamController Stopping stream PieterB@127.0.0.1:4330 (MediaMonkey)



Here's the working wma > mp3 steps:

Step 1: wmadec %s
Step 2: lame -v -V 0 -b 96 -B 320 -x - -

PieterB

PostPosted: Sun Nov 28, 2010 3:28 pm
by sindre_mehus
My best advice is to:

1) Upgrade to the latest Subsonic version.

2) Use the recommended transcoding settings: http://www.subsonic.org/pages/transcoding.jsp

Regards,
Sindre

PostPosted: Sun Nov 28, 2010 4:31 pm
by PieterB
Thank you very much!

It works perfectly. I have one question, however:

The standard de/transcoding settings, will they give you the maximum mp3 bitrate, or do I have to specify that 320 somewhere?

It is still a miracle, how well your software performs. I do like the Subsonic headphones!

PieterB

PostPosted: Sun Nov 28, 2010 5:58 pm
by PieterB
PieterB wrote:It works perfectly


That was too quick!

Yes, .flac transcoding works beautiful (how do I get the 'insane' bitrate of 320?)

Yes, native mp3 files play without problems

BUT: all my .wma lossless files DO NOT PLAY AT ALL.
Also: the album count suddenly cuts the database in half: ~ 450 real, count 220

This is the log file:

[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) libavcodec 52.47. 0 / 52.47. 0
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) libavformat 52.47. 0 / 52.47. 0
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) libavdevice 52. 2. 0 / 52. 2. 0
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) libavfilter 1.15. 0 / 1.15. 0
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) libswscale 0. 8. 0 / 0. 8. 0
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) libpostproc 51. 2. 0 / 51. 2. 0
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) [asf @ 003ede70]max_analyze_duration reached
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) Input #0, asf, from '\\Naslite-11\Disk-1\Music\La Gaia Scienza\Brahms- Piano Quartet, Op. 60 - Piano Quintet, Op. 34\08 Qnt in f, Op.34- Finale, Poco Sostenuto-Allegro Non Troppo La Gaia Scienza Brahms- Piano Quartet, Op. 60 - Piano Quintet, Op. 34.wma':
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) Metadata:
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) title : Qnt in f, Op.34: Finale, Poco Sostenuto/Allegro Non Troppo
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) author : La Gaia Scienza
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) copyright :
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) comment :
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) Lyrics :
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) MediaPrimaryClassID: {D1607DBC-E323-4BE2-86A1-48A42A28441E}
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) WMFSDKVersion : 11.0.5721.5145
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) WMFSDKNeeded : 0.0.0.0000
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) IsVBR : 1
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) ASFLeakyBucketPairs:
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) SDB/Rating : -1
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) ToolName : MediaMonkey
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) ToolVersion : 2.5.5
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) Year : 2001
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) EncodingTime : 2142751
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) UniqueFileIdentifier: ;
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) Composer : Johannes Brahms
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) Publisher : Winter & Winter
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) Genre : Classical
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) AlbumTitle : Brahms: Piano Quartet, Op. 60 / Piano Quintet, Op. 34
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) AlbumArtist : La Gaia Scienza
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) MCDI : 8+96+BF24+106C1+19CF8+254A6+35818+3EBC7+46F00+51DAD
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) Provider : User Feedback
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) PeakValue : 322
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) AverageLevel : 421
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) TrackNumber : 8
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) Period : Romantic (1820-1869)
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) ProviderStyle : Chamber
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) Duration: 00:09:56.21, start: 3.000000, bitrate: 569 kb/s
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) Stream #0.0(eng): Audio: 0x0163, 44100 Hz, 2 channels, 1152 kb/s
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) Output #0, wav, to 'pipe:':
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) Stream #0.0(eng): Audio: pcm_s16le, 44100 Hz, 2 channels, s16, 1411 kb/s
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) Stream mapping:
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) Stream #0.0 -> #0.0
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\ffmpeg) Decoder (codec id 86057) not found for input stream #0.0
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\lame) Assuming raw pcm input file
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\lame) LAME version 3.96.1 (http://lame.sourceforge.net/)
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\lame) CPU features: MMX (ASM used), SSE, SSE2
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\lame) Using polyphase lowpass filter, transition band: 17249 Hz - 17782 Hz
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\lame) Encoding to
[11/28/10 6:50:03 PM CET] DEBUG InputStreamReaderThread (c:\subsonic\transcode\lame) Encoding as 44.1 kHz 128 kbps j-stereo MPEG-1 Layer III (11x) qval=3

PieterB

PostPosted: Sun Nov 28, 2010 8:20 pm
by sindre_mehus
Sounds like that ffmpeg doesn't support wma lossless. If it worked with your previous setup you can change the transcoding settings for wma as follows:

Go to Settings > Transcoding, and specify:
Step 1: wmadec %s
Step 2: lame -b %b --tt %t --ta %a --tl %l -S --resample 44.1 -x - -

Hope this helps,
Sindre

wma lossless > mp3

PostPosted: Sun Nov 28, 2010 9:40 pm
by PieterB
Well, it's funny how solutions are found.

The solution is half your's and half mine:

Step 1: wmadec %s
Step 2: lame -v -V 0 -b 96 -B 320 -x - -


Your solution (lame -b %b --tt %t --ta %a --tl %l -S --resample 44.1 -x - - ) created a horrible 'hiss', with a slight tonal component, meaning that if you know the music, there is a moment that you recognize it -headache included.

By the way: this lame instructions don't work with .flac; How can I force the .flac rendering to be played @320kbps?

PieterB

PostPosted: Sun Nov 28, 2010 10:18 pm
by sindre_mehus
Glad that it worked.

To hard-code a certain bitrate, just include "-b 320" in the LAME command.

PostPosted: Sun Nov 28, 2010 10:29 pm
by PieterB
Thanks for the assistance. Just love your program, every day. Functionality, interface, graphical layout...

Thanks for doing this.

PieterB