POC: Enabling Plex to Play BluRay ISOs

So I’ve been annoyed for a while that Plex (Emby, Jellyfin., et al) do not support BluRay ISOs.

While it makes sense that they can’t support menus (that doesn’t make sense in the context of them), it doesn’t make sense that they can’t support exporting individual playlists.

To prove how easy it is to do this, I’ve spent 2 weekends implementing 2 POCs that will enable you to to use them with these media servers without any changes to the media server themselves.

the first POC was a streaming http server. The http server took a url that included the file (iso image on server) and playlist # (i.e. mpls file) and would stream the m2ts stream to whomever asked for it. This worked perfectly with Emby as emby supports STRM files. Plex does not.

the second POC builds off the first, but instead of streaming over an http server, it provides a fuse file system that translates bluray playlists into m2ts file that can be played normally. This should (fingers crossed, tested in VLC) work fine with Plex.

Basically it expects a traditional file system with iso files in directories. To export a playlist as an m2ts file you create a small yaml file in the same directory as the iso that defines which iso and playlist should that m2ts file represent (conceptually possible to place this “m2ts” file in other directories, but not tested: i.e. if wanted Extras in a differnt dir)

example file: Rogue One (2016).m2ts

contents

file: Rogue One (2016).iso
playlist: 800

when viewed through the fuse file system, the file Rogue One (2016).m2ts will have the contents of playlist 800 of Rogue One (2016).iso

Implementing the fuse file system. took me about 2-4 hours (mostly learning fuse concepts). Implementing the plain bluray playlist reader took 2-4 hours. Hacking up the bluray reader to inject the language codes for the tracks from the bluray clipinfo data took a day or 2 (not really neccessary, but provides a better experience).

code is here: https://github.com/sjpotter/bluray-http-server/

fs as described above is in the bazil-fuse branch. needs go and libbluray to build.

can see more writeup here https://emby.media/community/index.php?/topic/85106-bluray-playlist-support-ive-written/

now you might ask: why? there are 3 primary reasons.

  1. original ISO is bug free format. All the MKV creators have had bugs (heck, MakeMKV just finally fixed an Atmos audio bug), so who wants to rip and rerip

  2. I have lots of images of burays accumulated over the year, I don’t want to spend time turning them into MKV

  3. most importantly. MKV is a terrible format for ISOs that have seamless branching content. if you have a movie with 3 cuts that relies on seamless branching, storing all 3 cuts as MKVs requires 3x the space. Storing them as ISOs with my method, does not.

#3 is why this should be supported natively, as its not, I built it myself

6 Likes

conceptually, the same process should be doable for DVDs, but their programs are a bit more complicated than bluray playlists (and/or libdvdread does less handholding of providing a straight seekable stream) so I’ll need to investigate that, but blurays were my my desire so what I did first.

reopened

OP - I agree with all 3 of your reasons. I was surprised and annoyed that Plex is not able to play ISOs, given that it has been around for a long time and so many people have asked for it.

I wonder how much of people’s time and electricity has been spent converting media so that it is compatible with Plex??? Unbelievable.

4 Likes

my POC is proving relatively stable. Its not perfect. I have a lot of ISOs and not everything streams well (not 100% sure why, but sometimes things that should be able to be direct played or streamed, throw errors, but if I force transcoding (i.e. by selecting a subtitle) it plays fine. some things don’t want to continue playing from where I left off, while others do it fine.

But it demonstrates that it can work fairly easily. Be even cleaner within Plex. Heck, a plugin interface that allows one to provide one’s own file types (i.e. I’d have to implement open, close, read, seek and perhaps metadata functions) would be easier and cleaner than this fs. but I’m somewhat surprised by how well it works as is.

Kodi seems to deal with ISO almost seamlessly from my experience. Couldn’t the same ISO support be implemented in PLEX? I really can’t be bothered converting 100’s of ISO files.

2 Likes

Not really. Kodi has 2 ways of dealing with BluRays.

  1. It can show the menu (for both DVDs and non java menu blurays on all platforms and for java based blurays on platforms that have a jvm, so that basically limits java menus to linux, windows and mac. you don’t get java menus on any android, ios or xbox machine)

  2. it can enumerate all playlists as numbers (but you have no idea what is on each playlist.

#1 isn’t something plex does (i.e. playing something in plex isn’t interactive, its just a stream of data).

#2 while conceptually possible in Plex, does’t provide for a good ux. i.e. plex doesn’t know what’s on each playlist nor can it easily deal with burays that provides hundreds of playlists as a protection mechanism.

What I’ve built, is instead of enumerating all playlist automatically, the end user can essentially tag which playlists they want to export (by creating stub files) and just name those stub files in a way that plex knows how to index them correctly.

1 Like

If you want to watch your DVDs and Blu-ray’s without converting them, just use the Infuse app for iOS and AppleTV.

I’ve got a huge library of both DVD & BD movies; been collecting them for over 15 years.

I no longer need to convert them to watch. I just use CloneBD to rip the main movie to my QNAP file server and then access the movies immediately from my AppleTV 4K and my iOS devices. You can choose a target size if space is a concern, but I don’t compress them at all. Full size on all of my BD rips.

Playback is very impressive over my current Tri-band Wireless-AC router.

Of course you’ll need AnyDVD-HD to disable the protection to rip it.

You can also connect to your Plex library so you can access all of your media in Infuse.

I rip my in folder format usually, such as BDMV (Blu-ray) and VIDEO_TS (DVD) as well as ISO formats and they all play just fine.

You can try if for free. You’ll be impressed.

It doesn’t (at least fully) support bluray menus and hence suffers from the normal problem. This solution (heck, infuse could run with the samw stub file concept) helps solve that. But in practice infuse is no different than kodi for that.

1 Like

this is awesome! i was experimenting with emby and strm files to see if i could have an strm point to a playlist. did not work. then i tried to have the strm reference my media center server jriver) which supports full bluray folder and iso backups with full menu support. it will transcode for clients if needed. however there were issues.

this is exactly what i am looking for except one thing, my backups are all folder rips, not iso. need to loom at your source code as i would want to modify to support folder,

cool stuff…

i have also tried infuse. no android support (i am mostly ios), no meta data for folder rips. it does play back but i have not beaten on it enough to see where the issues are, and there is always something…

and no good for tv shows. this solution would allow me to create references to tv show episoded which themselves are just another mpls file.

also curious - would this support the pgs subtitles?

  1. instead of .iso use the index.bdmv file and it should work
  2. for emby and strm files you can use the http server implementation
  3. it supports pgs subtitles just fine (would have same transcoding limitations as mkv)
  4. by default it doesn’t attach language tags to the streams (as they aren’t part of the ts stream, but the clp info), I have a hack that does it, but its really a hack.

very cool. thanks - will check this out and provide feedback

I should note this mostly works, but its still a hack. its something that plexserver should do natively (and considering that ffmpeg can do it, i.e. pass it a bluray and a plylist and it will spit out an m2ts file or whatever other remuxing you want). I’ve run into discs that have issues with the plex client (but play better over dlna).

Regretfully I had to install Kodi 18.6 only because there is no way to play .ISO images using PLEX out of the box. I store about 100 of them on an external USB drive connected to my NAS, I must say Kodi handles them very well and the imagine quality is excellent but I do dream of the day PLEX supports .ISO natively.

if you have a device that can run java, the yes, kodi is great for blurays. If you don’t have java, its less great, but still somewhat usable.

Have you considered using virtual FS instead of file server? e.g. mount ISO via FUSE so that Plex will see disc contents?

yes :slight_smile: to quote

the second POC builds off the first, but instead of streaming over an http server, it provides a fuse file system that translates bluray playlists into m2ts file that can be played normally. This should (fingers crossed, tested in VLC) work fine with Plex.

my experience has been a little inconsistent playing those “m2ts” files in plex, but part of me thinks a lot of it might be hd audio that my android tv doesn’t play nice with. As noted, it plays nice with vlc.

haven’t touched the code in a bit as have been busy with work.

Oh, cool! Sorry I have missed that somehow… Hope to hear some news from you soon :slight_smile:

not sure how much I’m going to be doing with it in the near future. As I noted, I have issues with plex on my Sony TV with it, so it wasn’t able to solve my problem well enough (it might be a plex issue as well, that it can’t realize that hd audio > 2.0 might not play nice on the TV and hence needs to be transcoded).

If people used it and provided fixes, I might have more motivation, but that hasn’t happened.