Transcoding from FLAC to OGG for your Android FAIL

Need help? Post your questions here.

Moderator: moderators

Postby yourlord » Fri Jun 03, 2011 5:45 pm

are you using flac for the 1st stage in the transcode or still using ffmpeg?

open a command line and try
flac -d -s -o - test.flac |oggenc2 -Q -q2 -o test.ogg -

the goal is to work from the ground up.. make sure our tools generate a usable file, then we'll tackle subsonic.
yourlord
 
Posts: 29
Joined: Fri Apr 29, 2011 1:05 am

Postby GJ51 » Fri Jun 03, 2011 6:06 pm

yourlord wrote:are you using flac for the 1st stage in the transcode or still using ffmpeg?

open a command line and try
flac -d -s -o - test.flac |oggenc2 -Q -q2 -o test.ogg -

the goal is to work from the ground up.. make sure our tools generate a usable file, then we'll tackle subsonic.


test flac: WARNING, cannot check MD5 signature since it was unset in the STREAMINFO
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Postby yourlord » Fri Jun 03, 2011 6:08 pm

that's fine.. i got the same thing with the test file i got from you.. flac can store an md5 checksum to validate the decoded audio is an exact match to what was encoded, but it's not necessary.

is the ogg file playable?
yourlord
 
Posts: 29
Joined: Fri Apr 29, 2011 1:05 am

Postby GJ51 » Fri Jun 03, 2011 6:24 pm

Yes, it will play on my EVO, but does not play on the desktop unless transcoded to mp3.
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Postby GJ51 » Fri Jun 03, 2011 6:44 pm

flac.exe --decode --stdout %s | oggenc2.exe -b %b -s 1 -o - -

Fails on both Android and desktop.

Sound

The player supports sounds (provider=sound) in the following format:
MP3 ( .mp3 ) — Flash and HTML5
Audio encoded with the MP3 codec. Though not as good as AAC, MP3 is very widely used. It is also supported by nearly any device that can play audio.


Note: If you encounter too fast or too slow playback of MP3 files, it contains variable bitrate encoding or unsupported sample frequencies (eg 48Khz). Please stick to constant bitrate encoding and 44 kHz. The free iTunes software has an MP3 encoder built-in.
AAC ( .aac, .m4a ) — Flash and HTL5
Audio encoded with the AAC codec. Note: In Flash mode, the player must use the video provider to playback this audio, since the sound provider only supports MP3. In HTML5 mode, AAC audio should use the "sound" provider. To avoid confusion, simply make sure the file has an ".aac" extension, and omit the "provider" option. The player will properly detect the provider.
OGG Vorbis ( .ogg ) — HTML5 only
Audio in the OGG container format containing Vorbis encoded audio. The Vorbis codec is maintained by Xiph.org.
WAV ( .wav ) — HTML5 only
Uncompressed waveform audio. Using WAV on the web is generally discouraged, since compression rates for lossy formats such as MP3 and OGG Vorbis greatly reduce the amount of data needed to stream the audio.


When it says JW will play .ogg - HTML5 only, do we know what we would need to have SS play .ogg audio without being transcoded to mp3?
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Postby yourlord » Fri Jun 03, 2011 8:11 pm

Now we need to be clear.

The flash player subsonic uses won't play ogg vorbis.

You have to set up an external player to handle that on a desktop (I use VLC for this)..

I'm not sure why it's failing on Android. My subsonic android client plays ogg vorbis just fine.

Add a -Q to the oggenc command to prevent it outputting text which may interfere with the stream

But at least it appears we're getting a good encode.
yourlord
 
Posts: 29
Joined: Fri Apr 29, 2011 1:05 am

Postby GJ51 » Sat Jun 04, 2011 2:21 am

flac.exe --decode --stdout %s | oggenc2.exe -Q -q2 -s 1 -o - -

It works! I'm not sure this is the best setting, but at least it is finally working.

Thanks for all the patient hand holding.
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Postby GJ51 » Sun Jun 05, 2011 9:45 pm

OK guys, thanks for all the help getting flac > ogg working.

Now I'd like to know what to do to get mp3 > ogg working as most of my library is 256kbps mp3, I'm thinking that if I can get mp3 to ogg q3 working, that I'll get less buffering when I don't have a strong 3g signal and still get the same playback quality.

Any input appreciated. I've tried a few thing, but can't get a stream to the Android going.

oggenc2.exe -Q -q2 -s 1 -o - -

by itself, isn't working.

EDIT: Stozher's transcodings work!

ffmpeg -v 0 -i %s -f ogg -vn -acodec libvorbis -ar 44100 -aq 9 -ac 2 -map_meta_data 0:0 -

I changed aq 9 to aq 2 to lower the bitrate.
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

flac>ogg streaming to android still doesn't recover

Postby papatel » Fri Jun 10, 2011 7:32 pm

As described in my original post, using any transcoding method in the forms (yes I've tried over 10 methods...) from flac > ogg, if the stream is interrupted (ie data connection lost or wifi enables/disables during the stream) playback fails/stops on the android device and never recovers leaving a corrupted file on the SD Card.

It's particularly annoying because you have to manually delete the file or subsonic thinks its fine and plays back the damaged file that cuts out at some point.

It happens on both my Nexus One and my Atrix using wifi and 3g AT&T connections.
I'm running Debian Squeeze with a clean subsonic install. I also ran on Debian Lenny before with the same issue. I'm using an E3000 linksys router with DD-WRT firmware if that matters.

Many people claim their ogg transcoding is working, and for me it does perfectly until you interrupt the stream (intentionally or lose cell data service temporarily). On the same server/client with the same flac files transcoding to MP3 always recovers the stream if the data connection is interrupted so I know my setup is sound.

I'm about to give up on this and just settle with MP3 transcoding :( My guess is that it's the Android client not reconstructing the stream properly upon opening a new connection to the server, but I really have no evidence to support this.

It would be so awesome if someone could repro my issue to help me debug. Since I haven't got much help from Sindre (I know he's busy), I'll even put out a bounty for whomever solves this if necessary. If this is fixed, subsonic will be the only streaming media server that supports gapless playback on an android device.
papatel
 
Posts: 21
Joined: Fri Jul 09, 2010 12:10 am

Postby GJ51 » Fri Jun 10, 2011 8:23 pm

Has anyone else tested your site on a different device? We first need to determine if it's the Subsonic site or the phone.

Also please test your phone on my site as I have it working fine on my phone. If you get the same problem on my site, then you have an issue with the phone or your provider.

If you want me to test your site, send me a pm with the credentials for a guest account.

You might also try this transcoding:

ffmpeg -v 0 -i %s -f ogg -vn -acodec libvorbis -ar 44100 -aq 9 -ac 2 -map_meta_data 0:0 -

This was modified from Stozher's recommendation.

http://forum.subsonic.org/forum/viewtopic.php?t=5121
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Postby papatel » Fri Jun 10, 2011 10:20 pm

As I stated, I tried on both my nexus and my atrix. I have connected my phone to your site but having trouble finding any content that will transcode to ogg format. (all I found were mp3s). Mp3s have always worked for me.
papatel
 
Posts: 21
Joined: Fri Jul 09, 2010 12:10 am

Postby tschan » Tue Jun 14, 2011 11:45 pm

Have you tried the fix I decribed here?

That fixed the issue for me.
tschan
 
Posts: 16
Joined: Sat Jan 01, 2011 9:43 pm

Postby GJ51 » Wed Jun 15, 2011 1:12 am

papatel wrote:As I stated, I tried on both my nexus and my atrix. I have connected my phone to your site but having trouble finding any content that will transcode to ogg format. (all I found were mp3s). Mp3s have always worked for me.


Click the folders selector. Try the one that says "Flac Music."

MP3's are also set to transcode to ogg.
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Solved!

Postby papatel » Wed Jun 15, 2011 1:44 am

thanks tschan! I can't believe I missed your post before. I tried everything in the forums except the advice given on the thread I started...

Streaming works like a charm now. Interestingly, GJ51 and I determined that only some phones break when you don't have the "-s 1" added to the oggenc command. Now my nexus and my atrix stream ogg from subsonic perfectly.

Thanks for your persistence!!
papatel
 
Posts: 21
Joined: Fri Jul 09, 2010 12:10 am

Postby GJ51 » Wed Jun 15, 2011 1:51 am

Glad you got it. The Moto's do seem to have their own set of quirks. I now have all my music set to transcode to ogg for Android playback. It really helps when you have a less than ideal 3g signal, and the quality is excellent.

Long hard battle to get it working, but definitely worth it. :D
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

PreviousNext

Return to Help

Who is online

Users browsing this forum: No registered users and 22 guests