Decoding wma on linux server

Need help? Post your questions here.

Moderator: moderators

Decoding wma on linux server

Postby PT » Wed May 09, 2007 9:32 pm

I've got subsonic installed on a fresh install of fedora core 6 and it works fine for mp3's. Is there any way to play .wma files on this setup. Transcoding suggests wmadec but it looks like this is only available on Windows.

Anyone have any ideas?

Regards

PT
PT
 
Posts: 2
Joined: Wed May 09, 2007 9:30 pm

Postby Ikyo » Sun Dec 30, 2007 3:31 am

I think that I was able to finally get this working after about 10 hours today doing a ton of research and getting the mplayer to output to standard out. I am attaching a script that you must have in your transcode folder and place these into the steps:

Step 1: wma2mp3 %s
Step 2: lame -b %b - -

Here is the script and make sure to don't have it line wrap:

#!/bin/bash
mplayer -vo null -msglevel all=-1 -quiet -srate 44100 -channels 2 -vc dummy -ao pcm:nowaveheader:fast:file=/dev/stdout $1 2>/dev/null


I am hoping that will help you out in playing wma's in Linux.
Ikyo
 
Posts: 58
Joined: Wed Nov 30, 2005 12:07 am

Postby Ikyo » Fri Jan 18, 2008 6:51 am

I made one error on the shell script. Use this (without the word wrap):

#!/bin/bash
song=$1
mplayer -vo null -msglevel all=-1 -quiet -srate 44100 -channels 2 -vc dummy -ao pcm:nowaveheader:fast:file=/dev/stdout "$song" 2>/dev/null
Ikyo
 
Posts: 58
Joined: Wed Nov 30, 2005 12:07 am

Postby Ikyo » Fri Jan 18, 2008 4:13 pm

Anyone have a chance to give this a try? I am wondering if it is working okay for everyone.
Ikyo
 
Posts: 58
Joined: Wed Nov 30, 2005 12:07 am

Postby braddyo » Tue Feb 12, 2008 1:30 am

Your solution worked great except for one thing:

At the beginning of every song there is a click, like the sound you can imagine an arrow making if it were shot into a tree.

Do you know if it is possible to get ffmpeg to work? That would be able to transcode I believe without using lame and eliminating that step. In fact, I wonder why Sindre doesn't use ffmpeg for all the transcoding and have it built in.
User avatar
braddyo
 
Posts: 97
Joined: Mon Oct 29, 2007 10:27 pm
Location: UT

Postby Ikyo » Thu Feb 21, 2008 4:49 am

I will have to try it on my machines here. I am not sure why you are getting that. I am wondering if it has something to do with buffering. I also haven't tried ffmpeg. Does it understand WMA by default and able to output to the stdout?
Ikyo
 
Posts: 58
Joined: Wed Nov 30, 2005 12:07 am

Postby Ikyo » Thu Feb 21, 2008 6:58 am

After doing some testing, I am thinking it might have something to do with mplayer and how it outputs to the stdout. I am not 100% sure on this, but this is my initial guess. I tried lame by itself to convert a wave file and it was perfect.
Ikyo
 
Posts: 58
Joined: Wed Nov 30, 2005 12:07 am

Postby Ikyo » Thu Feb 21, 2008 7:53 am

Try this if you have ffmpeg:

Transcode line: wma2mp3 %s %b

wma2mp3:

#!/bin/bash
song=$1
bitrate=$2

ffmpeg -i "$song" -f mp3 -ab $bitrate - 2>/dev/null
Ikyo
 
Posts: 58
Joined: Wed Nov 30, 2005 12:07 am

Works with proper libavcodec

Postby jeremyh » Thu Feb 05, 2009 12:08 am

Ikyo, I tried your solution under Ubuntu 8.10 (Intrepid) and it gave me a failure message "unable to find suitable output codec for 'pipe'" (when running at command line). This was strange because I could do the conversion if I replaced stdout ("-") with a file. As soon as I replaced the file with "- >file" it would fail again.

I updated libavcodec51 to libavcodec-unstripped-51 and it resolved the problem.

Since ffmpeg uses libavcodec underneath, I am guessing there is an unofficial codec that is necessary to dump the ffmpeg output stream to stdout.
jeremyh
 
Posts: 49
Joined: Thu Feb 05, 2009 12:01 am
Location: Westminster, Colorado, United States

Postby dobson » Thu Apr 23, 2009 1:31 am

to pick this thread up again...
I'm running Subsonic standalone on OS X 10.5.6 and trying to transcode and stream wma lossless. I'm using Ikyo's suggestion with ffmpeg (v0.5) compiled with libmp3lame and a whole slew of other options. and using libavcodec.52.dylib and libavcodec.52.20.0.dylib

wma2mp3:

#!/bin/bash
song=$1
bitrate=$2

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


I'm still unable to transcode wma lossless files. but there is no notable error message in the subsonic log. when I try the ffmpeg command from the terminal, I get the error "Unsupported codec (id=86057) for input stream #0.0" leading me to believe ffmpeg is just not capable of decoding wma lossless... but I thought that it was as of 0.5. am I incorrect? is it simply lossy version of wma? (please excuse my lack of knowledge about the wma codec)

any suggestions on where to go with this? should ffmpeg (0.5) theoretically be able to transcode wma lossless? or am I barking up the wrong tree?
dobson
 
Posts: 46
Joined: Tue Apr 14, 2009 10:10 pm

Postby tfruitz » Sun Jul 19, 2009 6:19 pm

i'm using debian lenny with subsonic 3.7 and found this script to work:

#!/bin/bash
song=$1
bitrate=$2

ffmpeg -i "$song" -f wav -ab $bitrate - 2>/dev/null


the mp3 format is not recognized by lame. funny. Although the music plays, at around 2:43 the music suddenly stops. Does anybody know why?


A by-note: wma2mp3 needs to be executable by running: chmod +x wma2mp3
tfruitz
 
Posts: 6
Joined: Thu Nov 27, 2008 10:51 pm

Postby aTommyC » Sun Aug 09, 2009 10:38 pm

/usr/bin/wma2wav:

#!/bin/bash
song=$1

ffmpeg -i "$song" -f wav - 2>/dev/null


And within Transcoding setup:

wma > mp3 | wma | mp3 | wma2wav %s | lame -b %b - -

Did the trick for me.

Edit: I also renamed the wma2mp3 script to wma2wav, giving it a bit more intuitive and descriptive name. After all, that's what it really does. :)
aTommyC
 
Posts: 21
Joined: Sun Aug 09, 2009 10:30 pm

Postby Fman99 » Tue Aug 18, 2009 3:26 am

I've been pounding this into the ground and can't get my Linux box to properly transcode the wma files I have. I even re-OS'd my box from Fedora to Debian and all to no avail.

I have both mplayer and ffmpeg installed, and I can convert successfully from wma to mp3 using ffmpeg on the command line. I tested it using one of my wma files and I can play the outputted mp3.

But when I try and set up the subsonic player (using the web interface to set it up) to transcode my remaining wma's I get nothing. Also, my subsonic install cannot play the MP3 that I did transcode successfully, even though I can play the file locally on a player.

Any help is appreciated......
Fman99
 
Posts: 4
Joined: Tue Aug 18, 2009 3:23 am

Postby daniell » Fri Nov 13, 2009 6:56 am

I still don't get it.....:-)
I'm new here, and to subsonic, fanastic application, i love it.. But i'm still not able to play wav and wma files. Is there a how to do tutorial for dummies. ?
Have already install Lame and flac, they works greate.. Anything more i need to install to be able to play these files.?? I'm running ubuntu server. thnks
daniell
 
Posts: 90
Joined: Fri Nov 13, 2009 6:44 am
Location: Stavanger, Norway

Props

Postby Tanner Williamson » Wed Jan 27, 2010 6:26 pm

aTommyC wrote:/usr/bin/wma2wav:

#!/bin/bash
song=$1

ffmpeg -i "$song" -f wav - 2>/dev/null


And within Transcoding setup:

wma > mp3 | wma | mp3 | wma2wav %s | lame -b %b - -

Did the trick for me.

Edit: I also renamed the wma2mp3 script to wma2wav, giving it a bit more intuitive and descriptive name. After all, that's what it really does. :)


@aTommyC
Thank you, this worked for me on my CentOS 5.4 x86_64.

Notes and tips to future comers on this thread who may need help implementing this. These instructions provided here will apply to anyone using Fedora, RHEL/CentOS, or such-based distros.


  1. [have already, or now] install ffmpeg and libavcodec
  2. place the suggested script into the file at /var/subsonic/transcode/wma2wav
  3. chmod 0755 /var/subsonic/transcode/wma2wav


Alternately, you can place the wma2wav script in your /usr/local/bin/ or your /usr/bin/ directory. If doing so, just adjust the chmod command above to target the location you have placed the file in. As I wanted to keep my subsonic tweaks together as much as possible, so that I can easily clone my installation, I chose to put them in the /var/subsonic/transcode/ directory.
Tanner Williamson https://www.tannerwilliamson.com/

Image
Tanner Williamson
 
Posts: 51
Joined: Mon Dec 14, 2009 7:30 am

Next

Return to Help

Who is online

Users browsing this forum: No registered users and 26 guests