Plex @ aTV - think different...

Hi… waiting for the Plex experience on aTV 3, I thought about the following:



How about using aTV with the stock iOS - no jailbreak nor Plex client needed. Push the adaption processes to your Router and PMS!

The idea is like that:

  • use your router to re-route (for example) all aTV “youtube.com” http- requests to PMS. Possible?
  • add capability to PMS to ‘fake’ the youtube-server and respond to the requests - my guess is, that it has to provide…

    a ) some directory structure: featured videos, most seen, …

    b ) the video lists, aka links to the single files

    c ) the video data itself

    …so just about nothing more, that it is doing anyways, likely just a formatting change.



    PMS has the possibility to add “plug ins” on the receiving side, maybe a “plug in” interface for the sending/communication to the clients would be possible? This would reduce the adaption stress to the main server, adding even more flexibility on how to use Plex. The interface might already be in there… hidden, but functionally supporting the DLNA-communication?



    Loosing native youtube/vimeo/whatever would not be too bad, as it could be run through PMS anyways.



    Any thoughts?

3 weeks and about 300 views later. But not one comment? Is this idea that strange? :smiley:



Anyway… I did some digging and my router (FritzBox) has the option to define a different DNS Server - a preferred and a second, alternative one (see attachment).



What does it take to have an own DNS server running on a Mac? Grab one common address (eg youtube, vimeo ) and reroute it to a special Media Server. Forward all the other unknowns to the real DNS for lookup?

How does the original API (again… youtube, vimeo) work? How in comparison to the Plex HTTP protocol. I guess I have to dig a little into those Plex Plugins…

Someone in China did do something along the same lines:

http://toswang.blogs…hinese-tvs.html

Great… I am not alone :slight_smile:

Also great: According to that article (btw. what I understood from it) I don’t have to mess with my Router at all. Re-configuring aTV to that private DNS server would be enough already.

And “http://trailers.apple.com/appletv/index.xml” doesn’t look too different from Plex XML as well. After all, it is XML…

So… set up a “private DNS server” and link aTV’s Trailer (new option :slight_smile: or other streaming apps to PMS. Doesn’t sound impossible at all. And would allow the Plex experience on aTV Gen3.

Hmmm.

Something else that might interest you in looking at this sort of thing…

I installed the Couchsurfer browser on my ATV2 and found, in admittedly limited testing, that i was able to navigate and play back videos from the server.

As the included applications on the Apple TV are in effect broswers it would be interesting to know how trivial or not it would be to proxy one of the applications to show Plex web on a non-jailbroken ATV.

It would make sense if there was a web server on the Plex media server that could be used for this purpose.

This is an intriguing prospect.  Although airplay works just fine on my atv3, I do miss the Plex plugin on my old jailbroken atv2 (being able to navigate around with the remote, blah blah...).

I think it would be possible to setup a DNS server on a Plex machine, as OSX comes installed with BIND (though I've never tried it), and from there you could hijack URLs and point them to a folder on localhost (which is easy).  One downside might be that you'd need advanced router configuration if you wanted to access the sites on other machines on your network, but personally, I'd be happy to never have to see MLB or WSJ anywhere on my network ever again (ha).

As for the XML, there'd need to be some heavy lifting done by the Plex/Web server to rewrite the Plex XML to match the Apple trailers schema (as I imagine there's little flexibility on Apple's end), but the biggest question I have is would the ATV3 play nice with the file formats, or would the transcoder handle it?

Well..  looks like I have some hacking to do today. 

Well..  looks like I have some hacking to do today. 

Keep me posted, I am all ears :-)

I started looking into Plex's XML code - came up with a small executable (terminal based, C) to do the decoding. With this I was able to catch the own media (locally stored) without transcoding and throw it into VLC for replay.

It however failed desperately with a] transcoding stuff and b]channels streaming from the internet.

The trouble with a] seems to be, that we only get 10sec at a time... where VLC fails to talk to PMS.

With b] I totally crashed the plugin (ABC in this case...).

Unfortunately I have little to no clue, how to code on the Mac...

Nice!  I dug in a little bit already as well.

Good news is Plex's transcoder sends out m3u8 playlists (which is iOS compatible.. so playing on ATV3 really shouldn't be an issue) through a Node.js web server (which I think can be used as a DNS server, I've only recently started digging into Node.js, so maybe someone smarter than me can confirm that).  Also, after taking a look at what the developer out of China did, it looks like router configuration isn't even necessary as you can change the DNS settings directly on the ATV (followed the steps in that link and it definitely worked..).  Literally, all he has done is stuck his own URLs/values in Apple's XML schema.

I'm mainly a web developer, so I pretty much ignored all the plex python stuff, but everything is sent from the Node server via XML files, so my plan was to write a php script to parse Plex's XML, and spit out the Apple XML format...  just need to read through the developers API and try and get a handle on the schema.  I did find some useful info here though http://wiki.plexapp.com/index.php/PlexNine_AdvancedInfo.

In any case, I'll definitely keep you posted.

Hello!

I was not too concerned about the DNS-reroute - I thought of it as "solve it last". Having a aTV2 (w/ jailbreak) it should be easy to just edit the hosts file anyways. I guess, we have to go through the DNS trouble only for a stock aTV...

I was not too concerned about the DNS-reroute - I thought of it as "solve it last". Having a aTV2 (w/ jailbreak) it should be easy to just edit the hosts file anyways. I guess, we have to go through the DNS trouble only for a stock aTV...

Hey, fair enough   :)  

I suppose I was a little concerned because all I have now is an ATV3, and I'm not holding my breath on either Apple opening ATV up to developers, or that someone will find an exploit for a jailbreak.

Seems to me, and I could be completely barking up the wrong tree, that Plex might be already setup to do this already, its just a matter of getting the ATV to play nice.  I can access Plex/Web (http://[localPlexIP]/web/) on my iphone using safari, and it plays videos fine (I'm guessing html5 video tag).  Like you first suggested, it should really be just a matter of rewriting XML.  Haven't had much luck in the last few hours about finding any documentation on the Plex XML schema (seems I can't google well today).

Gonna go dig through the developer forum and maybe I'll get lucky.

... Haven't had much luck in the last few hours about finding any documentation on the Plex XML schema (seems I can't google well today).

Gonna go dig through the developer forum and maybe I'll get lucky.

Same here... there seems to be not a lot documentation out there, AFAIK nothing in the WIKI. Some time ago, there were a couple of threats about it.

But then... you can always guide Safari to "127.0.0.1:32004" (or use your PMS IP if PMS runs somewhere else). This should bring you to the PMS main index page.

EDIT: Ups, the correct port is 32400. Complete address should therefore read "127.0.0.1:32400". Sorry for that!

It might be worth seeing whether you can gets some answers in the Plex chat room if you are struggling with the available documentation.

So exactly how do you setup a DNS server so that the http://trailers.apple.com/appletv/index.xml request gets directed to a local xml file on your server but all other http requests from the ATV get passed through to the correct addresses, so that the iTunes store and things like Youtube still work?

I'm very interested in playing around with this but have no idea how to initially set it up to capture and redirect the trailer app requests.

Honestly, I have no real solution so far. Just a couple of ideas and come rough thoughts on how "the internet works".

My understanding of the DNS servers - you can set one up for yourself, guiding your local requests to your local machines. Once your DNS server receives a computer name, that is not available in your subnet, it will forward that to the next DNS server outside, eg. at your internet service provider. If this one is able to solve your request, everything is fine. If not - it checks with the next higher one...

So the only computer name your local DNS server would have to match is the service call from aTV - "trailers.apple..." or any other .com. Requests for the selected one have to be answered with your PMS server IP Address. Everything else should be forwarded to the next DNS server, just as before.

The stretch here is to a.) set up and maintain the DNS server and b.) to answer the following media requests accordingly.

Not sure yet, how all of this could work...

SpaceDog have you had any luck?

Is it worth speaking with some of the Plex guys in the chat room?

I'm gonna have a play around at the weekend and see if I can get the ATV talking to a DNS server as this seems to be the hardest part and without this the  whole idea is pretty much dead.

Check the 3rd post by me and you will see that it is possible.

Yep, I know it’s possible, I’ve played around with that chinese DNS server listed in the blog post and it works perfectly, but unless somebody here knows how to replicate it then we’re pretty much stuffed :slight_smile:

Hello there!

Just one note - I found an interesting project "CocoaHTTPServer" (https://github.com/robbiehanson/CocoaHTTPServer) providing basic handler functions for an HTTP Server (hence the name  :D). It seems to be worth looking deeper - it could make up that part of the converter to receive aTV's requests!

So I had a playaround this morning to see if I could setup a DNS to trap requests to the Apple trailer site from the ATV.

I installed  a small DNS server on my Windows box and set it to monitor and forward requests from the ATV to my ISP's DNS. I then entered and exited the Trailer app on the ATV to see what requests were being made.

This is where things get weird each time I enter and exit the Trailer app I get a different request. These are the first 3 I got:-

a772.w11.akamai.net forwarded to Forwarding Server 194.168.4.100
a772.w11.akamai.net resolved from Forwarding server as 23.65.22.169
a771.da1.akamai.net forwarded to Forwarding Server 194.168.4.100
a771.da1.akamai.net resolved from Forwarding server as 62.252.168.59
upp.itunes.apple.com.akadns.net forwarded to Forwarding Server 194.168.4.100
upp.itunes.apple.com.akadns.net resolved from Forwarding server as 17.173.66.77

I tried redirecting http://trailers.apple.com/ but nothing happens. So now the problem is how to know which request to redirect if it changes randomly? Maybe I'm just missing something, anyone have any ideas?