Ampache won't play FLAC files

1,557 views
Skip to first unread message

Andy Pastuszak

unread,
Feb 26, 2015, 9:37:28 PM2/26/15
to amp...@googlegroups.com
I have Ampache set to transcode FLAC files to MP3.  Worked fine until, I think today's udpate.  I click on a FLAC and now it just won't play.

This is what the log shows:

2015-02-26 21:35:48 [admin] (stream) -> Transcode command: avconv -i '/home/andy/music/David Bowie/Heroes/03 _Heroes_.flac' -i '/home/andy/music/David Bowie/Heroes/03 _Heroes_.flac' -vn -q:a 0 -c:a libmp3lame -f mp3 pipe:1
2015-02-26 21:35:48 [admin] (play) -> Starting stream of /home/andy/music/David Bowie/Heroes/03 _Heroes_.flac with size 44671248
2015-02-26 21:35:48 [admin] (play) -> Registering stream stats for {David Bowie - "Heroes"}...
2015-02-26 21:35:48 [admin] (user.class.php) -> Updating stats for {song/11956} {Mozilla/5.0 (Windows NT 6.3; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0}...
2015-02-26 21:35:48 [admin] (session) -> g0gqsdh7lvh9td4d8mhpgbbqo5 has been extended to Thu, 26 Feb 2015 22:35:48 -0500 extension length 3600
2015-02-26 21:35:48 [admin] (session) -> g0gqsdh7lvh9td4d8mhpgbbqo5 has been extended to Thu, 26 Feb 2015 22:35:48 -0500 extension length 3600
2015-02-26 21:35:48 [admin] (ajax.server.php) -> Called for page: {}
2015-02-26 21:35:48 [admin] (ajax.server.php) -> Called for page: {song}

Andy Pastuszak

unread,
Feb 26, 2015, 10:05:11 PM2/26/15
to amp...@googlegroups.com

Jeff Kennedy

unread,
Apr 19, 2015, 3:13:12 AM4/19/15
to amp...@googlegroups.com
What version? I'm having the same issue where everything is now working great (with your help on other issues, BTW), except FLAC playback doesn't work. My log files indicate something like "decided not to encode," but I have FLAC transcode set as required.

Any ideas?

Afterster

unread,
Apr 19, 2015, 3:15:48 AM4/19/15
to Jeff Kennedy, amp...@googlegroups.com
Jeff, I believe you only have some kind of transcoding misconfiguration.
If you want us to take a look, you can copy / past your transcode settings here.

--
You received this message because you are subscribed to the Google Groups "Ampache" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampache+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ampache/dbea2cef-4f87-46a4-8b9e-079fecf86d3f%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Jeff Kennedy

unread,
Apr 19, 2015, 9:15:23 PM4/19/15
to amp...@googlegroups.com, jeffke...@gmail.com

Yes. It is a real possibility that I have a configuration issue with FLAC files for some reason. When the default settings didn;t work for FLAC, I started modifying my ampache.cfg.php file to try to get it to transcode FLAC, as well as WAV and WMA, hoping I could take care of all three at once. Haven't tried anything but FLAC so far though.

I can confirm that FLAC streaming works in SubSonic, which is running on the same machine. Note that my environment is using Debian Wheezy on an ARM processor (CubieTruck hardware). There are some known issues with ffmpeg on ARM, but I have resolved those, as is evident in the fact that Subsonic will stream the FLAC files.

Anyway, here is the pertinent section of my ampache.cfg.php file


*;######################################################
; These are commands used to transcode non-streaming
; formats to the target file type for streaming.
; This can be useful in re-encoding file types that don't stream
; very well, or if your player doesn't support some file types.
;
; 'Downsampling' will also use these commands.
;
; To state the bleeding obvious, any programs referenced in the transcode
; commands must be installed, in the web server's search path (or referenced
; by their full path), and executable by the web server.

; Input type selection
; TYPE is the extension. 'allowed' certifies that transcoding works properly for
; this input format. 'required' further forbids the direct streaming of a format
; (e.g. if you store everything in FLAC, but don't want to ever stream that.)
; transcode_TYPE         = {allowed|required|false}
; DEFAULT: false
transcode_m4a = "allowed"
transcode_flac = "allowed"
transcode_flac_target = mp3
transcode_mpc = "required"
transcode_ogg = "allowed"
transcode_ogg_target = mp3
transcode_wav = "required"
transcode_mp3 = "allowed"
transcode_wav = required
transcode_wma = required
transcode_wav_target = mp3
transcode_wma_target = mp3


; Default output format
; DEFAULT: none
encode_target = "mp3"

; Override the default output format on a per-type basis
; encode_target_TYPE = TYPE
; DEFAULT: none
;encode_target_flac = mp3

; Allow clients to override transcode settings (output type, bitrate, codec ...)
; DEFAULT: true
transcode_player_customize = "1"

; Command configuration. Substitutions will be made as follows:
; %FILE% => filename
; %SAMPLE% => target sample rate
; You can do fancy things like VBR, but consider whether the consequences are
; acceptable in your environment.

; Master transcode command
; transcode_cmd should be a single command that supports multiple file types,
; such as ffmpeg or avconv. It's still possible to make a configuration that's
; equivalent to the old default, but if you find that necessary you should be
; clever enough to figure out how on your own.
; DEFAULT: none

;transcode_cmd = "ffmpeg -i %FILE%"

transcode_cmd           ="avconv -i  %FILE%"

;transcode_cmd = "avconv -i %FILE%"
;transcode_cmd = "/usr/bin/neatokeen %FILE%"



; Specific transcode commands
; It shouldn't be necessary in most cases, but you can override the transcode
; command for specific source formats.  It still needs to accept the
; encoding arguments, so the easiest approach is to use your normal command as
; a clearing-house.
; transcode_cmd_TYPE = TRANSCODE_CMD
;transcode_cmd_mid = "timidity -Or -o – %FILE% | ffmpeg -f s16le -i pipe:0"

transcode_cmd_flac = "flac -dc %FILE% | lame -b %SAMPLE% -S - - "
transcode_cmd_ogg       = "oggsplt -qn %FILE% %OFFSET% %EOF% -o - | oggdec -Q -o - - | lame -S -q 3 -b %SAMPLE% -S - -"

; Alternative command works better for some people
;transcode_cmd_m4a      =  "alac %FILE% | lame -h -b %SAMPLE% -S - -"
;transcode_cmd_ogg      = "mp3splt -qn %FILE% %OFFSET% %EOF% -o - | oggdec -Q -o - - | lame -S -q 3 -b %SAMPLE% -S - -"
;transcode_cmd_flac     = "flac -dc %FILE% | lame -rb %SAMPLE% -S - -"
; This line seems to work better for windows, switch if needed
; transcode_cmd_mp3     = "lame -q 3 -b %SAMPLE% -S %FILE% - -"



; Encoding arguments
; For each output format, you should provide the necessary arguments for
; your transcode_cmd.
; encode_args_TYPE = TRANSCODE_CMD_ARGS
;encode_args_mp3 = "-vn -b:a %SAMPLE%K -c:a libmp3lame -f mp3 pipe:1"
;encode_args_flac = "-vn -b:a %SAMPLE%K -c:a libflac -f mp3 pipe:1"
;encode_args_ogg = "-vn -b:a %SAMPLE%K -c:a libvorbis -f ogg pipe:1"
;encode_args_m4a = "-vn -b:a %SAMPLE%K -c:a libfdk_aac -f adts pipe:1"
encode_args_wav = "-vn -b:a %SAMPLE%K -c:a pcm_s16le -f wav pipe:1"


encode_args_ogg = "-vn -b:a max\(%SAMPLE%K\,49K\) -acodec libvorbis -vcodec libtheora -f ogg pipe:1"
encode_args_mp3 = "-vn -b:a %SAMPLE%K -acodec libmp3lame -f mp3 pipe:1"
;encode_args_ogv = "-vcodec libtheora -acodec libvorbis -ar 44100 -f ogv pipe:1"
;encode_args_mp4 = "-profile:0 baseline -frag_duration 2 -ar 44100 -f mp4 pipe:1"
; The following argument added according to github ampache issue 135
encode_args_wav = "-vn -b:a %SAMPLE%K -c:a pcm_s161e -f wav pipe:1"*



And my Ampache Log file:

*2015-04-20 03:03:39 [ampache] (play) -> Asked for type {song}
2015-04-20 03:03:39 [admin] (session) -> ucaruqgt56f1cjrjtescrldc50 has been extended to Mon, 20 Apr 2015 04:03:39 +0200 extension length 3600
2015-04-20 03:03:39 [admin] (session) -> c75c585973fe7cff9dbdd0d089bd3c89 has been extended to Mon, 20 Apr 2015 05:03:39 +0200 extension length 7200
2015-04-20 03:03:39 [admin] (ajax.server.php) -> Called for page: {song}
2015-04-20 03:03:39 [admin] (session) -> ucaruqgt56f1cjrjtescrldc50 has been extended to Mon, 20 Apr 2015 04:03:39 +0200 extension length 3600
2015-04-20 03:03:39 [admin] (play) -> Playing file (/media/data/Music_Collection/TemporaryAudioFolder/1967 - Clear Light/Clear Light - Clear Light - 07. She's Ready to be Free.flac}...
2015-04-20 03:03:39 [admin] (play) -> Media type {flac}
2015-04-20 03:03:39 [admin] (play) -> Custom play action {}
2015-04-20 03:03:39 [admin] (play) -> Transcode to {}
2015-04-20 03:03:39 [admin] (play) -> Decided not to transcode
2015-04-20 03:03:39 [admin] (ajax.server.php) -> Called for page: {}
2015-04-20 03:03:39 [admin] (session) -> Session created: 4a4eac134d5f7c46608012e241603da8
2015-04-20 03:03:39 [admin] (play) -> Starting stream of /media/data/Music_Collection/TemporaryAudioFolder/1967 - Clear Light/Clear Light - Clear Light - 07. She's Ready to be Free.flac with size 13745892
2015-04-20 03:03:41 [admin] (play) -> Registering stats for {She's Ready to be Free}...
2015-04-20 03:03:41 [admin] (user.class.php) -> Updating stats for {98893} {Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:37.0) Gecko/20100101 Firefox/37.0}...
2015-04-20 03:03:41 [admin] (Plugins) -> Plugin Headphones is not installed, skipping
2015-04-20 03:03:41 [admin] (Plugins) -> Plugin Bit.ly is not installed, skipping
2015-04-20 03:03:41 [admin] (Plugins) -> Plugin LyricWiki is not installed, skipping
2015-04-20 03:03:41 [admin] (Plugins) -> Plugin MusicBrainz does not support save_songplay, skipping
2015-04-20 03:03:41 [admin] (Plugins) -> Plugin Growl is not installed, skipping
2015-04-20 03:03:41 [admin] (Plugins) -> Plugin ChartLyrics is not installed, skipping
2015-04-20 03:03:41 [admin] (Plugins) -> Plugin Libravatar is not installed, skipping
2015-04-20 03:03:41 [admin] (Plugins) -> Plugin Gravatar is not installed, skipping
2015-04-20 03:03:41 [admin] (Plugins) -> Plugin Libre.FM is not installed, skipping
2015-04-20 03:03:41 [admin] (Plugins) -> Plugin Flickr does not support save_songplay, skipping
2015-04-20 03:03:41 [admin] (Plugins) -> Plugin YOURLS is not installed, skipping
2015-04-20 03:03:41 [admin] (Last.FM) -> No Username, not scrobbling
2015-04-20 03:03:41 [admin] (play) -> Stream ended at 16384 (16384) bytes out of 13745892
2015-04-20 03:03:45 [admin] (session) -> ucaruqgt56f1cjrjtescrldc50 has been extended to Mon, 20 Apr 2015 04:03:45 +0200 extension length 3600
2015-04-20 03:03:45 [admin] (ajax.server.php) -> Called for page: {index} *




For what it is worth, my SubSonic configuration has a "two step" transcoding configuration, and is as follows for FLAC files:

flac audio    flac    mp3    Step 1: flac --silent --decode --stdout %s    Step 2: lame --silent -h -b %b -

My SubSonic Downsampling command is: ffmpeg -i %s -map 0:0 -b:a %bk -v 0 -f mp3 -
ffmpeg -ss %o -t %d -i %s -async 1 -b:v %bk -s %wx%h -ar 44100 -ac 2 -v 0 -f mpegts -c:v libx264 -preset superfast -c:a libmp3lame -threads 0 -

The only reason I mention the SubSonic settings is because those actually work in SubSonic, and they may shed some light on how to properly configure Ampache to stream FLAC in my specific environment.

As always, thanks a lot for all of the help on this!


Afterster

unread,
Apr 20, 2015, 1:08:11 AM4/20/15
to Jeff Kennedy, amp...@googlegroups.com
If you're using 3.8.0-develop, you're missing some parameters (transcode_input, ...). In that case it would be better to copy/past transcoding settings from ampache.cfg.php.dist and edit it again.

Otherwise, to stream to flac your only need to setup:
transcode_flac (please set it to required for now)
encode_target
transcode_cmd (transcode_cmd_flac is optional, it depends if you want to use another software)
transcode_input (if 3.8.0)
encode_args_mp3


--
You received this message because you are subscribed to the Google Groups "Ampache" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampache+u...@googlegroups.com.

Jeff Kennedy

unread,
Apr 20, 2015, 8:44:20 AM4/20/15
to amp...@googlegroups.com, jeffke...@gmail.com
Thanks. I'm running version 3.7 (or is it 3.7.1 Debian?). I don't have access to my server right at the moment, but I know that the first 2 numbers are 3.7. In this environment, I don't have any data that I'm worried about keeping, so, I'm not opposed to installing a different version if that would get FLAC streaming working and enable some additional features.
 
Which specific version and distro do you recommend I get the values from for the ampache.cfg.php.dist file?
Reply all
Reply to author
Forward
0 new messages