Another M4A problem

Need help? Post your questions here.

Moderator: moderators

Another M4A problem

Postby hornetjockey » Thu Sep 02, 2010 8:03 pm

I'm running subsonic 4.0.1 (build 1524) on Ubuntu Server 10.04 and I can't transcode m4a files. Thanks to these forums, I've already tried a couple things, but no joy.

I have tried the following script:

m4a2mp3 %s %b

Code: Select all
#!/bin/bash
song=$1
bitrate=$2

/var/subsonic/transcode/ffmpeg -i "$song" -f mp3 -ab $bitrate - 2>/dev/null


And I've also tried transcoding directly with ffmpeg using:

ffmpeg -i %s -f mp3


Not only does transcoding fail, "m4a > mp3" is not even an option in the player settings, but I do have it selected as default in the transcode settings. Any ideas?



Edit: It appears to still be invoking LAME even though I am specifying FFMPEG:


[2010-09-02 15:50:11,334] INFO PlaylistInputStream - admin listening to "The Odd Couple/01 Charity Case.m4a"
[2010-09-02 15:50:11,356] DEBUG TranscodeInputStream - Starting transcoder: [/var/subsonic/transcode/lame] [-S] [-h] [-b] [64] [/var/music/Gnarls Barkley/The
Odd Couple/01 Charity Case.m4a] [-]
hornetjockey
 
Posts: 9
Joined: Thu Sep 02, 2010 7:55 pm

Postby delcypher » Thu Sep 02, 2010 8:40 pm

You need to specify the -acodec option if you want to change the audio codec. Although -f often does this automatically for you. Note that you need to use k (see my example below) with the -ab argument as ffmpeg uses bit/s and %b is in Kbit/s.
https://sourceforge.net/apps/mediawiki/ ... ranscoders
You don't need a script to do this you just want to setup the m4a > mp3 transcoder in Settings > Transcode (web admin interface)

Step 1: ffmpeg -i %s -f mp3 -acodec libmp3lame -ab %bk -
Step2: blank
Step3: blank

Make sure you have a symbolic link setup in /var/subsonic/transcode to ffmpeg. You can do this by running the following

Code: Select all
ln -s $(which ffmpeg) /var/subsonic/transcode/fmpeg


Also make sure you have the liblame (may be called something else), lame & ffmpeg packages installed.

If you read the Subsonic log, you will be able to see where your transcode is going wrong. (run tail -f /var/subsonic/subsonic.log , this will let you see changes made the log as you try transcodes)

I've written quite a large article on this on the wiki please see

http://sourceforge.net/apps/mediawiki/subsonic/index.php?title=Transcoders

Hope this helps.
Last edited by delcypher on Thu Sep 02, 2010 8:50 pm, edited 1 time in total.
delcypher
 
Posts: 109
Joined: Tue Jun 01, 2010 10:39 am

Postby delcypher » Thu Sep 02, 2010 8:49 pm

Sorry just remember if your m4a (AAC) files have any DRM on them ffmpeg will NOT be able to transcode them.

Simulating the command that subsonic will run on the command line is usually your best bet for finding the problem.

Also specifying the transcoders in Settings > Transcoders is not enough. You also need to change the individual player settings (Settings > Players) to use the right transcoders. Also when using the web interface make sure you select the correct player (drop down menu near the web player).
delcypher
 
Posts: 109
Joined: Tue Jun 01, 2010 10:39 am

Postby hornetjockey » Thu Sep 02, 2010 9:01 pm

I tried this, but it still isn't working. The log doesn't really show an error, but the file never plays:


[2010-09-02 16:55:11,711] INFO PlaylistInputStream - admin listening to "The Odd Couple/13 A Little Better.m4a"
[2010-09-02 16:55:11,722] DEBUG TranscodeInputStream - Starting transcoder: [/var/subsonic/transcode/lame] [-S] [-h] [-b] [64] [/var/music/Gnarls Barkley/The Odd Couple/13 A Little Better.m4a] [-]


And it still concerns me that I have no option to enable "m4a > mp3"
hornetjockey
 
Posts: 9
Joined: Thu Sep 02, 2010 7:55 pm

Postby delcypher » Thu Sep 02, 2010 10:49 pm

In settings > Transcoder have you ticked the "Enabled" check box next to your "m4a > mp3" transcoders? The tick box isn't obvious especially if you have a small screen resolution because it's way off to the right.

You should be able to see it to the right of the "Step 3" column. There's a default (defaultly enabled for newly created players), enabled (the option you should check) and a delete checkbox.

Once you've ticked the box you should press the save button at the bottom of the page.

The "m4a > mp3" should then appear as an option in Settings > Players.

It is odd though how lame is being invoked though. In the "Convert from" column in Settings > Transcoder you don't have "m4a" in any other transcoder chains do you?
delcypher
 
Posts: 109
Joined: Tue Jun 01, 2010 10:39 am

Postby hornetjockey » Fri Sep 03, 2010 12:51 pm

I got it working this morning. Two things:


It was not "enabled". I had no idea those checkboxes were even there. Thanks for that.

Also, calling libmp3lame did not work. The logs show an unknown codec. I saw that I had libmp3lame0 installed, so I tried changing it to that. That didn't work. I changed it back to default, now I can play M4A!

Thanks for at least getting me to the right place.
hornetjockey
 
Posts: 9
Joined: Thu Sep 02, 2010 7:55 pm

Postby delcypher » Fri Sep 03, 2010 12:54 pm

To see what codecs your version of ffmpeg supports

run (pipe through less as the output is long, press q to quit, h for help)

Code: Select all
ffmpeg -codecs | less


or if that doesn't work (really old versions of ffmpeg don't support that option)

Code: Select all
ffmpeg -formats | less


Ubuntu uses a pretty old version of ffmpeg. There is a PPA that has newer builds of ffmpeg.

Glad I could help.
delcypher
 
Posts: 109
Joined: Tue Jun 01, 2010 10:39 am


Return to Help

Who is online

Users browsing this forum: No registered users and 22 guests