• 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

@general1
Sorry but I'm not an expert and i need to know your project. Ok it's all clear.
Great work, thank you so much.
 
You can see why this works according to this article on HDR.

https://msdn.microsoft.com/en-us/library/windows/desktop/mt742103(v=vs.85).aspx#high_dyncolors.

ange_and_wide_color_gamut_overview

Quote:

High Dynamic Range (HDR) displays a greater difference in light intensity from white to black, and Wide Color Gamut (WCG) provides a greater range of colors

This is why using upto +100 -100 in mpc hc can send out up to 300nits compared to 80nits default of bt709. So older LCDs and computer monitors can experience at least 40 to 50 percent of HDR with this idea giving making older equipment look great. On my HDR TV all these XDR settings look like the master UHD as my TV has a higher nit value. The color bt2020 is done panel side. So my colors with XDR adjustments are perfect vibrant color. So I guess I need to hook up a non HDR TV to switch to see how far I can go with the levels and release calibration files for projectors. I'll set all settings contrast and brightness to 50. Color to 50 and then adjust mpc. Then you guys will get better results.

Want perfect get a UHD source and the Blu-ray. Set UHD source to match Blu-ray as a start point. Then up the contrast as high as you can go with your monitor or projector tell a sky scene clouds loose detail. Stop and back it off a tad. You now have reached your highest nit value for your TV or monitor. Now findva dark scenes and drag brightness dial down tell details dissaperar. Back it off and now you have your max black nit value for your monitor. Now color pump up the saturation to match contrast as they both work hand and hand. Then drag tint to right until the skin color matches Blu-ray. This is a eyeball method to max out your monitor with dull UHD footage. Now compare Blu-ray at default and your mpc XDR settings. I bet yah your projector or LCD now has new life! It's not 1000nits but better than nothing. Now export the misc options. Then find max brightness contrast tint and saturation keys by selected edit on that exported .reg file. Use my XDR code and insert the values and save as HDR on.exe

If your brightness or contrast is a negative number the reg file will show hex! You must convert hex (ffff0) or whatever to a decimal. Google hex to decimal calculator. Enter that decimal number in .bat

Want a cmd window keep pause command at the end of the .bat

Remove and the window will load mil second then shut down.

Build the bat to .exe without admin manifest. Place the HDR on.exe in mpc hc folder.

You can create HDR for YouTube, movies documentaries. Night time day time. Whatever you want. Plus bump up the color or the panel now to make it pop with blacks and double contrast. What mpc is doing is adding double contrast above and beyond your default 80nits

My tv looks amazing. To get the same results use this tool to calibrate a non HDR monitor to get close to the source material. Now you can encode 1080p HDR and access it with all your TV controls. Or you can be forced to slide HDR tab drag and drop 4k UHD to play on an HDR monitor. The HDR way is the best way to go and like I said I'm already enjoying HDR. But HDR on PC in mpc without madvr is also possible and let's you use your i7 Intel or GPU without sgx.
 
Last edited:
1.0.0.3 is going to be written in vb with a nice menu system to offer 6 profiles. Then in the future releases you wil be able to create custom levels for every single source just like the hdr meta file. You will have an option to enabled forced xdr file calibration. With this feature enabled the program will look in the movies folder for a file called xdr.cal If it finds it it will change the values in mpc hc and mpc be to match your own settings per material. Every movie and clip is created with different levels of black and contrast. This is normally stored in the hdr meta file and the tv adjusts per clip in hdr mode. XDR will look if file is present then load the values and add the reg keys automatically then launch mpc hc or mpc be and the settings will appear automatically per clip. If the clip does not contain the xdr.cal file it will shut off xdr automatically and not change the players settings. This is the best I can do for hdr on an non hdr pc or tv.

The next release will have visual basic menu for selection of these modes:

BT2020 hdr monitors:

movie
documentary
YouTube hdr

BT709 for non hdr tvs

movie
documentary
Youtubehdr

You will now be able to display bt2020 color on bt709 color spec which will look pretty good. Tested on both and the results are very very close.

Anyway coding vb to exe and will release this soon. The bat to exe interface sucks. I want something that looks nice with tabs and eventually automatic no intervention launch of video for hdr. XDR is not HDR but pretty close to it. So don't go posting blah blah hdr this and that. If you want hdr to the T go buy a uhd player and uhd hdr tv and intel xgx and motherboard with kaby lake. This project is for others who can alreay play 4k on older cards and see more of the hdr material than a dull grey looking playback.

Start working on the code sunday. Just downloaded student ms package to create the .exe

Also like the idea of access to windows api modules so I can monitor the right click play as function in kodi to pass to my program then to mpc to create a non user interface to do this all automatically.
 
The kodi HDR project reaches version 1.0.0.3 and comes out of beta today. You can download it in the video description on my youtube channel even though most of you guys trust me I will not post downloadable links here.

In the new version:

Support for MPC HC 64bit
Support MPC BE 64bit
Added 8 presets access by a nice tight menu system to enable and disable the calibration's with one click.

Future versions will include:
Now that the interface is made I can code custom calibration setting to a XDR.CAL file and use vb to check if present. Then load the values and change the players automatic. This will allow dynamic metadata to be set per uhd or youtube hdr clip and launched with one item. I want this program to have a config window to turn on or off xdr but have the option to enable auto mode. In auto mode mpc hd or mpc be will be launched using external players and a front end will monitor the video file selected in the code and look for the xdr.cal

If it is found is will enable xdr and set it. If not it will play as thorugh xdr is off so you guys can set it and forget it.
Everyone want automation. Well XDR allows your to create a custom look for every hdr file and save it and it will load it automatic. Not every file is equal as hdr meta data changes per content. XDR allows you to mask these changes in your uhd collection. The presets is a beta feature that will not exist in future versions. What will be there is turn on XDR and turn of XDR. The a second program will be used to create the compatible hdr to xdr.cal file

This program will launch and you choose the path to the hdr file. It loads the hdr metatags and converts them to levels mpc can understand on hdr tvs and non hdr tvs. Then you place this file in the movie folder like you would with bluray. That's it. Turn on xdr and forget it and watch it do its magic.

Please note there are official ways to turn on hdr with the windows slider and proper equipment but that's not what this project is for.
It is basically a mp3 format for wav....or HDR to XDR
 
Here is the app window launched inside kodi. Only one option now to launch a XDR control panel.

Still no automation but will be in the next update. Also will create an installer that can be installed properly and uninstalled properly instead if having to move files around to get this working. I'll have my installer find your kodi .XML save it as bak and put my XML code to point to kodi HDR project folder in program files so no need to put the front end loader in a folder. There will be 3 files. Xdrcal.exe, xdrmpchcfn.exe and xdrmpcbefn.exe. fn files will be the front ends to the players to monitor actions in kodi and pass them and also be responsible to reach out and load the settings in the HDR.Cal automatically. HDR.Cal is created by xdrcal exe when you calibrate a movie or clip from HDR YouTube or wherever you get your UHD files. Very simple process. Load your player with UHD footage. Adjust sliders and close. Run HDRCal.exe and a HDR.Cal file will appear on desktop. Drop in in the movie folder with a cover.jpg and XML files from imbd data (used to get fancy info in kodi). That's it. Next time you load the movie it will apply those specific settings without any user intervention then after player is turned off reset to default. This will mimic HDR meta data as close as your going to get. Plus every TV is DIFFERENT so you can calibrate each UHD video to LOOK the best on YOUR TV or projector. Then you can add more with tvs processing more vivid color, enhanced contrast whatever......

Untitled-1.jpg Untitled11.jpg
 
Last edited:
Going to change the black to match kodi colors and logo. That way it fits in like a glove..... Black and buttons look OK but looks funny as the Kodi Windows look different. Guess ver 2.0.0.0 will have automation and proper colors and window like kodi menu. Have a work on the cars AC this week so I'm might not get around to writing the xdrcal program and front ends tell following week.
 
In my case (not tested it so much right now), the image pops-up on my Windows desktop, Kodi goes the the background. Maybe your screen settings within Kodi differs from mine?
 
In my case (not tested it so much right now), the image pops-up on my Windows desktop, Kodi goes the the background. Maybe your screen settings within Kodi differs from mine?
Can you post a screen shot?

Kodi shrink to taskbar?
 
Will look again when the boss (its the wife), is not in front of the TV anymore ;)

Edit: Yes. As soon as I choose the XDR control panel option within Kodi, the system switches to desktop with the XDR controlpanel in front and my (clean) desktop in the back. You can't see my taskbar, its disabled by me, with all the desktop icons.

With my remote I can make a selection and in the second screen that follows I confirm that. After that Kodi is coming back full screen and is responsive to my remote, so no mayor issue for me. No minor issue also, its fine the way it goes (for me that is).

(I don't see the images I've shared, maybe I can't share them as a picture?)

So by link...

1) https://goo.gl/photos/cuUdfe6snNbkqsQv5
2) https://goo.gl/photos/rjr5ddu8r7YUtbVH8
RfHfmRFxeeptvGRQ8

r94c5H1FddCX234J8
 
Last edited:
Will look again when the boss (its the wife), is not in front of the TV anymore ;)

Edit: Yes. As soon as I choose the XDR control panel option within Kodi, the system switches to desktop with the XDR controlpanel in front and my (clean) desktop in the back. You can't see my taskbar, its disabled by me, with all the desktop icons.

With my remote I can make a selection and in the second screen that follows I confirm that. After that Kodi is coming back full screen and is responsive to my remote, so no mayor issue for me. No minor issue also, its fine the way it goes (for me that is).

(I don't see the images I've shared, maybe I can't share them as a picture?)

So by link...

1) https://goo.gl/photos/cuUdfe6snNbkqsQv5
2) https://goo.gl/photos/rjr5ddu8r7YUtbVH8
RfHfmRFxeeptvGRQ8

r94c5H1FddCX234J8
Looks great. Love your desktop background.

This code is what hides or shows kodi like my screen.


<hidexbmc>false</hidexbmc>
<hideconsole>false</hideconsole>

Changing those lines in playercorefactory.xml file will change behavior of kodi shrinking into the background. Looking at that black box actually looks sweet. Maybe I'll leave it alone.
 
Another thing I'm going to offer is XDR desktop intergration. Right click play with..... Xdrmphc64.exe or xdrnpcbe64.exe.

Same idea as kodi but standalone. You load the movie and as long as there is XDR.Cal file in that movie folder it will apply XDR calibration before launching mpchc or mpcbe. Only restriction is each movie must be it's it's own folder with XDR.Cal file or you can batch them. Have one master XDR.Cal file and all your movies in one folder and all those movies will share the same XDR levels.
 
I'm more of a "remote" person. Want to do it all with just one hand, in that one remote for selecting what I want to see :)
Should I prefer one MPC over the other (HC/BE)?
 
Mpc be has some extra features but mostly the same items. The skin looks nicer. Can you change that script code and try again to see if kodi stays in the background? I would like it to remain like my setup.
 
Can you select XDR options in my pop-up window with your remote?
 
What I might do is install kodi on my laptop and run tests on another system. That way any format, size or desktop issues will be spotted that are missed on my HDR TV PC living room setup. Your windows sizes are bigger than mine so your desktop resolution native running 1080p I assume. I'm using UHD resolution when working on XDR interface. So it appears smaller on my desktop. I would assume many would run their desktops at UHD resolution but then again some programs the text would be TINY.
 
Nope, I have it all in 4k, desktop and Kodi, with W10 final with AU. I have everything at default, desktop wise, only changed the resolution within the Intel settings. Maybe your TV is bigger? I have a 55" LG panel. Or maybe its the hardware I use, full Intel Kaby Lake with latest driverset, no separate GPU (AMD/nVidia).

Yes I can turn the XDR option off with my remote in the popup (standard MCE remote).
 
Nope, I have it all in 4k, desktop and Kodi, with W10 final with AU. I have everything at default, desktop wise, only changed the resolution within the Intel settings. Maybe your TV is bigger? I have a 55" LG panel. Or maybe its the hardware I use, full Intel Kaby Lake with latest driverset, no separate GPU (AMD/nVidia).

Yes I can turn the XDR option off with my remote in the popup (standard MCE remote).
I'm running 65 inch HDR TV. Thanks for testing. Me and Max have pretty much perfected UHD samples inside mpchc and nvidia shield during testing. So your results with XDR should be really close to the Samsung and Philips UHD offerings.
 
Spent 6 hrs coding the XDR CAL file creation code. I have successfully set the levels, extracted them from the player and put the values into a file on the desktop called HDR.CAL

Then tried to set the levels to 0 and read from that file to put those saved values back into the registry and have got success!
So the conversion automation of xdr.cal works. I coded a routine to check if hdr.cal is present in the movie folder. If it finds it load the values. If not then shut down xdr.

Now I need to code if application is loaded mpc hc or mpc be to terminate if you are creating xdr conversion to prevent writing issues with open apps. Then I need to read the cmd for file selected and pass these values from kodi as you right clikc on the file to play in external players and pass the arguments to mpc mc but only pass them before xdr cal file values are added then launch the player and you will have custom hdr to xdr meta data for EVERY file you watch. Want a more spread or contrast to brightness or less saturation. Whatever you set and save to create the XDR.CAL will be the settings used when you watch THAT file. Every file will have its own set in stone presets.

This is great news.......Version 2.0.0.0 is coming soon with automation set and forget XDR
 
Thinking about workflow.

-Create installer
-Add XDR config panel to set paths to mpchcpcbe
-store these in XDR.ini in install folder to be doubled check in mpchcfn.exe and mpcbefn.exe.

If not set exit XDR point user to set paths. Users may install to different directories , solves this to have a pointer set

If condition true check if XDR.Cal present
If not set XDR default shut down

If condition true load value apply then launch player via XDR.ini set for path

XDR config

Set paths to write script .XML
If 2 players then write entries pointing to mpchcfn.exe in install path or mpcbefn.exe based upon paths selected.
Write .XML playerfactory kodi file to add only the amount of external players set in config into .XML script.
Ask user input for kodi directory...
Locate .XML if exists save as .bak.
Replace with created .XML

Pointers set, paths set, front ends mpchcfn and mpcbefn set.

User launches XDRcal.exe to create metadata

User launches player from option in HDRCal. Use paths set in config to lau CH.
Set pointer variable to note which player made adjustments.

User loads video, sets brightness contrast hue and saturation till satisfied. User apllies setting and shuts down player.

HDRCal detect app on do nothing
HDRCal detect app off ask user for directory to place HDR.Cal file

Directory selected add values to file close
Prompt user successful write.

This is my workflow regarding XDRcal

Future considerations
Check if video card HDR compatibl
Check if win creator update verify
If present use mpc hc or mpcbefn.exe to check if HDRCal?

If HDRCal check HDR flag trigger?
Flag trigger set HDR Windows tab on pass arg to madvr mpc hc mpcbe through mpchcfn.exe or mpcbefn.exe front end.
Set timer to 1 sec. Check if player loaded do nothing

Check movie finished player exit switch HDR tab to off. Shut down. Xdr.


So as you see I'm trying to give you guys some ideas in how I'm going to use this program to launch home made metadata and also offer user who knows the HDR file has proper flags to create HDR on option and all my program will do if act as a front end to monitor players. 1 sec timer is to prevent CPU overload of do while routine if application is running. Chew up to many CPU cycles. Check every sec reduces CPU load of monitor


I could switch the direct show filter to use custom presenter with XDR and madvr with HDR Windows tab on off. Will see when I get to that point to add this in XDR.ini settings.

Doing this all free. When released I'll throw a donate PayPal tab on webpage for people who want to thank me for the hrs spent coding this. Already 30 hrs in.....been fun getting the computer to do what I want it to do.....Never thought of writing a program that would be useful until now. I've seen some pretty stupid usless programs. Hope this one gets used by the htpc community.
 
Last edited:
Check if video card HDR compatible
Any idea how this check will go?

In all of the above, can you say if a Kaby Lake CPU as in a standalone setup, so not using a nVidia/AMD GPU, is supported?
 
Back
Top