Transcoding from FLAC to OGG for your Android FAIL

Need help? Post your questions here.

Moderator: moderators

Postby GJ51 » Thu Jan 20, 2011 8:06 pm

Can't blame you for not wanting to keep a Win 7 box on 24/7. I just used Stozher's settings in the standard windows 4.4beta install. I didn't download or modify anything else, just using his settings with SS 4.4beta worked as you saw.

Seperately, I thinkk if you want 24/7 access to Subsonic, you might give some thought to building a server for it. I just saw a 65W AMD quad core builders system on tiger direct with 2GB ram and a 1TB hard drive for $249. Great starter system for a WHS box. You can put any OS you want on one of these Cheap boxes or even put one together with your own specs. I like the 65W quad cores for the energy savings. My WHS and my Server 2008R2 box combined use about the same energy as one 120W light bulb. If your going to get into video streaming and do some on-the-fly transcoding, you'll want at least a halfway decent quad core in the server. The more pwer = better performance really applies to Subsonic. Server power, connection speed (particularly upload bandwidth) plus the capability of the playback device at the recieving end are ALL important factors in improving SS performance. I enjoy building, debugging, and tweaking. If that's what you're into, Subsonic is a blast.

YMMV :D

http://www.tigerdirect.com/applications ... tigeremail

Just an example of what you can get for the price. Not a specific recommendation.
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 » Thu Jan 20, 2011 8:17 pm

Thanks for the info. I actually have a dedicated subsonic box that is also my storage server. Its running debian squeeze and other than this small problem, it has worked like a charm for over a year now.

I'm wondering if the bug I've noticed is only for linux or somehow I've screwed up my subsonic/transcoding/player. What I need is someone with a linux install to see if they have the same issue transcoding with flac>ogg when data is interrupted.

I just tried to install subsonic on my win7 box and it claims to work but when I navigate to localhost the subsonic server does not respond soon after I login. I tried changing the port, same problem. Anyway, that isn't the issue I want to debug. Win 7 is not a server OS, and I won't run it permanently. Perhaps I'll try a vbox running win2k8 and see if that solves it. Any other ideas?
papatel
 
Posts: 21
Joined: Fri Jul 09, 2010 12:10 am

Postby GJ51 » Thu Jan 20, 2011 8:38 pm

Sorry, can't think of much else. I'm a Windows only guy, just because I grew up that way. :lol: Maybe the Linux guys will have some suggestions.
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 stozher » Fri Jan 21, 2011 12:08 pm

GJ51, is this files on your server pretranscoded to low-quality OGG?

I work on script with function to use pretranscoded files from hidden subfolder of current album but with no success at this time... My idea:

Step 1: %s -> %sdirname + %sfilename
Step 2: ffmpeg -i %sdirname/.lowqualitymp3/%sfilename.mp3 -acodec copy -

... or just using 'cat' command to copy LQ MP3 to -
http://music.stozher.com:8080/login.view?user=guest&password=
User avatar
stozher
 
Posts: 313
Joined: Tue Nov 16, 2010 10:56 am
Location: Sofia, Bulgaria

Postby GJ51 » Fri Jan 21, 2011 4:49 pm

As I was experimenting with this issue I created a folder with a couple albums converted to 64kbps ogg. I also have a cd that I ripped to flac for testing.

I can set up an admin account for you to look at my public server if you like. Just pm me if you want me to set it up.

http://maplegrove.subsonic.org

guest
guest

Folder = OGG Music

Folder/Albums/Handel Messiah is flac
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 bemymonkey » Mon Apr 11, 2011 6:30 am

Is there any way to get this to work with a stock Windows install of Subsonic? Or do I really need a custom compiled version of FFMPEG? :(

-edit- Hah, just tried stozher's VBR transcoder on stock Windows install... it works! Is there a way to enable seeking? Or is that inherently impossible on ABR/VBR?
bemymonkey
 
Posts: 41
Joined: Tue Feb 08, 2011 12:05 pm

Postby tschan » Thu May 26, 2011 8:04 pm

I finally figured out what the problem was (after spending some time browsing the Subsonic source code to determine how resuming the stream is actually implemented).

It turns out that it's neither a problem with Subsonic itself nor with the android client.

The ogg encoder (oggenc) is the culprit. I noticed that given the exact same input it does not produce the same bit exact output. The actual audio data is the same but apparently it uses a different serial number each time which results in a different bitstream.

The (excruciating simple) solution for this problem is to just add the option "-s 1" to the command line of the encoder. With this it always uses the serial number "1" and produces the exact same output each time.

With this I have no more problems resuming the stream. Finally. :)
tschan
 
Posts: 16
Joined: Sat Jan 01, 2011 9:43 pm

Postby alphawave7 » Sat May 28, 2011 6:10 am

tschan wrote:I finally figured out what the problem was (after spending some time browsing the Subsonic source code to determine how resuming the stream is actually implemented).

It turns out that it's neither a problem with Subsonic itself nor with the android client.

The ogg encoder (oggenc) is the culprit. I noticed that given the exact same input it does not produce the same bit exact output. The actual audio data is the same but apparently it uses a different serial number each time which results in a different bitstream.

The (excruciating simple) solution for this problem is to just add the option "-s 1" to the command line of the encoder. With this it always uses the serial number "1" and produces the exact same output each time.

With this I have no more problems resuming the stream. Finally. :)


Wow. I salute your tenacity for that solution! :)
alphawave7
 
Posts: 1042
Joined: Thu Feb 11, 2010 9:54 am

Postby tschan » Sat May 28, 2011 8:52 am

Well, it took me long enough.

But I think the recommended transcoder settings in the Subsonic wiki should be adjusted to incorporate this. I would not want anyone else to lose another second trying to solve the same problem.
tschan
 
Posts: 16
Joined: Sat Jan 01, 2011 9:43 pm

Postby GJ51 » Sat May 28, 2011 2:35 pm

Forgive me, I get lost in all this transcoding stuff, what's your final transcoding settings?

You're transcoding flac to ogg for Android, but I've never gotten an ogg file to play in the Android player, what am I missing? In this regard anyway. :wink:

Thanks for any clarification you can post.

PS: I just found the perfect 24/7 SS platform!!

http://www.fit-pc.com/web/fit-pc2/fit-p ... fications/
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 tschan » Sun May 29, 2011 11:38 am

Well, my final transcoding settings are the following:

flac > ogg | flac | ogg | flac --decode --stdout %s | oggenc -b %b -s 1 -o - - | <blank>
tschan
 
Posts: 16
Joined: Sat Jan 01, 2011 9:43 pm

Postby GJ51 » Sun May 29, 2011 4:41 pm

OK. This has been a bit of a peripheral issue for me as most of my library are mp3 tracks. I do see a tremendous benefit, however in the ogg format as it can achieve remarkable quality at very low bit rates. So here's what is happening on my setup right now.

If I setup ogg> mp3 transcoding ogg files play fine on the desktop browser and on my Android phone.. If I turn the transcoding off, the ogg files just race through the desktop player without producing any sound but they will play in native ogg format on my Evo 4G.

Transcoding settings:

ffmpeg -i %s -v 0 -f wav -
lame -b %b --tt %t --ta %a --tl %l -S --resample 44.1 - -

So much for OGG behavior on my setup.

flac > ogg

ffmpeg -i %s -v 0 -f wav -
lame -b %b --tt %t --ta %a --tl %l -S --resample 44.1 - -

Plays fine on the desktop browser but generates an error on the Android phone.


I'll try your settings next, but feel free to chime in on anything I'm not getting.

Do I need to download oggenc and put it in the transcode directory?
EDIT: I see oggenc2.exe is in the transcode directory already, tried your settings flac > ogg | flac | ogg | flac --decode --stdout %s | oggenc -b %b -s 1 -o - - | <blank> using both oggenc and oggenc2 with no resulting transcoding taking place on either the desktop or the phone.


flac > mp3

ffmpeg -i %s -v 0 -f wav -
lame -b %b --tt %t --ta %a --tl %l -S --resample 44.1 - -

Plays fine on the desktop browser and on the Android phone.

I'm using the std Windows package on Server 08 R2 code base.


Thanks
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 » Sun May 29, 2011 7:51 pm

I'm not following your settings GJ51,

LAME is an mp3 encoder and will not produce OGG Vorbis output.

You HAVE to use oggenc (or oggenc2) in the place of lame in the above examples..

The flash player that subsonic uses to play in the browser will not play OGG Vorbis files so if it's playing what you think to be Vorbis files, then you're not getting Vorbis, you're in fact getting mp3 files.

ffmpeg and lame are not needed at all for FLAC to OGG transcodes.
For mp3 to ogg you can use the ffmpeg stage to decode the mp3

most versions of oggenc will natively read FLAC files, so for your flac > ogg transcoding you only need a single stage transcode:

oggenc -Q -q2 -o - %s


Note that I force a quality value of 2. Vorbis is not optimised for a forced bitrate and performs MUCH better if given a quality rating in the ballpark of what you're after.. q2 averages around 96Kbps, and is nearly transparent to me.

Also absent are the tagging data since oggenc will tag the output files with the data in the FLAC. For the mp3 transcode you would need to add the tag info on the command line:

oggenc -Q -q2 -a %a -t %t -l %l -
yourlord
 
Posts: 29
Joined: Fri Apr 29, 2011 1:05 am

Postby GJ51 » Sun May 29, 2011 9:11 pm

Thanks for the reply, I begining to see the error of my ways, but I am unable to get any transcoding with the settings you suggest. In my C:\subsonic\transcode directory is a file named oggenc2.exe which I'm assuming is the ogg encoder that I need to use. I've tried both

oggenc -Q -q2 -o - %s

and

oggenc2 -Q -q2 -o - %s

in the Step 1 settings, but my flac files won't transcode. Same result using the two step settings mentioned earlier.

Not sure what I'm doing wrong, but I am sure I am doing something wrong. :oops:

I assume that when I had it set up with the lame encoder that it was working but actually transcoding the files to mp3 and just labeling the output as 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

Postby yourlord » Mon May 30, 2011 12:27 am

That would be my assumption.

If the encoder you have is named oggenc2 then you would call it as oggenc2.

I'm not familiar with the windows version of the encoder so it's possible it can't natively read flac files..

Try using ffmpeg to decode it in the 1st stage and oggenc2 in the 2nd stage and see what that does. You would need to add the tag info on the command line as I noted in my earlier post.
yourlord
 
Posts: 29
Joined: Fri Apr 29, 2011 1:05 am

PreviousNext

Return to Help

Who is online

Users browsing this forum: No registered users and 19 guests