Hello!
Continuing the cycle of Apple-related articles, today I want to share an amazing way how you can make the Apple TV set-top box fall in love with the now-popular Matryoshka (MKV) and give it the ability to play comfortably on the big screen.
Without going into the history of creating the set-top box, in abbreviated mode, I would say that the first and second generation of the set-top box did not stick in Russia, only after the release of the third edition and the opening of the iTunes online store branch, the set-top box began to win back its place on users' TV stands.
So what is Apple TV?
')
Apple TV is a digital media player developed by Apple Inc. Modern Apple TV plays streaming multimedia (movies, music, podcasts, and photos) to widescreen LCD TVs and plasma screens from the iTunes library hosted on a Mac or PC, iPad internet tablets, iPod touch players, iPhone smartphones, or from the Internet services: iTunes Store, iCloud, Netflix, YouTube, Vimeo, Flickr (honestly taken from Wikipedia ).
The third generation of the console, equipped with a proprietary A5 processor (with one core blocked), turned out to be very powerful, capable of digesting 1080p video files without any problems.
Also, Apple TV has an excellent quality - AirPlay, a technology that allows you to send audio and video signals “over the air”, for example, from an iPhone and play it on a TV screen (this feature, by the way, is very popular among set-top box owners).
But despite the loud words, in the understanding of a simple man in the street, Apple TV has significant shortcomings, which classic media players lack:
- you cannot connect an external USB hard disk with movies to it;
- it does not know how to play the usual MKV format, prefers MP4 or M4V;
- for a comfortable viewing, blessed with Apple, you need to buy movies in the online store. This item is, of course, controversial.
And if in the first and second generation of the console, the problem of reproducing third-party formats was more or less solved by hacking (jailbreaking) and installing alternative software
aTV Flash , then the 3rd generation is already equipped with advanced protection, and despite numerous announcements, it’s not yet broken succeeded (running ahead - it is not required).
By and large, if you have an account in iTunes and the ability to buy movies, a fat channel, a media server on the local network, the compatibility problem disappears by itself ... but we always want more, don't we?
In principle, there is enough CPU performance on a set-top box to digest video files encoded in H.264 up to 1080p with a High profile or Main Profile level 4.0 or lower.
Since most BD rips in MKV contain video tracks with similar coding parameters, sometimes it is enough just to repack Matroska to M4V, for example, using
Subler or
remux software . In a Windows environment, preparing video files for your iTunes library is best with
MkvToMp4 .
And if too lazy to engage in media library?
There is a solution!
One day on Twitter, I noticed a link to the instruction, according to which it is possible to make friends with Apple TV with the Plex media library and play video files (including the desired non-converted MKV) from it. The project is called
PlexConnect .
Immediately I warn you, for Plex you need a computer to deploy the storage and proper storage of the library.Roughly speaking, the meaning of this project is that the computer acts as a DNS server - and when we open “Trailers” in the set-top box menu, the PlexConnect package intercepts network requests at trailers.apple.com and instead of data from the site in a sly way data from the local Plex library.
The project is based on Python, so if necessary, you must download it from the
official site , the developer insists
on version 2.7.5, not higher !
If you have not yet installed Plex, download it from the
official site and install it. The media library is set up in standard mode, for example, according to
this instruction .
From the project site, download
the PlexConnect package and unpack it into the PlexConnect folder:
I have in my folder - C: \ Program Files (x86) \ Plex \ Plex Connect, next to Plex itselfIn the
Settings.py
file, we make changes in the
ip_pms
field, specify the IP address of the server from the Plex Media Server.
Also in the same file on line 23 you can specify the DNS address of your network (the default is the address of the public DNS server Google 8.8.8.8):

Run the
PlexConnect.py
file.
In the case of Mac, we launch the Terminal, in which we type the commands:
cd PlexConnect
sudo python PlexConnect.py
Make sure the script is running:

For further steps, you need to remember the IP address of the computer running PlexConnect.
Switch to Apple TV and change the DNS server to the IP address of the computer running PlexConnect (Settings - Basic - Network - DNS manually):

Launch "Trailers" ...:

... and make sure that the interception hack worked, and PlexConnect loads the data from the local Plex database:

Here is the best proof of this:

Let's see, say, Top Gear, Season 9, Episode 1, Hammond returns:


If there are several audio tracks in a video file, you can switch between them:

You can switch between subtitles if they are embedded in the file:

Here is Clarkson's face:

You can always continue to play the movie from the last viewing point:

And you can use additional features like searching for a film similar to the genre of a film or a film with the same actors:

Specifically pointing out detailed screenshots - how well the PlexConnect media library fit into the Apple TV native interface!
For automated filling of meta tags and movie covers, I advise you to install the plugin Kinopoiska.ru, for this:
- Download the latest version of the module ;
- Copy the file kinopoisk.bundle to the folder:
- when adding folders with movies in the advanced settings we specify as Agent - KinoPoiskRU and Russian as the language for searching metadata:

- I also strongly recommend giving video files original movie titles, for example: Keinohrhasen.mkv (the German movie name is determined without error).
Outro
In conclusion, I would like to say that if the local Plex media library is correctly filled with all media tags (covers, descriptions, genres, actors, etc.), this method, based on the Apple TV deception, allows the prefix to be used as if it were in the case of using a full-fledged iTunes library.
As you can see, this method is easy to configure and unpretentious in operation, but the end result will pleasantly surprise you, as it struck me when you first started.
Good luck with your setup!
UPDATES
1. It is revealed that Plex still converts data on the fly in a format incompatible for Apple (for example, audio tracks in DTS):

2.
Localization is possible ! We download
archive with localized files and unpack above existing ones. Just in case, I advise you to backup your files. Replaces files from the
assets
folder.
Result on the screen:

It remains to contact the developer and inform him about this change.
3.
Important: the Apple TV 5.3 firmware update that has just arrived does not break the functionality, everything works .