Tips for configuring TwonkyServer to work with a Samsung TV.

General discussion about the media server. Feature requests. Hints, tips and tricks.
Locked
wrarmstrong
Posts:6
Joined:Thu Feb 25, 2010 8:35 am
AV Hardware:Acer easyStore H340, PS3
Tips for configuring TwonkyServer to work with a Samsung TV.

Post by wrarmstrong » 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.
Last edited by wrarmstrong on Mon Dec 05, 2011 4:34 pm, edited 1 time in total.

Twonky_Rick
Posts:3816
Joined:Wed Nov 19, 2008 1:59 am
AV Hardware:Samsung 650 Series TV (2010), 4.5TB HP MediaSmart server with 100,000 songs, 5) AT&T U-Verse STB, CE form-factor Media Center PC and 6 other networked PCs running TwonkyManager, 2 Sonos ZP80, Sonos S5 speaker, Apple TV (running XBMC), Roku Soundbridge, X-Box 360, Sony PS3, Kodak 10" Wireless Photo Frame, iPhone with PlugPlayer software, Sonos CR-100.
Location:San Diego
Contact:

Re: Tips for configuring TwonkyServer to work with a Samsung

Post by Twonky_Rick » Mon Nov 14, 2011 7:29 pm

Let me know if you guys would like me to make this a 'sticky post' so it's always visible?

- Rick
Follow me on Twitter! mostlytech1
Checkout my blog: http://mostly-tech.com/

Maltise
Posts:4
Joined:Mon Nov 14, 2011 3:07 pm
AV Hardware:lynksys e4200, samsung un55d8000

Re: Tips for configuring TwonkyServer to work with a Samsung

Post by Maltise » Mon Nov 14, 2011 10:43 pm

I have the same issue playing .m4v videos, but I have a lynksys E4200 router and apparently the configuration page is locked down. Being that I can not access the configuration page is there another way to do this? Or is there a way for me to enable the configuration page so that I can fix my issue?

Thanks for the help in advance!!!

User avatar
parnott
Posts:326
Joined:Mon Sep 20, 2010 9:55 pm
AV Hardware:Twonky, WDTV Live, XBMC (Linux & Windows)

Re: Tips for configuring TwonkyServer to work with a Samsung

Post by parnott » Mon Nov 14, 2011 11:51 pm

If you are asking can you do transcoding of your M4V files on your Linksys E4200, then the answer is NO.

The E4200 does not have the performance or memory necessary for transcoding.

Twonky_Rick
Posts:3816
Joined:Wed Nov 19, 2008 1:59 am
AV Hardware:Samsung 650 Series TV (2010), 4.5TB HP MediaSmart server with 100,000 songs, 5) AT&T U-Verse STB, CE form-factor Media Center PC and 6 other networked PCs running TwonkyManager, 2 Sonos ZP80, Sonos S5 speaker, Apple TV (running XBMC), Roku Soundbridge, X-Box 360, Sony PS3, Kodak 10" Wireless Photo Frame, iPhone with PlugPlayer software, Sonos CR-100.
Location:San Diego
Contact:

Re: Tips for configuring TwonkyServer to work with a Samsung

Post by Twonky_Rick » Mon Nov 14, 2011 11:52 pm

Being that I can not access the configuration page is there another way to do this?
I don't know of a way around this -- other than replacing the server on your E4200 with the commercial version which we sell on Twonky.com. Unfortunately I do not have instructions how to do this. It might be possible that it can't even be done. Let's hope someone responds who knows more about this than I do.

Installing a new server would only allow you to access server settings, not make transcoding possible.

- Rick
Follow me on Twitter! mostlytech1
Checkout my blog: http://mostly-tech.com/

Maltise
Posts:4
Joined:Mon Nov 14, 2011 3:07 pm
AV Hardware:lynksys e4200, samsung un55d8000

Re: Tips for configuring TwonkyServer to work with a Samsung

Post by Maltise » Tue Nov 15, 2011 12:27 am

[quote="parnott"]If you are asking can you do transcoding of your M4V files on your Linksys E4200, then the answer is NO.

The E4200 does not have the performance or memory necessary for transcoding.[/quote]

I will not need transcoding at all. I will only need to get to the config screen to tell the server that it is connecting to a samsung tv and that will fix the problem that I am having. I have read several posts in various fourms that changing this setting works 100% and the only problem is that I do not have access to the configuration settings to do so.

I would love to hear the process for installing a new server if it is even possible.

User avatar
phibertron
Posts:1566
Joined:Sun Jan 30, 2011 5:52 pm
AV Hardware:Hardware
========
WHS - HP Ex495
PS3
XBOX 360
iTouch - Gen 2 and Gen 3
PSP - 3000

Encoders
========
Handbrake
x264
ffmpeg
mencoder

Tagging
======
mp3tag

Re: Tips for configuring TwonkyServer to work with a Samsung

Post by phibertron » Tue Nov 15, 2011 1:25 am

I think that the versions of twonky on the cisco routers have enableweb set to 0 or 1

# access to web config pages, 0 for denied, 1 for local only, 2 for open
enableweb=

I the past I have tried to use the rpc commands to do things
But if if enableweb is set to 0 or 1, RPC commands are also disabled

I havent attempted this yet, but If I had to...

1.
what I would do is to edit the firmware.bin
in a hex editor, and see if you could toggle the bits for what the enablweb= is set to
and make the needed changes to make it a 2

2.
you would than have to flash your device with that firmware

3.
Sounds easy right, which it is but it isnt

I know a lot of people buy that router for the media feature
I bought 2 e4200's for the wifi range and speed enhancements,
and they are working very very well for me in that regard
I couldnt actually ever dream of using my router as a media server
these things are built with sparingly cpu and ram specs
I think people would be better off with a nas or home server for media serving
the added benefits are control and performance and a real upgrade path
not at the mercy of a router company
viewtopic.php?f=2&t=10627
viewtopic.php?f=2&t=9353
viewtopic.php?f=2&t=9408
viewtopic.php?f=2&t=9416
viewtopic.php?f=2&t=9424
viewtopic.php?f=2&t=9364
viewtopic.php?f=2&t=9497

User avatar
phibertron
Posts:1566
Joined:Sun Jan 30, 2011 5:52 pm
AV Hardware:Hardware
========
WHS - HP Ex495
PS3
XBOX 360
iTouch - Gen 2 and Gen 3
PSP - 3000

Encoders
========
Handbrake
x264
ffmpeg
mencoder

Tagging
======
mp3tag

Re: Tips for configuring TwonkyServer to work with a Samsung

Post by phibertron » Tue Nov 15, 2011 1:52 am

@wrarmstrong

isnt it odd that the tv supports mp4/m4v
which for the most part if going to have aac or ac3 audio
what boggles the mind is to why they dont support m4a
which is in essence that same container as an mp4/m4v
only contains an audio track
which is for the most part is also going to usually be aac audio
viewtopic.php?f=2&t=10627
viewtopic.php?f=2&t=9353
viewtopic.php?f=2&t=9408
viewtopic.php?f=2&t=9416
viewtopic.php?f=2&t=9424
viewtopic.php?f=2&t=9364
viewtopic.php?f=2&t=9497

wrarmstrong
Posts:6
Joined:Thu Feb 25, 2010 8:35 am
AV Hardware:Acer easyStore H340, PS3

Re: Tips for configuring TwonkyServer to work with a Samsung

Post by wrarmstrong » Tue Nov 15, 2011 2:32 am

[quote="phibertron"]isnt it odd that the tv supports mp4/m4v
which for the most part if going to have aac or ac3 audio[/quote]

Yes! I had the exact same thought. There must be some corporate politics of some kind going on because I can't think of any technical reason why they wouldn't have chosen to support .m4a files.

User avatar
phibertron
Posts:1566
Joined:Sun Jan 30, 2011 5:52 pm
AV Hardware:Hardware
========
WHS - HP Ex495
PS3
XBOX 360
iTouch - Gen 2 and Gen 3
PSP - 3000

Encoders
========
Handbrake
x264
ffmpeg
mencoder

Tagging
======
mp3tag

Re: Tips for configuring TwonkyServer to work with a Samsung

Post by phibertron » Tue Nov 15, 2011 3:11 am

You know, I'm wondering if you renamed the ext from m4a to mp4
I bet the tv would play that audio file, but then again...
If it did work, it would a lot of file management
viewtopic.php?f=2&t=10627
viewtopic.php?f=2&t=9353
viewtopic.php?f=2&t=9408
viewtopic.php?f=2&t=9416
viewtopic.php?f=2&t=9424
viewtopic.php?f=2&t=9364
viewtopic.php?f=2&t=9497

Maltise
Posts:4
Joined:Mon Nov 14, 2011 3:07 pm
AV Hardware:lynksys e4200, samsung un55d8000

Re: Tips for configuring TwonkyServer to work with a Samsung

Post by Maltise » Tue Nov 15, 2011 3:57 am

All of this media server stuff is quite new to me, and it all started on a trip to best buy when a sales person wanted to demonstrate the apple tv to me. I thought that it was neat, and was going to buy one, but first I wanted to try and see if I could get the streaming stuff up and running with my current equipment. My wife is actually the movie buff, and I thought it would be neat for her to access any movie that she wanted without going to get the disc for it. I could care less about watching movies I have already seen before, but I liked the idea of having a backup copy of all the movies she had purchased over the years. So I did some research and found out a lot of ppl were using handbrake to rip the movies for atv2 which I would purchase in the future. After ripping about 50 DVDs I wanted to see if I could get this streaming stuff up and running. It did not take long before I figured out that the all share server was crap, and I could not get it to play the movies on my tv. So, I setup a windows media player server an it worked flawlessly without a hitch, and then my router died on me it had been acting up the past couple of months anyways. I bought the E4200 as a replacement, and was not aware of its media server capabilities until I set it up, and I had an extra external hdd just laying about. I liked the idea that I could leave my pc off and still stream movies to my tv because my pc is a heat monster and there is at least a 15-20 degree difference b/w my computer room and the rest of the house. I will purchase a NAS if this is something that my wife will continue to use.

User avatar
phibertron
Posts:1566
Joined:Sun Jan 30, 2011 5:52 pm
AV Hardware:Hardware
========
WHS - HP Ex495
PS3
XBOX 360
iTouch - Gen 2 and Gen 3
PSP - 3000

Encoders
========
Handbrake
x264
ffmpeg
mencoder

Tagging
======
mp3tag

Re: Tips for configuring TwonkyServer to work with a Samsung

Post by phibertron » Tue Nov 15, 2011 8:27 pm

@Maltise

Isnt that how it all starts, a simple idea/want/need, that ends end needing more thought than should be needed
viewtopic.php?f=2&t=10627
viewtopic.php?f=2&t=9353
viewtopic.php?f=2&t=9408
viewtopic.php?f=2&t=9416
viewtopic.php?f=2&t=9424
viewtopic.php?f=2&t=9364
viewtopic.php?f=2&t=9497

ptbhackett
Posts:5
Joined:Mon Jan 16, 2012 11:22 pm
AV Hardware:Twonky Server
Samsung UE32C6310UK
Roku Soundbridge
Netgear MP101

Re: Tips for configuring TwonkyServer to work with a Samsung

Post by ptbhackett » Wed Jan 18, 2012 12:15 am

@wrarmstrong

I would be interested in receiving your source code to run VLC as a child process to see if this resolves the problem I am having playing wma files on my Samsung TV. My .desc file is identical to yours which allows me to play m4a files in addition to mp3. However, the TV will still not play wma. I've checked the cache on the server and it's as if Twonky is trying to transcode to mp3. An mp3 folder is created but no .mp3 files in it, unlike for m4a. I've also played around with the settings for the Samsung TV in the client.db file without success, current settings as below:

NA:Samsung TV
DD:Samsung DTV
XM:DLNA15
XM:FORCE_DURATION
XM:FORCE_4TH_FIELD
XM:AARES
DX:SAMSUNGFEATLIST
DB:FIX
MT:mkv video/x-mkv
MT:mpeg,mpeg2,vdr,spts,tp,ts video/mpeg
MT:wma audio/x-ms-wma
MT:m4a audio/mp4
HP:chunked
TR:JPEGORG,JPEG160x160,JPEG640x480,JPEG1024x768,JPEG1920x1080,wma,m4a

The m4a appears to transcode even if it is not included at the end of the TR: string.

Any help resolving this would be appreciated as most of the music on my server is wma and after a year of being unable to play music on the TV in the kitchen I've finally decided to try and fix the problem.

wrarmstrong
Posts:6
Joined:Thu Feb 25, 2010 8:35 am
AV Hardware:Acer easyStore H340, PS3

Re: Tips for configuring TwonkyServer to work with a Samsung

Post by wrarmstrong » Thu Jan 19, 2012 1:23 pm

I'll try to send you the code later on tonight. Right now I don't see an obvious way to add the code as a attachment or to email the files to you directly.

Did you try manually running the VLC command to see if VLC is able to transcode the files?

Is it possible that the WMA files are DRM enabled? That would certainly prevent VLC from being able to transcode the files.

ptbhackett
Posts:5
Joined:Mon Jan 16, 2012 11:22 pm
AV Hardware:Twonky Server
Samsung UE32C6310UK
Roku Soundbridge
Netgear MP101

Re: Tips for configuring TwonkyServer to work with a Samsung

Post by ptbhackett » Thu Jan 19, 2012 10:03 pm

Before I tried VLC as per your post, I had tried with ffmpeg and the same problem. TV able to play the transcoded m4a files but said unsupported file format for the wma files. I've created wma to mp3 transcoded files from the command prompt using both ffmpeg and VLC and these play fine on the TV. The wma files are not DRM protected so I don't believe that is the problem. If you have any suggestions on what to try I will give them a go.

Many thanks,

Paul.

wrarmstrong
Posts:6
Joined:Thu Feb 25, 2010 8:35 am
AV Hardware:Acer easyStore H340, PS3

Re: Tips for configuring TwonkyServer to work with a Samsung

Post by wrarmstrong » Fri Jan 20, 2012 5:38 am

Hi Paul,

I was able to reproduce your problem. Here is what I did:

1. I ripped a few songs as WMA files in various formats; wma, wma-pro, wma-variable, wma-lossless. After copying them to my server I searched the cache folder and found all of the wma files had been transcoded to mp3 files. I copied the mp3 files back to my desktop and was able to successfully play each one locally. So far so good.
2. Using my ASUS O-Play media player, I tried playing the WMA songs, first directly from the network share, and then through uPNP. In both cases it was able to play all of the songs except the lossless WMA file. Apparently ASUS does not support lossless. This confirms that Twonky is serving up the original WMA file to the ASUS device, not the transcoded file. The ASUS player uses the Generic Media Receiver settings which are configured to not do any transcoding, so this makes sense.
3. Next I tried playing the songs on my Samsung TV. None of them would play.
4. I then checked the settings in the clients.db file. I noticed that the Samsung profile did not list WMA as a format that needs transcoding so I added the "MT:wma audio/x-ms-wma" setting as you did and then restarted the Twonky service. After doing this the TV still won't play the files. I even went so far as to restart the TV to ensure that it hadn't cached anything.

The documentation in the clients.db file seems to suggest that the TR: setting is a list of formats that the device does support, so I'm pretty sure that you don't want to add wma to that setting. As far as I can tell, with the profile set up the way that it is now, the TV should be receiving the transcoded mp3 files, but that obviously is not happening. I can only assume that this is a bug in the Twonky server.

Maybe somebody with more in depth knowledge of Twonky Server can spot something that we are doing wrong.

You may need to contact Twonky to get this resolved.

Good luck.

Bill

wrarmstrong
Posts:6
Joined:Thu Feb 25, 2010 8:35 am
AV Hardware:Acer easyStore H340, PS3

Re: Tips for configuring TwonkyServer to work with a Samsung

Post by wrarmstrong » Fri Jan 20, 2012 5:48 am

One other note about transcoding.

It appears as though Twonky transcodes a file as soon as you add it to the library, even if no media players are currently connected. This way the transcoded file is in the cache ready to go when it is needed.

This is why you are seeing the m4a files being transcoded regardless of the setting that you specify in the Samsung TV profile.

Another interesting tidbit is that it transcodes ALL audio formats, even MP3. That's right, if you add an mp3 file to your library, twonky will transode it....to MP3! I've got a number of mp3 audio files in my library and when I search for them in the cache, I find a matching file (e.g. song.mp3.mp3).

Bill

ptbhackett
Posts:5
Joined:Mon Jan 16, 2012 11:22 pm
AV Hardware:Twonky Server
Samsung UE32C6310UK
Roku Soundbridge
Netgear MP101

Re: Tips for configuring TwonkyServer to work with a Samsung

Post by ptbhackett » Fri Jan 20, 2012 8:58 pm

Thanks for looking into this and concluding the same. I will contact Twonky as you suggest to get them to look into the problem in case it is a bug in the server software. If and when I do get the problem resolved I will post the answer here.

Paul.

ptbhackett
Posts:5
Joined:Mon Jan 16, 2012 11:22 pm
AV Hardware:Twonky Server
Samsung UE32C6310UK
Roku Soundbridge
Netgear MP101

Re: Tips for configuring TwonkyServer to work with a Samsung

Post by ptbhackett » Fri Apr 06, 2012 9:02 pm

This unfortunately is still not resolved, and disappointingly Twonky 7 has removed the ability to transcode full stop, unless I'm missing something. If anyone has any clues as to how I could get the earlier version of Twonky working with transcoding to my Samsung TV it would be greatly appreciated. Twonky do not appear to be interested in helping to resolve sadly.

Paul.

User avatar
phibertron
Posts:1566
Joined:Sun Jan 30, 2011 5:52 pm
AV Hardware:Hardware
========
WHS - HP Ex495
PS3
XBOX 360
iTouch - Gen 2 and Gen 3
PSP - 3000

Encoders
========
Handbrake
x264
ffmpeg
mencoder

Tagging
======
mp3tag

Re: Tips for configuring TwonkyServer to work with a Samsung

Post by phibertron » Sat Apr 07, 2012 12:00 am

I havent played with music transcode yet
but I was able to get video to transcode to mpeg format

fwiw
http://www.twonkyforum.com/viewtopic.php?f=2&t=10682

does your set support mpeg streaming?
viewtopic.php?f=2&t=10627
viewtopic.php?f=2&t=9353
viewtopic.php?f=2&t=9408
viewtopic.php?f=2&t=9416
viewtopic.php?f=2&t=9424
viewtopic.php?f=2&t=9364
viewtopic.php?f=2&t=9497

Locked