Tips for configuring TwonkyServer to work with a Samsung TV.
Posted: Mon Nov 14, 2011 5:44 am
I recently bought several Samsung products. Two TV's and one Blu-Ray player. All of them have the capability to stream media off of a uPNP server. Unfortunately most of my media would not play on my Samsung TV out of the box. I had to spend one and a half solid days of research plus trial and error before I finally got everything working. I thought that I should post my experiences in the hope that I might save someone else the frustration that I went through.
Just for reference I should mention that I've been using Twonky Media Server for a couple of years with my PS3 with no issues whatsoever. It wasn't until I purchased the Samsung that I ran into issues.
The first hurdle that I had was that most of my kids' videos are encoded as .m4v files. These files were created using Handbrake. Luckily I found the solution to this problem fairly quickly. For some reason Twonky needs to know that the client that it is talking to is a Samsung TV, otherwise the video does not get streamed properly. This is very easy to configure. All you need to do is follow this procedure:
1. Using a browser, enter the URL http://twonkyserver:9000/config (obviously you need to replace twonkyserver with the name of your server.
2. Under Advanced Setup, click on the Media Receivers link.
3. You will see a list of clients that have connected to Twonky. Find the address that matches your Samsung TV (you can find the IP address given to the TV in the Network settings of the television).
4. The third column in the list is a drop down list box. Search the list and select "Samsung TV". This setting worked for both by TV's and my Samsung Blu-Ray player.
5. Make sure you click on the "Save Changes" button.
Once you complete the procedure above, the TV should be able to play all supported formats off of the media server.
The second hurdle that I ran into took much longer to solve. Most of my music library is downloaded from iTunes (i.e. .m4a files). Unfortunately the Samsung television does not support .m4a music files. The obvious answer was to have Twonky transcode the music files into a format that the TV does support, but as it turns out this was no way near as straightforward as I would have liked. By default, the option to enable transcoding of music files to MP3 on the Transcoding page in the Twonky configuration site is disabled. My media server is a Windows Home Server, and although I did find one article that described how to set up transcoding in Linux, I didn't find anything for setting it up in Windows.
This is how you do it.
The first thing that you need to do is install a tool that is able to do the transcoding. Twonky Media Server has no native transcoding capabilities. The one that I chose to use is VLC. You can download an installer from http://www.videolan.org/. When installing VLC Media Player, just select the Minimum install option unless you plan on doing more with it than just transcoding files.
Twonky has a configuration file that points to the VLC install folder. Unless you installed VLC to a non-default location, you will not need to edit the file. The file that I'm referring to is "C:\Program Files\TwonkyMedia\cgi-bin\vlc.location".
Once you've installed VLC, you need to tell Twonky how to use it to transcode MP3 files. You do this by creating a text file in the "C:\Program Files\TwonkyMedia\cgi-bin" folder called "vlc-mp3.desc". The actual filename is not important, although the file extension is. The file must contain these lines (copy and paste them into the file):
# transcode audio (mp4, wav, wma to mp3)
#(c) 2008 by PacketVideo
exec: vlc -I dummy $infile :no-video :sout=#transcode{acodec=mp3,ab=256}:std{access=file,mux=dummy,dst='$outfile'} vlc://quit
# capabilities
from=audio/all
to=audio/mpeg
asynchronous
priority=idle
The parameter "ab" refers to the audio bitrate. I used 256 kbps, but you can change this if you like.
NOTE the contents of the file were copied from a pre-existing file called "any-mp3.desc". I just changed the "exec:" line.
After creating this file you need to restart Twonky. After restarting Twonky you will see that the MP3 option is now enabled under "Transcode music to:" on the Transcoding page. Select the MP3 option and click the Save Changes button. You will need to restart Twonky once more.
That's it. The next time you try to play music on your Samsung TV from your Twonky server, it will play no problem, regardless of the format of the audio file. Since MP3 is a pretty much universal format, you should have no problems playing your music library on any media receiver.
I should point out one caveat. I only tested VLC transcoding with the formats that I have in my library (which consist of .m4a, .mp3). I did not test other formats. That being said, as far as I know, VLC supports pretty much any format you can throw at it so you shouldn't have any issues.
I hope this helps someone out there. Good Luck.
**UPDATE** - I've discovered that filenames with some special characters can cause problems when VLC parses the command line. Specifically for the output filename. I've added single quotes around $outfile in the text file above which will handle most of the special characters, unfortunately filenames with with single quotes will still cause problems. There are two ways to deal with this. One is to rename the files so that they don't contain single quotes. The second (which is the solution that I've implemented) is to write your own program that will build a properly escaped VLC command line and then launch the VLC program as a child process. I would be happy to share my source code for this program if anybody is interested.
Just for reference I should mention that I've been using Twonky Media Server for a couple of years with my PS3 with no issues whatsoever. It wasn't until I purchased the Samsung that I ran into issues.
The first hurdle that I had was that most of my kids' videos are encoded as .m4v files. These files were created using Handbrake. Luckily I found the solution to this problem fairly quickly. For some reason Twonky needs to know that the client that it is talking to is a Samsung TV, otherwise the video does not get streamed properly. This is very easy to configure. All you need to do is follow this procedure:
1. Using a browser, enter the URL http://twonkyserver:9000/config (obviously you need to replace twonkyserver with the name of your server.
2. Under Advanced Setup, click on the Media Receivers link.
3. You will see a list of clients that have connected to Twonky. Find the address that matches your Samsung TV (you can find the IP address given to the TV in the Network settings of the television).
4. The third column in the list is a drop down list box. Search the list and select "Samsung TV". This setting worked for both by TV's and my Samsung Blu-Ray player.
5. Make sure you click on the "Save Changes" button.
Once you complete the procedure above, the TV should be able to play all supported formats off of the media server.
The second hurdle that I ran into took much longer to solve. Most of my music library is downloaded from iTunes (i.e. .m4a files). Unfortunately the Samsung television does not support .m4a music files. The obvious answer was to have Twonky transcode the music files into a format that the TV does support, but as it turns out this was no way near as straightforward as I would have liked. By default, the option to enable transcoding of music files to MP3 on the Transcoding page in the Twonky configuration site is disabled. My media server is a Windows Home Server, and although I did find one article that described how to set up transcoding in Linux, I didn't find anything for setting it up in Windows.
This is how you do it.
The first thing that you need to do is install a tool that is able to do the transcoding. Twonky Media Server has no native transcoding capabilities. The one that I chose to use is VLC. You can download an installer from http://www.videolan.org/. When installing VLC Media Player, just select the Minimum install option unless you plan on doing more with it than just transcoding files.
Twonky has a configuration file that points to the VLC install folder. Unless you installed VLC to a non-default location, you will not need to edit the file. The file that I'm referring to is "C:\Program Files\TwonkyMedia\cgi-bin\vlc.location".
Once you've installed VLC, you need to tell Twonky how to use it to transcode MP3 files. You do this by creating a text file in the "C:\Program Files\TwonkyMedia\cgi-bin" folder called "vlc-mp3.desc". The actual filename is not important, although the file extension is. The file must contain these lines (copy and paste them into the file):
# transcode audio (mp4, wav, wma to mp3)
#(c) 2008 by PacketVideo
exec: vlc -I dummy $infile :no-video :sout=#transcode{acodec=mp3,ab=256}:std{access=file,mux=dummy,dst='$outfile'} vlc://quit
# capabilities
from=audio/all
to=audio/mpeg
asynchronous
priority=idle
The parameter "ab" refers to the audio bitrate. I used 256 kbps, but you can change this if you like.
NOTE the contents of the file were copied from a pre-existing file called "any-mp3.desc". I just changed the "exec:" line.
After creating this file you need to restart Twonky. After restarting Twonky you will see that the MP3 option is now enabled under "Transcode music to:" on the Transcoding page. Select the MP3 option and click the Save Changes button. You will need to restart Twonky once more.
That's it. The next time you try to play music on your Samsung TV from your Twonky server, it will play no problem, regardless of the format of the audio file. Since MP3 is a pretty much universal format, you should have no problems playing your music library on any media receiver.
I should point out one caveat. I only tested VLC transcoding with the formats that I have in my library (which consist of .m4a, .mp3). I did not test other formats. That being said, as far as I know, VLC supports pretty much any format you can throw at it so you shouldn't have any issues.
I hope this helps someone out there. Good Luck.
**UPDATE** - I've discovered that filenames with some special characters can cause problems when VLC parses the command line. Specifically for the output filename. I've added single quotes around $outfile in the text file above which will handle most of the special characters, unfortunately filenames with with single quotes will still cause problems. There are two ways to deal with this. One is to rename the files so that they don't contain single quotes. The second (which is the solution that I've implemented) is to write your own program that will build a properly escaped VLC command line and then launch the VLC program as a child process. I would be happy to share my source code for this program if anybody is interested.