sjpotter 12 Posted April 14, 2020 Posted April 14, 2020 (edited) So if you've seen my thread in the FR group,https://emby.media/community/index.php?/topic/84529-bluray-playlist-support I've been implementing a POC of bluray playlist support. i.e. I don't want to remux all my existing blurays (especially those that have significant seamless branching contnt), so I built something.I'd like people to try it, and see if they can get it to work for themselves. It should support regular and uhd blurays without a problem. To try it out one has to be able to compile go programs and have the libbluray library (and its dev packages) installed on your system. I know it works on linux, and figure it can work on windows as well, but probably needs some work for that (so willing to take patches). OSX is probably easier to integratethe setup of it is that you run an http server on your host and make http requests to it that have it stream a full bluray playlist ot emby. You create virtual video files via Emby's support of strm files to point Emby to the right URL on the http server. Emby then handles the rest. direct streaming or transcoding as needed. 1 major note: it takes a little bit of time for the stream to start. Emby makes 3 http calls to the server (one just fetching the file from byte 0, one fetching the end of it (to get timing I guess) and then back to 0. so it's a bit chatty and that adds to latency for starting up. simple instructions for use now. https://github.com/s...ray-http-server 1) build the server (assuming you have libbluray dev packages installed and pkg-config setup correctly) (conceptually, assuming pkg-config is setup correctly on window,s this should just build as well, but only tested on linux) go build ./cmd/bluray-server 2) run bluray-server ./bluray-server -port <some port #> 3) setup a library that emby will search (i.e. some directory) 4) create strm files with the "filename" that you care for emby to resolve (i.e. perhaps "Rogue One - A Star Wars Story (2018)")the format is http://localhost:<port#>/remuxm2ts?file=<url encoded full path to iso image>?playlist=<playlist #>url encoded file path is just the full file path url encoded (https://www.urlencoder.org/) playlist is the mpls number in the playlist directory that you want tostream example for me where I play my Rogue One UHD (with a random language I pulled, which changes the opening message)create file /emby-test/Rogue\ One\ -\ A\ Star\ Wars\ Story\ \(2016\).strm contents of file: http://localhost:8090/remuxm2ts?file=%2Fdata%2FMovies%20-%20Full%20UHD%20Blu-Ray%2FRogue%20One%20-%20A%20Star%20Wars%20Story%20%282016%29%2FRogue%20One%20-%20A%20Star%20Wars%20Story%20%282016%29.iso&playlist=806 (copy paste link to see full thing)emby will see this and create all its own metadata files in /emby-test and will hit my bluray-server and stream the UHD (as is if player supports it, or with transcoding as requested / required).tested with web browser (needs transcoding), vlc (plays great, even over wifi), kodi on android tv (plays without transcoding, but stutters a litte bit unsure if because of wifi or limitations of kodi's buffering / android tv).feedback would be appreciated. right now its aimed at the more technically inclined, and remember, it needs libbluray installed (on debian based distributions, that means apt-get install libbluray-dev also needs go installed: see golang.org to install on your local systems). Edited April 14, 2020 by sjpotter
sjpotter 12 Posted April 14, 2020 Author Posted April 14, 2020 Very cool, thanks ! you've already seen it. What I hope is that even if such a feature would never be integrated into Emby, if enough people want to use it as is, it would motivate the small additions that would make it integrate nicer into Emby (i.e. ways to specify chapters / audio track descriptions) as an external file. of course I could be wrong and the amount of people interested can be counted on two hands (though perhaps in binary)
crusher11 1101 Posted April 15, 2020 Posted April 15, 2020 Would it be possible to handle, say, multiple MKV files rather than an ISO file? I have a DVD which is a compilation of wrestling matches. Most are 4:3 but one is 16:9. On the DVD, it handles this by breaking out of the 4:3 title for one match, but obviously I can't mux them together like that due to the change in aspect ratio. If I could have a strm file to handle that transition somehow, while being able to treat it as one file with chapters and such, that would be ideal.
sjpotter 12 Posted April 15, 2020 Author Posted April 15, 2020 I'm not sure I understand the Q.first, right now its only for bluray ISOs, but conceptually could work for dvd's as well. I have a bigger interest in blurays, and DVDs are conceptually a bit more complicated to play (and end user to manually determine what to play), but the same process could be used. Instead of it outputing a bluray mpeg transport stream, it would output a dvd mpeg program stream (transport streams has advantages in general, but it should be doable) I expect to add DVD support eventually.But the reason I don't understand the Q. If you already have it as MKVs, shouldn't Emby handle it just fine? This is for when one doesn't want to save as MKVs (save a lot of seamless branching content) or just has a lot of legacy content in iso form.
crusher11 1101 Posted April 15, 2020 Posted April 15, 2020 As I said, part of the content is 4:3 and part is 16:9. So they can't be the same file.
sjpotter 12 Posted April 15, 2020 Author Posted April 15, 2020 i still don't understand the issue. what do you have today? multiple MKV files?
sjpotter 12 Posted April 15, 2020 Author Posted April 15, 2020 so, what's the problem? I assume you have some mkv for 16x9 and some mkv for 4x3? or is your point that you have a single MKV with 16x9 and 4x3 content and emby doesn't handle the transitions well?the issue in that case would be that MKV isn't really a good streaming format, so trying to stream it over http (even partial content) isn't going to be a great experience (I tried in my work on this, it "works", but not well)
crusher11 1101 Posted April 15, 2020 Posted April 15, 2020 The problem is that the source DVD switches back and forth between ratios seamlessly. Emby cannot do this, they have to be separate. Multi part movies aren't even properly supported by any of the apps I use.
sjpotter 12 Posted April 15, 2020 Author Posted April 15, 2020 yea, so I dont think this approach would help you. It be interesting to see what happens if it was streaming the mpeg 2 program stream if it could respect the mpeg 2's dynamic aspect ratio, but if I had to guess it wouldn't.MKV's don't support dynamic aspect ratios.
ozi83 1 Posted April 16, 2020 Posted April 16, 2020 Any chance of a docker container? Would love to try this on my Synology with some blurays that have 2D and 3D versions of a movie. Sent from my Pixel 3 using Tapatalk
sjpotter 12 Posted April 16, 2020 Author Posted April 16, 2020 (edited) that's very possible. It would be something likedocker run -v <host directory of isos>:/data -p <chosen host port>:8090 <image_name>you would then setup your STRM files ashttp://localhost:<chosenhost_port>/file=url_encode(/data/<sub path of host_directory to iso>)?playlist=<playlist you want to expose>does that all make sense to you? Edited April 16, 2020 by sjpotter
sjpotter 12 Posted April 16, 2020 Author Posted April 16, 2020 (edited) docker image per description above now available the below command should workdocker run -d --rm -v <host dir>:/data -p <localhost port>:8090 spotter/bluray-server:latestyour stream files would just be a url encoded dir assuming content is rooted at /data Edited April 16, 2020 by sjpotter 1
ozi83 1 Posted April 18, 2020 Posted April 18, 2020 Thank you for creating the Docker container, I just got it working with a test iso. I had to open the iso in makemkv to find the correct playlist, but it works. Great work sjpotter, thank you.
sjpotter 12 Posted April 18, 2020 Author Posted April 18, 2020 I've now written a fuse file system that avoids the need for the http server. Its effectively read only at this point in time (i.e. I have no idea what will happen if you try to modify it) the way it works is 1) build it a) checkout out git clone https://github.com/sjpotter/bluray-http-server.git cd bluray-http-server git checkout bazil-fuse build it go build ./cmd/bazil-fuse 2) setup "m2ts" files (really yaml configuration files) in directories that you want to m2ts files (i.e. real m2ts data, provided by the file system as defined by the yaml files) i.e. file Rogue One - A Star Wars Story (2016).m2ts will have contents--- file: Rogue One - A Star Wars Story (2016).isoplaylist: 800 --- this will tell the file system that file Rogue One - A Star Wars Story (2016).m2ts will be using the content from Rogue One - A Star Wars Story (2016).iso (in same directory) and its playlist # 800. 3) mount the file syste./bazil-fuse /some_iso_directory /<mount_point> one will then see /some_iso_directory "translated" into /<mount_point> (i.e. all files (besides ISOs) will still be visible and the m2ts files will have m2ts data. I've tested playing the m2ts files with vlc and it works. to get it to play nicer with emby, I'll need to end write support so that emby can write its metadata files to the directories. I have a handful of ideas to make this a little bit more useful 1) if no m2ts file exists and the iso has only 1 "reasonable" playlist (i.e. over some length), Automatically create the m2ts configuration file based on either the directory name or iso name 2) a utility that can enumerate all "reasonable" playlists and create the m2ts config files (that a user can then rename as appropriate. 1
sjpotter 12 Posted April 19, 2020 Author Posted April 19, 2020 (edited) So a little experiments. Downloaded the Emby app (have 2 weeks to try this out) and VLC to my Android TV (x940e). I have Rogue One - UHD Bluray able to be played 2 ways (one via http server and one via fuse file system).he file system approach works better in the app (makes sense, less http involved), but it seems to cause the app to choke if I try to select the PGSUB built into the stream. It also insists on transcoding the audio. The web browser approach wants to insist on transcoding the video (which being hevc at 4k isn't constructive, as expected things dont work well as dont have any hardware assisted transcoding)with VLC it's the opposite. Using it's UPNP browser I can see both versions with artwork, but for whatever reason its giving an error when trying to play the FS verison (The location.... cannot be played), but plays reasonably ok (direct streaming, not even audio transcoding and with subtitles). reasonably ok as it stutters a little in a way that the fs version didn't.in both cases it played hdr just fine. (rogue one not being a dolby vision title, no issue with that).still think it be a better overall experience with it built in Edited April 19, 2020 by sjpotter
sjpotter 12 Posted April 19, 2020 Author Posted April 19, 2020 also apparently, Plex people locked my thread announcing this. <shrug>
sjpotter 12 Posted April 19, 2020 Author Posted April 19, 2020 re my experiment above. the fuse fs crashed. think I wasn't checking for nil/null in all the right places (it is a poc after all) think that was the issue.
vj950 5 Posted August 30, 2020 Posted August 30, 2020 Hi, Stumbled upon your post while searching for iso support. I am very interested in this, I have bunch of bluray iso. I follow the concept but do not know how to start. I have no coding/tech knowledge, but am able to follow instructions. I use windows 10. I do not know how to do steps 1 and 4 of your instructions in the first post, others are easy. If you help me in building the server, that'll be great. (not familiar with fuse system).
abaxed 0 Posted February 10, 2021 Posted February 10, 2021 I found this thread while searching for a way to send (emby cast) my blu-ray ISOs via emby app on my phone to my OPPO blu-ray player which can play blu-ray ISOs w/o transconding. Thanks to sjpotter for thinking through this and going this far. I took your blu-ray server package from github and was able to build it (required some effort) successfully on my Windows 10 machine so can confirm it does build on windows. I had to make a minor change to "pkg/readers/bdreaderseeker.go" to avoid compile errors due to type mismatch but otherwise it built smoothly. So far I tried couple of blu-ray .isos with the strm file playlist as described. It seem to work fine on my webbrowser, and also on my iphone emby app direct play on my phone. (I don't have emby premiere yet so tried the 1 minute play to confirm). However when I try to cast it to my Oppo media player it appears to start loading it and quits around 75% mark. Both isos I tried showed the same behavior when device casting this way. I can emby-cast mkv files to the device with no issues so what could potentially be the issue here? Other than the playlist .strm file, is there another method I can try to emby-cast while your blu-ray server is running ..?
Luke 42078 Posted February 11, 2021 Posted February 11, 2021 Hi, you're saying you have an iso working in the web app? What does the strm point to?
sjpotter 12 Posted February 11, 2021 Author Posted February 11, 2021 9 minutes ago, Luke said: Hi, you're saying you have an iso working in the web app? What does the strm point to? I tested in the webapp earlier Quote 4) create strm files with the "filename" that you care for emby to resolve (i.e. perhaps "Rogue One - A Star Wars Story (2018)") the format is http://localhost:<port#>/remuxm2ts?file=<url encoded full path to iso image>?playlist=<playlist #> url encoded file path is just the full file path url encoded (https://www.urlencoder.org/) all it should have to point to is the webserver describing it as I said. all the webserver does is output an "m2ts" stream that corresponds to libbluray's playback of the playlist - hence, why I argue that this should be built in, no need to go through a webserver which loses metadata when streaming (chapters and language tags), just create metadata file (like I demonstrate in in the file system usage case) that says which playlist to play. emby server would load libbluray and essentially read it block by block like a regular m2ts file, and transcode it as needed. of course this means being able to load a plain C library from the C# code (which I don't know how to do, it was easy enough from go though).
Luke 42078 Posted February 11, 2021 Posted February 11, 2021 OK yea we don't currently support doing that with iso files. Your current workaround looks pretty good though.
sjpotter 12 Posted February 11, 2021 Author Posted February 11, 2021 yeah, I wrote this to motivate the value of it. It's a hack, it works, but its a hack. my secondary wish would be a better plugin interface that would enable me to do this myself in a way that integrates cleanly.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now