Page 1 of 1

Subsonic doesn't play FLAC files

PostPosted: Wed Nov 28, 2012 9:50 pm
by jahtimes
Hi, I'm new to subsonic. I installed Subsonic on my server, it plays fine mp3 but not FLAC :(

Here is my log :

[28/11/12 21:38:49 UTC] INFO PlayQueueInputStream admin listening to "Black Sabbath - Black Sabbath (2007) - FLAC/01. Black Sabbath .flac"
[28/11/12 21:38:50 UTC] DEBUG TranscodeInputStream Starting transcoder: [/*****************************/subsonic/transcode/ffmpeg] [-i] [/*********************************/data/Black Sabbath - Black Sabbath (2007) - FLAC/01. Black Sabbath .flac] [-ab] [128k] [-v] [0] [-f] [mp3] [-]
[28/11/12 21:38:50 UTC] DEBUG AudioScrobblerService Successfully registered now playing for song 'Black Sabbath' for user miozoim at Last.fm: Wed Nov 28 21:38:50 UTC 2012
[28/11/12 21:38:50 UTC] DEBUG AudioScrobblerService Successfully registered submission for song 'A day apart' for user miozoim at Last.fm: Wed Nov 28 21:38:50 UTC 2012
[28/11/12 21:38:50 UTC] DEBUG InputStreamReaderThread (/********************/subsonic/transcode/ffmpeg) FFmpeg version SVN-r0.5.6-4:0.5.6-3, Copyright (c) 2000-2009 Fabrice Bellard, et al.
[28/11/12 21:38:50 UTC] DEBUG InputStreamReaderThread (/********************/subsonic/transcode/ffmpeg) configuration: --extra-version=4:0.5.6-3 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libdirac --enable-libgsm --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libfaad --enable-libdc1394 --enable-shared --disable-static
[28/11/12 21:38:50 UTC] DEBUG InputStreamReaderThread (/***************************/subsonic/transcode/ffmpeg) libavutil 49.15. 0 / 49.15. 0
[28/11/12 21:38:50 UTC] DEBUG InputStreamReaderThread (/***************************/subsonic/transcode/ffmpeg) libavcodec 52.20. 1 / 52.20. 1
[28/11/12 21:38:50 UTC] DEBUG InputStreamReaderThread (/**************************/subsonic/transcode/ffmpeg) libavformat 52.31. 0 / 52.31. 0
[28/11/12 21:38:50 UTC] DEBUG InputStreamReaderThread (/*************************/subsonic/transcode/ffmpeg) libavdevice 52. 1. 0 / 52. 1. 0
[28/11/12 21:38:50 UTC] DEBUG InputStreamReaderThread (/******************************/subsonic/transcode/ffmpeg) libavfilter 0. 4. 0 / 0. 4. 0
[28/11/12 21:38:50 UTC] DEBUG InputStreamReaderThread (/******************************/subsonic/transcode/ffmpeg) libswscale 0. 7. 1 / 0. 7. 1
[28/11/12 21:38:50 UTC] DEBUG InputStreamReaderThread (/*********************************/subsonic/transcode/ffmpeg) libpostproc 51. 2. 0 / 51. 2. 0
[28/11/12 21:38:50 UTC] DEBUG InputStreamReaderThread (/*******************************/subsonic/transcode/ffmpeg) built on Dec 31 2011 16:14:46, gcc: 4.4.5
[28/11/12 21:38:50 UTC] DEBUG InputStreamReaderThread (/******************************/subsonic/transcode/ffmpeg) Input #0, flac, from '*****************************************/Black Sabbath - Black Sabbath (2007) - FLAC/01. Black Sabbath .flac':
[28/11/12 21:38:50 UTC] DEBUG InputStreamReaderThread (/****************************/subsonic/transcode/ffmpeg) Duration: N/A, bitrate: N/A
[28/11/12 21:38:50 UTC] DEBUG InputStreamReaderThread (/*****************************/subsonic/transcode/ffmpeg) Stream #0.0: Audio: flac, 44100 Hz, stereo, s16
[28/11/12 21:38:50 UTC] DEBUG InputStreamReaderThread (/********************************/subsonic/transcode/ffmpeg) Stream mapping:
[28/11/12 21:38:50 UTC] DEBUG InputStreamReaderThread (/*************************************/transcode/ffmpeg) Stream #0.0 -> #0.0
[28/11/12 21:38:50 UTC] DEBUG InputStreamReaderThread (/**********************************/subsonic/transcode/ffmpeg) Unsupported codec for output stream #0.0

Any help would be appreciated, thanks !

It puts the same thing for all FLAC files.

Re: Subsonic doesn't play FLAC files

PostPosted: Mon Dec 03, 2012 8:40 pm
by jahtimes
up!

Re: Subsonic doesn't play FLAC files

PostPosted: Tue Dec 04, 2012 1:27 pm
by nordboerg
I guess you haven't changed any of your transcoding settings in subsonic, right? cause it seems it's trying to use the default ffmpeg codec.
if you want to play flac files I suggest you to use a two step encodig method, first convert the flac to wav, then convert the wav to mp3.

to do this you should get the latest lame and flac codecs.

if you're on debian you can do this with

sudo apt-get install flac
sudo apt-get install lame (I just went through this configuration process on a raspberry pi, and I had to reinstall lame there to get it work, at least I guess I had to)

then you should link the codecs to your subsonic/transcode directory
sudo ln -s /usr/bin/flac /var/subsonic/transcode
sudo ln -s /usr/bin/lame /var/subsonic/transcode

now that you have the codecs you can configure subsonic
go to settings > transcoding and take the first record "mp3 audio"
copy the following to step 1: flac -c -d -F %s
and put this to step 2: lame -V 0 --vbr-new - -

this will also give you the best possible quality you can get while you stream your lossless files.

let me know if it works, cheers!

*edit: updated my post. ln -a instead of cp is more practical.

Re: Subsonic doesn't play FLAC files

PostPosted: Wed Dec 05, 2012 2:53 pm
by HerrNilsson
nordboerg wrote:I guess you haven't changed any of your transcoding settings in subsonic, right? cause it seems it's trying to use the default ffmpeg codec.
if you want to play flac files I suggest you to use a two step encodig method, first convert the flac to wav, then convert the wav to mp3.

to do this you should get the latest lame and flac codecs.

if you're on debian you can do this with

sudo apt-get install flac
sudo apt-get install lame (I just went through this configuration process on a raspberry pi, and I had to reinstall lame there to get it work, at least I guess I had to)

then you should copy the codecs to your subsonic/transcode directory
sudo cp /usr/bin/flac /var/subsonic/transcode
sudo cp /usr/bin/lame /var/subsonic/transcode

now that you have the codecs you can configure subsonic
go to settings > transcoding and take the first record "mp3 audio"
copy the following to step 1: flac -c -d -F %s
and put this to step 2: lame -V 0 --vbr-new - -

this will also give you the best possible quality you can get while you stream your lossless files.

let me know if it works, cheers!


Thanks! This worked for me :)

Re: Subsonic doesn't play FLAC files

PostPosted: Wed Dec 05, 2012 3:12 pm
by libussa
couple of things to complete your answer...

nordboerg wrote:I guess you haven't changed any of your transcoding settings in subsonic, right? cause it seems it's trying to use the default ffmpeg codec.
if you want to play flac files I suggest you to use a two step encodig method, first convert the flac to wav, then convert the wav to mp3.


actually, ffmpeg can transcode flac, and it can do it in 1 step. The default subsonic transcode command works perfectly !

nordboerg wrote:
then you should copy the codecs to your subsonic/transcode directory
sudo cp /usr/bin/flac /var/subsonic/transcode
sudo cp /usr/bin/lame /var/subsonic/transcode


This method is not recommended ; by doing so, you physically copy the binary into the subsonic directory ; when your distro is going to update those, subsonic will still be using the old, deprecated version. You're better off creating a symbolic link :

Code: Select all
ln -s /usr/bin/ffmpeg /var/subsonic/transcode


if you absolutely want to use the 2-step transcode, just do the same for flac and lame

Re: Subsonic doesn't play FLAC files

PostPosted: Wed Dec 05, 2012 10:34 pm
by nordboerg
Yea, a symbolic link is definitely a better way to add the codecs, true.
But ffmped didn't work for me either, maybe a reinstall could have solved that, but the two step conversion is also more transparent (at least to me) and the lame codec is kind of a standard when it comes to audio encoding

Re: Subsonic doesn't play FLAC files

PostPosted: Fri Dec 07, 2012 9:52 pm
by jahtimes
nordboerg wrote:I guess you haven't changed any of your transcoding settings in subsonic, right? cause it seems it's trying to use the default ffmpeg codec.
if you want to play flac files I suggest you to use a two step encodig method, first convert the flac to wav, then convert the wav to mp3.

to do this you should get the latest lame and flac codecs.

if you're on debian you can do this with

sudo apt-get install flac
sudo apt-get install lame (I just went through this configuration process on a raspberry pi, and I had to reinstall lame there to get it work, at least I guess I had to)

then you should copy the codecs to your subsonic/transcode directory
sudo cp /usr/bin/flac /var/subsonic/transcode
sudo cp /usr/bin/lame /var/subsonic/transcode

now that you have the codecs you can configure subsonic
go to settings > transcoding and take the first record "mp3 audio"
copy the following to step 1: flac -c -d -F %s
and put this to step 2: lame -V 0 --vbr-new - -

this will also give you the best possible quality you can get while you stream your lossless files.

let me know if it works, cheers!


Thanks, the two steps method works great ! Don't know why the default method doesn't !

Resolved !

Re: Subsonic doesn't play FLAC files

PostPosted: Sat Dec 08, 2012 10:00 am
by nordboerg
jahtimes wrote:Thanks, the two steps method works great ! Don't know why the default method doesn't !

Resolved !

Glad to hear! I think if you delete the ffmpeg codec which comes with subsonic, reinstall it from repository and link the new one to the transcode folder it should work.

Re: Subsonic doesn't play FLAC files

PostPosted: Mon Dec 24, 2012 11:42 am
by getwired
This is a ONE STEP method for FLAC to CBR MP3 that works great, correctly preserves tags, obeys Subsonic player bit-rates, and down-samples to 44.1KHz/16bit/stereo. Optimized and tested with Subsonic 4.7, Winamp 5.63, N7 Player (Android).

Code: Select all
ffmpeg -i %s -ar 44100 -ac 2 -request_sample_fmt s16 -acodec libmp3lame -ab %bk -map_metadata 0:0 -f mp3 -id3v2_version 3 -

Try it if you want... :wink:

Re: Subsonic doesn't play FLAC files

PostPosted: Tue Dec 25, 2012 12:16 am
by nordboerg
getwired wrote:This is a ONE STEP method for FLAC to CBR MP3 that works great, correctly preserves tags, obeys Subsonic player bit-rates, and down-samples to 44.1KHz/16bit/stereo. Optimized and tested with Subsonic 4.7, Winamp 5.63, N7 Player (Android).

Code: Select all
ffmpeg -i %s -ar 44100 -ac 2 -request_sample_fmt s16 -acodec libmp3lame -ab %bk -map_metadata 0:0 -f mp3 -id3v2_version 3 -

Try it if you want... :wink:

Can you set it to encode to VBR instead of CBR?

Re: Subsonic doesn't play FLAC files

PostPosted: Tue Dec 25, 2012 1:11 am
by getwired
nordboerg wrote:Can you set it to encode to VBR instead of CBR?


Sure, but you're going to need a newer FFMPEG binary on your system that supports the transcoding you want. First, look here, then decide what your target "quality" should be. Once you have that decided, put the new FFMPEG binary in your transcode folder (backup the original). Then update your transcoding string like the example below, "-q:a x", where x is the VBR quality level you want. Good luck, but it's actually pretty easy.

Code: Select all
ffmpeg -i %s -ar 44100 -ac 2 -request_sample_fmt s16 -acodec libmp3lame -q:a 0 -map_metadata 0:g:0 -f mp3 -id3v2_version 3 -