• AnyStream is having some DRM issues currently, Netflix is not available in HD for the time being.
    Situations like this will always happen with AnyStream: streaming providers are continuously improving their countermeasures while we try to catch up, it's an ongoing cat-and-mouse game. Please be patient and don't flood our support or forum with requests, we are working on it 24/7 to get it resolved. Thank you.

Kodi project to enable HDR in MPC to launch any movie

Untitled-1.jpg finished the automatic script writer to smartly write the paths to the players inside the xml script. The paths will be changed in the final to point to xdrconfig.exe hdrcal part of the program.

'gets the install path of xdr to set path to mpchcfn.exe mpcbefn.exe and the script
CurrentUser.CreateSubKey("Software\\XDR\\").SetValue("pathtoxdr", xdrdataDirectory)
CurrentUser.Close()
Dim mpchckeyname As String = "HKEY_CURRENT_USER\Software\XDR"
Dim mpchcvaluename As String = "pathtompchc"
Dim mpchcvaluename1 As String = "pathtompcbe"
Dim mpchcvalue As String = ""
Dim mpchcvalue1 As String = ""
Dim mpchcreturnvalue As Object
Dim st = Chr(34)
'get the value for mpchc to test if player path is set or not
mpchcreturnvalue = GetValue(mpchckeyname, mpchcvaluename, mpchcvalue)
'ask for path to kodi users directory
'message sucess of player path stored
'used to get input from user to set paths to players for mpchcfn.exe and mpcbefn.exe as well as the playercorefactory.xml
Dim appData1 As String = GetFolderPath(SpecialFolder.ApplicationData)
MessageBox.Show("XDR Config has gathered enough information and has written a playercorefactory.xml file to your desktop! If you have Kodi installed place this file in your " & appData1 & "\kodi\userdata folder! If you have an existing playercorefactory.xml file rename it playercorefactory.bak and replace with this file. Then load Kodi and right click on any UHD 4K video file and select play with external players option and choose your player. If you have never used external players then you most likely will not have an existing playercorefactory.xml file. If you have a short memory the path to your Kodi directory is stored in your playercorefactory.xml file", "XDR Config")
' Write Xml to desktop
Dim mydocpath As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
Using sr As New StreamWriter(mydocpath & Convert.ToString("\playercorefactory.xml"))
'write file xdr.cal to desktop
sr.WriteLine("<!-- This script was written by XDR Config the Kodi HDR Project -->")
sr.WriteLine("<!-- Please place this file in " & appData1 & "\kodi\userdata folder! -->")
sr.WriteLine("<playercorefactory>")
sr.WriteLine("<players>")
If mpchcreturnvalue = "" Then GoTo skipmpchc :
'writepath from registry mpchc path substitute current directory later after testing
sr.WriteLine("<player name=" & st & "Launch XDR MPC-HC 64 Bit" & st & " type=" & st & "ExternalPlayer" & st & " audio=" & st & "false" & st & " video=" & st & "true" & st & ">")
sr.WriteLine("<filename>" & mpchcreturnvalue & "</filename>")
sr.WriteLine("<args>" & st & "{1}" & st & " /fullscreen /close</args>")
sr.WriteLine("<hidexbmc>false</hidexbmc>")
sr.WriteLine("<hideconsole>false</hideconsole>")
sr.WriteLine("<warpcursor>none</warpcursor>")
sr.WriteLine("</player>")
skipmpchc:
mpchcreturnvalue = GetValue(mpchckeyname, mpchcvaluename1, mpchcvalue1)
If mpchcreturnvalue = "" Then GoTo skipmpcbe :
sr.WriteLine("<player name=" & st & "Launch XDR MPC-BE 64 Bit" & st & " type=" & st & "ExternalPlayer" & st & " audio=" & st & "false" & st & " video=" & st & "true" & st & ">")
sr.WriteLine("<filename>" & mpchcreturnvalue & "</filename>")
sr.WriteLine("<args>" & st & "{1}" & st & " /fullscreen /close</args>")
sr.WriteLine("<hidexbmc>false</hidexbmc>")
sr.WriteLine("<hideconsole>false</hideconsole>")
sr.WriteLine("<warpcursor>none</warpcursor>")
sr.WriteLine("</player>")
skipmpcbe:
sr.WriteLine("</players>")
sr.WriteLine("</playercorefactory>")
End Using

screenshot:
playercorefactory.xml created on the desktop automatically. This program will find your user account name and write the path inside the xml.
I was thinking of a save as function then storing the path in regristry and if you changed anything in xdrconfig it would automatically update the data inside this script file by adding and removing items. I'm not sure if all builds of kodi use this directory so right now I'm opted to save to desktop.
 
I'm not sure if all builds of kodi use this directory so right now I'm opted to save to desktop.

All Windows Kodi builds use %APPDATA%\kodi\userdata as the playercorefactory.xml location.
v14 and older, before it became Kodi, use the same path but xbmc instead of kodi.

Typing %APPDATA%\kodi\userdata in file explorer or on the start menu should take you straight there if you want to check on your system (no need to know username)

Your program could automatically create the new xml file there (and automatically rename any existing to .bak)
 
Last edited:
All Windows Kodi builds use %APPDATA%\kodi\userdata as the playercorefactory.xml location.
v14 and older, before it became Kodi, use the same path but xbmc instead of kodi.

Typing %APPDATA%\kodi\userdata in file explorer or on the start menu should take you straight there if you want to check on your system (no need to know username)

Your program could automatically create the new xml file there (and automatically rename any existing to .bak)
Ok ill code it to save to that location. If user reloads xdrconfig and adds or removes a player ill make it rewrite xml so your changes show on the next time you load kodi. Had to use chr34 to write " in xml. This operator is reserved for data tostring so you have to manually insert them. Pain in the ass. But now I can generate custom xml files with live changes. Next week code xdrdesktop. Then hdr dev switch....
 
Untitled-1.jpg You will notice the buttons now change to tell if something is set or not. 90 hrs in and have finished the automatic detection of the playercorefactory.xml file to add and remove players in real time as well as detect an old playercorefactory.xml and rename it .bak then restore it if no players are set. Also if no players are set it disables xdr inside kodi. You can choose to turn on xdr in kodi or not even though players are set. Players set will be used for xdr desktop as well so I needed all this code to tell the pc what the user is trying to do. Even if the file exists or does not exist during running of xdr there are checks within checks to prevent xdr config from crashing when changing or backing up files. Even if the user taps into the registry and changes values it will still self check and no produce an error.

Guess madvr got an update for NVidia users to get one step closer to windows 10 automation. AMD users with this update now see a green screen. Better than black screen but no hdr passthru mpchc yet.

XDR will be simple and work. SDI users will use this forsure if madvr figures out automation without problems
 
Last edited:
This is awesome. Now passed the movie file into my program and now I can force hdr.cal files to load as the path and file name has been passed to xdr. Almost done the program...... this is working out great. This msg box is only a test to pass the right click in kodi to pass the arguments like full screen, name of file ect into my program so I can use front end to load the player and apply the xdr.cal settings automatically. Currently writing the code for xdrdesktop now. Then hdr trigger then I'm all done.

Untitled-1.jpg
 
Finished xdrdesktop tonight. Onto hdr tab and front ends that control switching. Already passed video files from kodi into xdr and applied hdr.cal settings. So close. Have to keep going friday. ...back to work....on the road again
 
Guess madvr got an update for NVidia users to get one step closer to windows 10 automation.

Yes, latest madVR update got HDR now switching automatically on my Nvidia card with MPC-HC. Intel/AMD aren't supported though, just Nvidia.
 
due to madvr and NVidia offering glitch free HDR I removed the trigger option and am going to offer a whole different solution to watch hdr material on all platforms. I'm just designing the other interfaces now. XDRCal looks like this. Also creating help me videos to help users understand how this program works.
Untitled-1.jpg
 
Untitled-10.jpg

First image is what EVERYONE is experiencing in playing these files. Dull lifeless.......now lets show you the same movie with XDR adjustments ....XDR ON

This is with my hdr tv in normal bt709 mode but the tv controls are UNLOCKED!
In terms of HDR this goes against the grain to all those pages explaining the gamma curve, white point, color bt2020 and bt709. All I can say is judge the results for yourself. This is something that non hdr users can definitely use! I like it so much I use it on my hdr tv with hdr off(sounds funny but you have to try it)

Hoping within 2-3 weeks this program will be ready for the world to use.Untitled-1.jpg Untitled-2.jpg Untitled-3.jpg Untitled-4.jpg Untitled-6.jpg Untitled-7.jpg Untitled-8.jpg
 
Last edited:
This is the final XDRConfig interface. Code is now complete for XDRConfig.

Untitled-9.jpg
 
An absolutely fascinating read and very exited by the video demonstration, so will be following this closely.
 
Special thks to imh1 for the link to hdr fireworks some XDR screenshots.....

First image XDR Adjustments OFF the rest its ON

Untitled-15.jpg
Untitled-14.jpg Untitled-13.jpg Untitled-12.jpg Untitled-11.jpg
 
I would like to thank redfox team in providing these forums to talk about htpc development.
 
update as of today: 1120 line of code. Got XDR Desktop to launch its default player in full screen from any movie file and apply xdrcal from the file (right click on) and backup the players settings. launch file from right click play with xdr in full screen and exit player on end. Then restore the original player settings and shutdown xdrdesktop.

I'm now at 140hrs into this project.

Next week I will work on the kodi mpchcfe.exe and mpcbe.exe front ends. These will be simple as they use the code to launch the player that xdrdesktop uses.

This program is very tight and runs very good! Well designed interface

until next week....

Untitled-16.jpg
 
All the code is done. Program works perfect.

Final files created

XDRConfig - setup kodi intergration, XDRdesktop and player paths
XDRDesktop - right click play with XDR.CAL files
XDRCAL - setup metadata per movie
mpchcfe -media player front end to launch mpchc64.exe inside kodi xml script
mpcbefe- media player front end to launch mpcbe64.exe inside kodi xml script

This whole program is error free. over 1300 lines of code.

This week I will be creating the professional installer then releasing to the public.

Very easy to load uhd file and set up the settings then close the player. The save as select folder appears. That's it.

Make sure each uhd file is in its own folder and the hdrcal file will trigger XDR to show HDR on HDR and non HDR tvs.

Pure HDR is the best but this is a huge development to allow users to view hdr with custom metadata with no user intervention!

Set and forget automation with XDR

If you feel this program is worth it donate by watching my paid youtube video (link in the application) which will get you the step though the source code and access to the code. The funds will be going towards my daughters education. Many hrs in front of the computer and 3 months of development. Ive enjoyed coding this program and am looking at coding a new microsoft custom presenter filter that can pass all the hdr formats. More information is coming out daily about hdr. Many love madvr and one day they will work out the bugs for different gpus. I guess you can use 50gig platters now with xdrcal file in the disk and it will play off discs. The software does not care if its a rom or hard drive. Just that the hdrcal file is in the folder with the movie. Remember compressing hdr signal will produce banding. Hdr needs the 40-50 gig to look good. With compression expect issues in dark areas. Ive seen some really nice 20 gig files but nothing compares to the original. Keep this in mind as hdr will require a ton of hd space. Bluray platters with 25 50 gig disks may be a route to go for backup purposes. I would love to try those disks from terminal who supposely figured a way to copy 1 to 1 but I refuse to download on any site. I would rather buy the movies but know that it is now possible to use 4k projectors and tvs that just missed hdr update to watch 4k with very close color and nice resolution on an 8 year old pc with an rx 470 video card. Just update the card and leave your other parts the way they are. Making you forced to buy intel kaby lake, special uhd player and buy powerdvd17 and hdr tv is kinda wack. I own hdr tv and uhd player and hdcp2.2 amp but took on this project to see if I could get this to look pretty close without hdr on and an older pc. My pc is amd 2+ with motherboard that still has pci white slots...lol

So all you need is the new kabylake or nvidia or amd that can support hvec 4k resolutions. Hevc is very heavy on cpu. Remember all those years people with heavy fast graphics cards could not play a youtube 4k video because they used vp9. Well those days are over. Youtube plays perfect in 4k and uhd on my 8 year old pc. Sorry but Im repeating this to get a point across. The card is doing it all in pcie8x slot! My other slot has pcie revo drive by ocz. Its very fast drive. I use it for editing videos on my youtube site.

If I have time tonight Ill create the installer. If not it will have to wait tell next week.

here is some screen shots.

Untitled-1.jpg Untitled-2.jpg Untitled-3.jpg Untitled-4.jpg Untitled-5.jpg Untitled-6.jpg Untitled-7.jpg Untitled-8.jpg Untitled-9.jpg Untitled-10.jpg
 
Last edited:
I want to mention that I have been following this. I signed up on this forum just to comment on this.

I am excited about this application and I will be more than happy to donate when you finish the installer and this is released. I just purchased my first 4K HDR projector that is connected to a Windows 10 PC running a Nvidia 1050 Ti and I feel this application you wrote will make playing 4K UHD HDR media on my Windows 10 PC enjoyable!
 
Please use this tool only if you own movie. I own 40 plus uhd disks and these test samples are just test files. Uhd on uhd player enables bt2020 color. The 12 units tint is only for bt709 tvs. My hdr tv I can set to bt2020 and it will be pretty close to the colors. All these screen shots were done bt709 color so what you see in these screenshots is exactly how it will look in windows. I will code 32bit version after this version is released. I will make a how to use xdr video showing you how to set this up. If you have hdr tv with intel kaby lake or amd rx 4,5 cards you can run hardware acceleration and it looks great and runs smooth. You can use lav filters to pass bitstream audio to get 7.1 as well or use dtsdecoder.dll which is covered on my youtube channel. My setup used ycbcr 444 hdmi and my tv supports this mode.
Custom presenter filter support yuv at 4k. Lav filter supports 2 settings. Copyback and native.

Madvr has started to show an hdr picture but does not trigger hdr on my tv. When you go full screen hdr goes dim. When you go windowed (which is lame) hdr effect kicks on but its off. Madshi is getting better with each update but not there yet.

My method is as close as your going to get in non hdr mode and it looks really nice without having to touch hdr tab in windows or mess with yout tv. Also xdr is smart to store your regular settings then apply xdrcal then return your player back to bluray levels without any user intervention.

Special thks to manixx2020 for test samples as I do not own any special equipment to bypass uhd. Most of my tests were on Youtube hdr and tv demo samples. Xdr runs at approx 26percent proccessor power on one thread as per my taskmanager tests while in monitor mode.
 
Last edited:
xdr vs madvr.jpg Special thks to imh11 for testing xdr beside madvrs solution. I noticed more natural colors and detail over hdr madvr. Here is his screenshot. Please remember the colors will shift if bt2020 color is used over bt709.

Remember you have total creative access to make XDR color, contrast and deep blacks anyway you want. Every movie uses different levels. XDR can make custom meta data for every video file. Can bump up Blu-ray, DVD, YouTube, UHD. Any video file at any resolution! This means 1080p 10bit 422 color UHD(HDR) is now possible if you encode a 4k rip to 1080p ;) Save hard drive space and enjoy HDR Dynamic range

xdr vs madvr.jpg
 
Last edited:
Back
Top